-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgetting-started.html
120 lines (99 loc) · 5.57 KB
/
getting-started.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
layout: default
title: Getting Started
id: getting-started
---
<p class="text-content">
<h1>Getting Started</h1>
<h2>Software Requirements</h2>
You will need the following tools:
<ul>
<p class="text-content">
<li>
<h3>Git</h3>
The labs are on GitHub, so you will need Git to get to them. You can download Git <b><a href="http://git-scm.com/download">here</a></b>.<br>
An excellent tutorial for git can be found <b><a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">here</a></b>.
<p>
To clone the scala-labs repo, use the following command:<br>
<code>git clone --recursive [email protected]:scala-labs/scala-labs.git</code>
</p>
</li>
</p>
<p class="text-content">
<li>
<h3>Build</h3>
<p>
The Scala-labs projects can be built using Maven or Simple Build Tool (SBT). The preferable way is Maven.
</p>
<h4>Maven</h4>
<p>The labs (and Scala projects in general) are built exactly the same way as traditional java projects. mvn compile, mvn test etc. will just do fine.</p>
<h4>SBT</h4>
<p>
Download SBT <b><a href="http://code.google.com/p/simple-build-tool/downloads">here</a></b>.<br>
The build has been verified with SBT 0.7.4. Older versions might also work but have not ben tested.
Follow <b><a href="http://code.google.com/p/simple-build-tool/wiki/Setup">these instructions</a></b> to install it.<br>
<b><a href="http://code.google.com/p/simple-build-tool/wiki/RunningSbt">On this page</b></a> you can find the most common build options.<br><br>
Noteworthy: SBT uses for its dependency management the maven dependencies in the pom.xml. In case you use a custom location for your maven repository instead of the default one (~/.m2/repository), adjust the path in the SBT project config file: scala-labs/(solutions|labs)/project/build/ScalaLabsProject.scala accordingly. However, we advice to use maven.
</p>
</li>
</p>
<p class="text-content">
<li>
<h3>A Java VM</h3>
Scala compiles to JVM bytecode, so you will need a JVM to run any of the labs.
Download it <b><a href="http://java.com/download/index.jsp">here</a></b>.<br> or use the one that comes built into your OS.
We have tested on Java 5 and Java 6 without problems. Older versions are unlikely to work.
</li>
</p>
<p class="text-content">
<li>
<h3>Scala</h3>
Since this <i>is</i> a Scala lab, you will need a basic Scala installation.
To get one, go to the scala <b><a href="http://www.scala-lang.org/downloads">download</a></b> page and follow the
directions for your platform.<br> <b>N.B.</b>The labs use the final version of 2.9.0.
</li>
</p>
<p class="text-content">
<li>
<h3>IDE Support</h3>
There are scala plugins available for
<b><a href="http://www.scala-lang.org/node/94">Eclipse</a></b>,
<b><a href="http://plugins.intellij.net/plugin/?id=1347">IntelliJ</a></b> and
<b><a href="http://wiki.netbeans.org/Scala">Netbeans</a></b>,
but be warned: the maturity of these plugins is not exactly on par with the Java support that you might be accustomed to.<br>
<p>
At our live Scala Labs sessions we use the latest betas of the IntelliJ Idea Community Edition (IdeaIC) and nightly builds
of the Scala plugin since they are the most feature complete at the moment.<br>
</p>
<p>
The latest versions that we have tested and which work together well is the Intellij Community Edition version. Intellij's community versions can be downloaded <b><a href="http://www.jetbrains.com/idea/download/">here</a></b>.
You need to install the Scala plugin. This can be done using Intellij's plugin manager, go to <i>File -> Settings -> Plugins -> <tab available></i>, and check 'Scala'. After installing the plugin, Intellij has to be restarted.
</p>
<p>
Of course, you can always use your favorite text editor and build with Maven.
Some of us even switched back to <b><a href="http://thegreylensmansview.blogspot.com/2009/03/stone-tools-and-scala-development-part.html">emacs</a></b>.
</li>
</p>
</ul>
<h2>The labs</h2>
<p class="text-content">
After getting the code with Git (see above), you will have three maven/sbt projects called
<ul>
<li>
<b/><a href="http://github.com/scala-labs/scala-labs/tree/master/labs/">"labs"</a></b><br/>
The "labs" project has a lot of failing unit tests and your job is to fix them, starting with the super-simple
<a href="http://github.com/scala-labs/scala-labs/blob/master/labs/src/test/scala/org/scalalabs/basic/lab01/HelloWorldExerciseTest.scala">first test in the first basic lab</a>, which features our old friend "hello world". </li>
<li><b><a href="http://github.com/scala-labs/scala-labs/tree/master/solutions/">"solutions"</a>.</b><br/>
The "solutions" project contains our solutions in case you get stuck.
</li>
<li><b><a href="http://github.com/scala-labs/scala-labs/tree/master/playground/">"playground"</a>.</b><br/>
In the "playground/akka" directory you will find the akka lab, which contains a "start" and "finish" folder. "start" contains the labs, "finish" the solutions. This project needs to be built with sbt. Read the readme for further instructions.
</li>
</ul>
</p>
<p class="text-content">
In order to import the project in your IDE use the maven import feature of your IDE. Import the maven project under "labs" and "solutions".
You might have to define a JDK in the project settings before the project will compile.
</p>
<h2>Problems ?</h2>
If you encounter any problems, please join us at our <b><a href="http://groups.google.com/group/scala-labs">scala-labs google group</a></b>. Maybe we can help sort them out.