Skip to content

Commit

Permalink
Re-added getting started but it needs updating.
Browse files Browse the repository at this point in the history
  • Loading branch information
James Ladd committed Jan 4, 2017
1 parent 51cbb9b commit c28b00a
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -5,3 +5,7 @@
+.#*
.DS_Store
_site/
.idea/
*.iml


189 changes: 182 additions & 7 deletions discover/getting-started.html
Expand Up @@ -4,14 +4,189 @@
layout: default
---
<article>
<section>
<header><h1>Getting Started with Redline Smalltalk</h1></header>
<section>
<header><h1>Getting Started with Redline Smalltalk</h1></header>

<p>
This document is being updated with new instructions following the update Redline Smalltalk
</p>
<aside>
Currently, we only have geting started instructions for *nix style Operating Systems. We hope to have Windows directions before too long. If you would like to contribute to the effort, join the <a href="http://groups.google.com/group/redline-smalltalk">mailing list</a> and let us know.
</aside>

</section>
</article>
<header><h1>Quickiest Start - From executables</h1></header>

<p>
Follow these instructions to be executing Smalltalk code with Redline Smalltalk as quickly as possible. Note: '>' represents the prompt on your command line / shell.

{% highlight bash %}
>wget https://github.com/redline-smalltalk/redline-smalltalk.github.com/raw/master/assets/redline-deploy.zip
>unzip redline-deploy.zip -d redline
>cd redline
>./stic st.redline.example.HelloWorld
{% endhighlight %}
</p>

<p>
You should see the following message from Redline Smalltalk:

{% highlight bash %}
Hello World from Redline Smalltalk.
{% endhighlight %}
</p>

<p>
To execute your own Smalltalk code create a file with a '.st' extension using your favourite editor and then execute it with the 'stic' command. Note: Don't add the '.st' when executing with 'stic'. Open the HelloWorld.st file to see an example of Smalltalk code.
</p>

<header><h1>Quick Start - Executing Smalltalk Tests</h1></header>
<p>
When you want to run the Smalltalk Test Suite to ensure the runtime is working as expected you need to do the above quick start then issue the following command on your command line / shell. Note: When you build Redline from the sources the Smalltalk Test Suite is automatically run with each build.

{% highlight bash %}
>./stic st.redline.kernel.TestRunner
{% endhighlight %}
</p>
<p>
If you have decided to adopt a class and help Redline then you need to create a '.st' file in the corresponding folder under the 'rt' folder, and you need to put the associated test under the 'test' folder. For example, if you have adopted the Date class then you would create the 'Date.st' file that defines the Date class in the <i>'rt/st/redline/kernel'</i> folder, and a 'DateTest.st' file in the <i>'test/st/redline/kernel'</i> folder.</p>
<p>
Don't forget that you may need to edit the <i>'test/st/redline/core/TestSuite.st'</i> file to ensure your test is run as part of the suite.</p>
<p>
When you are happy with your adopted class and its tests you can email them to object@redline.st along with the DEVELOPER-CERTIFICATE-OF-ORIGIN to have them added to the project sources.
</p>

<header><h1>Quick Start - From sources</h1></header>

<p>
Follow these instructions to get Redline Smalltalk started with a clean build from source code, and a
running Smalltalk Hello World example. First you will need to get some of the dependencies for Redline sorted
out, these include:

<ul>
<li><a href="http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u2-download-1377129.html" target="_blank">JDK</a> - To compile Redline Smalltalks Java source code.
<li><a href="http://maven.apache.org/download.html" target="_blank">Apache Maven</a> - To handle the building, dependencies, testing and packaging for the Redline Smalltalk Java source code.
<li><a href="http://git-scm.com/" target="_blank">Git</a> - To fetch the source code for Redline Smalltalk.
</ul>
</p>

<p>
When you can do the following commands from your command prompt and get the associated results your environment is ready
for Redline Smalltalk. Note: '>' represents the prompt on your command line / shell.

{% highlight bash %}
> javac -version
javac 1.6.0_24

> mvn -v
Apache Maven 3.0.3 (r1075438; 2011-03-01 04:31:09+1100)

> git --version
git version 1.7.5.4
{% endhighlight %}
</p>

<p>
*Note: Java versions 1.5 or greater and Maven version 3.0 or greater is ok.
</p>
</section>

<section>
<header><h1>Getting The Source Code</h1></header>

<p>
You will need to get the Redline Smalltalk source code checked out from the GitHub repository into a folder where you
want to build Redline Smalltalk. Git will check out the source into a subfolder so the folder you should make and
cd (change directory) into should be a level above. For example, I put my projects in a 'dev' folder so I would be in
that folder when I get the source code. To get the source code execute the following command:

{% highlight bash %}
> git clone https://github.com/redline-smalltalk/redline-smalltalk
{% endhighlight %}
</p>
</section>

<section>
<header><h1>Compiling the Source Code</h1></header>

<p>
To compile the Redline Smalltalk source code you need to be in the 'redline-smalltalk' folder and execute the following
command:

{% highlight bash %}
> mvn clean install
{% endhighlight %}
</p>

<p>
The first time you issue this command Apache Maven will go out to the internet and fetch a lot of dependencies, and this
may take a lot of time. This happens only the first time, and subsequent runs will be much quicker. When Maven has
completed you should see the following output:

{% highlight bash %}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.383s
{% endhighlight %}
</p>


<p>
This process has built and Redline Smalltalk Java Archive and run a few tests against it. All of the build outputs we care
about are in the 'target/redline-deploy' sub-folder.
</p>
</section>

<section>
<header><h1>Executing Hello World</h1></header>

<p>
Redline Smalltalk comes with a few examples and one such example is a simple 'Hello World' script that displays a message
on your screen. Note that this is 'Hello World' example is a Smalltalk script and not a class, as Redline Smalltalk can be used
for simple scripts as well as full applications. Of course there are example classes as well. To execute the example you need
to follow these steps from your command prompt from within the 'redline-deploy' sub-folder:

{% highlight bash %}
>cd target/redline-deploy/
>export REDLINE_HOME=`cd "$REDLINE_HOME" > /dev/null && pwd`
>./stic -s examples/ st.redline.HelloWorld
{% endhighlight %}
</p>

<p>
You should see the following message from Redline Smalltalk:

{% highlight bash %}
Hello World from Redline Smalltalk.
{% endhighlight %}
</p>

<p>
You can see the script for the Hello World example under the 'examples' sub-folder. By convention Redline and Java keep source
files in sub-folders that correspond to the namespace of the class or script. So HelloWorld.st can be found in the sub-folder
'st/redline'. Please take a moment to look at the contents of this file.
</p>

<p>
If you run 'stic' without arguments you will see some usage information, from which you can see how to run scripts with sources
and libraries in different locations. The usage looks like this:
{% highlight bash %}
usage: stic [options] <source files>
-?,--help print this message.
-e <input> execute the Smalltalk code (enclosed in "" double quotes).
-r <path> where to find Redline. Defaults to environment REDLINE_HOME.
-s <paths> where to find input source files. Separate each path with :.
The paths src/main/smalltalk and src/test/smalltalk are
included by default. Ignored if -e specified.
-v,--verbose output messages about what Redline is doing.
{% endhighlight %}
</p>
<p>
This process has got the latest Redline Smalltalk source code, built it and ran a Smalltalk example. You may want to put the
resulting Redline Smalltalk code elsewhere on your system. If you do want to do this then copy the entire redline-deploy folder to
that location and be sure to set and export the REDLINE_HOME environment variable to that location.
</p>

<p>
You are now ready to work with Redline.
</p>
</section>
</article>

0 comments on commit c28b00a

Please sign in to comment.