diff --git a/akka-docs/intro/getting-started-first-java.rst b/akka-docs/intro/getting-started-first-java.rst index 32e8f36672..920f64521f 100644 --- a/akka-docs/intro/getting-started-first-java.rst +++ b/akka-docs/intro/getting-started-first-java.rst @@ -37,7 +37,7 @@ To check out the code using Git invoke the following:: $ git clone git://github.com/jboner/akka.git -Then you can navigate down to the tutorial:: +Then you can navigate down to the tutorial:: $ cd akka/akka-tutorials/akka-tutorial-first @@ -58,39 +58,49 @@ You can test your installation by invoking ``java``:: Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode) + Downloading and installing Akka ------------------------------- -To build and run the tutorial sample from the command line, you have to download Akka. If you prefer to use SBT to build and run the sample then you can skip this section and jump to the next one. +To build and run the tutorial sample from the command line, you have to download +Akka. If you prefer to use SBT to build and run the sample then you can skip +this section and jump to the next one. -Let's get the ``akka-1.1`` distribution of Akka core (not Akka Modules) from `http://akka.io/downloads `_. Once you have downloaded the distribution unzip it in the folder you would like to have Akka installed in, in my case I choose to install it in ``/Users/jboner/tools/``, simply by unzipping it to this directory. +Let's get the ``akka-actors-1.1.zip`` distribution of Akka from +http://akka.io/downloads/ which includes everything we need for this +tutorial. Once you have downloaded the distribution unzip it in the folder you +would like to have Akka installed in. In my case I choose to install it in +``/Users/jboner/tools/``, simply by unzipping it to this directory. -You need to do one more thing in order to install Akka properly: set the ``AKKA_HOME`` environment variable to the root of the distribution. In my case I'm opening up a shell, navigating down to the distribution, and setting the ``AKKA_HOME`` variable:: +You need to do one more thing in order to install Akka properly: set the +``AKKA_HOME`` environment variable to the root of the distribution. In my case +I'm opening up a shell, navigating down to the distribution, and setting the +``AKKA_HOME`` variable:: - $ cd /Users/jboner/tools/akka-1.1 + $ cd /Users/jboner/tools/akka-actors-1.1 $ export AKKA_HOME=`pwd` $ echo $AKKA_HOME - /Users/jboner/tools/akka-1.1 + /Users/jboner/tools/akka-actors-1.1 The distribution looks like this:: - $ ls -l - total 16944 - drwxr-xr-x 7 jboner staff 238 Apr 6 11:15 . - drwxr-xr-x 28 jboner staff 952 Apr 6 11:16 .. - drwxr-xr-x 17 jboner staff 578 Apr 6 11:16 deploy - drwxr-xr-x 26 jboner staff 884 Apr 6 11:16 dist - drwxr-xr-x 3 jboner staff 102 Apr 6 11:15 lib_managed - -rwxr-xr-x 1 jboner staff 8674105 Apr 6 11:15 scala-library.jar - drwxr-xr-x 4 jboner staff 136 Apr 6 11:16 scripts + $ ls -1 + config + doc + lib + src -- In the ``dist`` directory we have the Akka JARs, including sources and docs. -- In the ``lib_managed/compile`` directory we have Akka's dependency JARs. -- In the ``deploy`` directory we have the sample JARs. -- In the ``scripts`` directory we have scripts for running Akka. -- Finally ``scala-library.jar`` is the JAR for the latest Scala distribution that Akka depends on. +- In the ``config`` directory we have the Akka conf files. +- In the ``doc`` directory we have the documentation, API, doc JARs, and also + the source files for the tutorials. +- In the ``lib`` directory we have the Scala and Akka JARs. +- In the ``src`` directory we have the source JARs for Akka. -The only JAR we will need for this tutorial (apart from the ``scala-library.jar`` JAR) is the ``akka-actor-1.1.jar`` JAR in the ``dist`` directory. This is a self-contained JAR with zero dependencies and contains everything we need to write a system using Actors. + +The only JAR we will need for this tutorial (apart from the +``scala-library.jar`` JAR) is the ``akka-actor-1.1.jar`` JAR in the ``lib/akka`` +directory. This is a self-contained JAR with zero dependencies and contains +everything we need to write a system using Actors. Akka is very modular and has many JARs for containing different features. The core distribution has seven modules: @@ -102,7 +112,10 @@ Akka is very modular and has many JARs for containing different features. The co - ``akka-slf4j-1.1.jar`` -- SLF4J Event Handler Listener for logging with SLF4J - ``akka-testkit-1.1.jar`` -- Toolkit for testing Actors -We also have Akka Modules containing add-on modules outside the core of Akka. You can download the Akka Modules distribution from TODO. It contains Akka core as well. We will not be needing any modules there today, but for your information the module JARs are these: +We also have Akka Modules containing add-on modules outside the core of +Akka. You can download the Akka Modules distribution from TODO. It contains Akka +core as well. We will not be needing any modules there today, but for your +information the module JARs are these: - ``akka-kernel-1.1.jar`` -- Akka microkernel for running a bare-bones mini application server (embeds Jetty etc.) - ``akka-amqp-1.1.jar`` -- AMQP integration @@ -112,6 +125,7 @@ We also have Akka Modules containing add-on modules outside the core of Akka. Yo - ``akka-spring-1.1.jar`` -- Spring framework integration - ``akka-osgi-dependencies-bundle-1.1.jar`` -- OSGi support + Downloading and installing Maven -------------------------------- @@ -178,7 +192,7 @@ We also need to edit the ``pom.xml`` build file. Let's add the dependency we nee Akka Akka Maven2 Repository - http://www.scalablesolutions.se/akka/repository/ + http://akka.io/repository/ @@ -695,35 +709,42 @@ Before we package it up and run it, let's take a look at the full code now, with } } + Run it as a command line application ------------------------------------ -To build and run the tutorial from the command line, you need to have the Scala library JAR on the classpath. +If you have not typed in (or copied) the code for the tutorial as +``$AKKA_HOME/tutorial/akka/tutorial/first/java/Pi.java`` then now is the +time. When that's done open up a shell and step in to the Akka distribution +(``cd $AKKA_HOME``). -Scala can be downloaded from `http://www.scala-lang.org/downloads `_. Browse there and download the Scala 2.9.0.RC1 release. If you pick the ``tgz`` or ``zip`` distribution then just unzip it where you want it installed. If you pick the IzPack Installer then double click on it and follow the instructions. +First we need to compile the source file. That is done with Java's compiler +``javac``. Our application depends on the ``akka-actor-1.1.jar`` and the +``scala-library.jar`` JAR files, so let's add them to the compiler classpath +when we compile the source:: -The ``scala-library.jar`` resides in the ``scala-2.9.0.RC1/lib`` directory. Copy that to your project directory. + $ javac -cp lib/scala-library.jar:lib/akka/akka-actor-1.1.jar tutorial/akka/tutorial/first/java/Pi.java -If you have not typed in (or copied) the code for the tutorial as ``$AKKA_HOME/tutorial/akka/tutorial/first/java/Pi.java`` then now is the time. When that's done open up a shell and step in to the Akka distribution (``cd $AKKA_HOME``). - -First we need to compile the source file. That is done with Java's compiler ``javac``. Our application depends on the ``akka-actor-1.1.jar`` and the ``scala-library.jar`` JAR files, so let's add them to the compiler classpath when we compile the source:: - - $ javac -cp dist/akka-actor-1.1.jar:scala-library.jar tutorial/Pi.scala - -When we have compiled the source file we are ready to run the application. This is done with ``java`` but yet again we need to add the ``akka-actor-1.1.jar`` and the ``scala-library.jar`` JAR files to the classpath as well as the classes we compiled ourselves:: +When we have compiled the source file we are ready to run the application. This +is done with ``java`` but yet again we need to add the ``akka-actor-1.1.jar`` +and the ``scala-library.jar`` JAR files to the classpath as well as the classes +we compiled ourselves:: $ java \ - -cp dist/akka-actor-1.1.jar:scala-library.jar:tutorial \ + -cp lib/scala-library.jar:lib/akka/akka-actor-1.1.jar:tutorial \ akka.tutorial.java.first.Pi - AKKA_HOME is defined as [/Users/jboner/src/akka-stuff/akka-core] - loading config from [/Users/jboner/src/akka-stuff/akka-core/config/akka.conf]. + AKKA_HOME is defined as [/Users/jboner/tools/akka-actors-1.1] + loading config from [/Users/jboner/tools/akka-actors-1.1/config/akka.conf]. Pi estimate: 3.1435501812459323 Calculation time: 822 millis Yippee! It is working. -If you have not defined the ``AKKA_HOME`` environment variable then Akka can't find the ``akka.conf`` configuration file and will print out a ``Can’t load akka.conf`` warning. This is ok since it will then just use the defaults. +If you have not defined the ``AKKA_HOME`` environment variable then Akka can't +find the ``akka.conf`` configuration file and will print out a ``Can’t load +akka.conf`` warning. This is ok since it will then just use the defaults. + Run it inside Maven ------------------- diff --git a/akka-docs/intro/getting-started-first-scala-eclipse.rst b/akka-docs/intro/getting-started-first-scala-eclipse.rst index b4380490ef..f34cfb75f3 100644 --- a/akka-docs/intro/getting-started-first-scala-eclipse.rst +++ b/akka-docs/intro/getting-started-first-scala-eclipse.rst @@ -43,39 +43,49 @@ You can test your installation by invoking ``java``:: Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode) + Downloading and installing Akka ------------------------------- -To build and run the tutorial sample from the command line, you have to download Akka. If you prefer to use SBT to build and run the sample then you can skip this section and jump to the next one. +To build and run the tutorial sample from the command line, you have to download +Akka. If you prefer to use SBT to build and run the sample then you can skip +this section and jump to the next one. -Let's get the ``akka-1.1`` distribution of Akka core (not Akka Modules) from `http://akka.io/downloads `_. Once you have downloaded the distribution unzip it in the folder you would like to have Akka installed in, in my case I choose to install it in ``/Users/jboner/tools/``, simply by unzipping it to this directory. +Let's get the ``akka-actors-1.1.zip`` distribution of Akka from +http://akka.io/downloads/ which includes everything we need for this +tutorial. Once you have downloaded the distribution unzip it in the folder you +would like to have Akka installed in. In my case I choose to install it in +``/Users/jboner/tools/``, simply by unzipping it to this directory. -You need to do one more thing in order to install Akka properly: set the ``AKKA_HOME`` environment variable to the root of the distribution. In my case I'm opening up a shell, navigating down to the distribution, and setting the ``AKKA_HOME`` variable:: +You need to do one more thing in order to install Akka properly: set the +``AKKA_HOME`` environment variable to the root of the distribution. In my case +I'm opening up a shell, navigating down to the distribution, and setting the +``AKKA_HOME`` variable:: - $ cd /Users/jboner/tools/akka-1.1 + $ cd /Users/jboner/tools/akka-actors-1.1 $ export AKKA_HOME=`pwd` $ echo $AKKA_HOME - /Users/jboner/tools/akka-1.1 + /Users/jboner/tools/akka-actors-1.1 The distribution looks like this:: - $ ls -l - total 16944 - drwxr-xr-x 7 jboner staff 238 Apr 6 11:15 . - drwxr-xr-x 28 jboner staff 952 Apr 6 11:16 .. - drwxr-xr-x 17 jboner staff 578 Apr 6 11:16 deploy - drwxr-xr-x 26 jboner staff 884 Apr 6 11:16 dist - drwxr-xr-x 3 jboner staff 102 Apr 6 11:15 lib_managed - -rwxr-xr-x 1 jboner staff 8674105 Apr 6 11:15 scala-library.jar - drwxr-xr-x 4 jboner staff 136 Apr 6 11:16 scripts + $ ls -1 + config + doc + lib + src -- In the ``dist`` directory we have the Akka JARs, including sources and docs. -- In the ``lib_managed/compile`` directory we have Akka's dependency JARs. -- In the ``deploy`` directory we have the sample JARs. -- In the ``scripts`` directory we have scripts for running Akka. -- Finally ``scala-library.jar`` is the JAR for the latest Scala distribution that Akka depends on. +- In the ``config`` directory we have the Akka conf files. +- In the ``doc`` directory we have the documentation, API, doc JARs, and also + the source files for the tutorials. +- In the ``lib`` directory we have the Scala and Akka JARs. +- In the ``src`` directory we have the source JARs for Akka. -The only JAR we will need for this tutorial (apart from the ``scala-library.jar`` JAR) is the ``akka-actor-1.1.jar`` JAR in the ``dist`` directory. This is a self-contained JAR with zero dependencies and contains everything we need to write a system using Actors. + +The only JAR we will need for this tutorial (apart from the +``scala-library.jar`` JAR) is the ``akka-actor-1.1.jar`` JAR in the ``lib/akka`` +directory. This is a self-contained JAR with zero dependencies and contains +everything we need to write a system using Actors. Akka is very modular and has many JARs for containing different features. The core distribution has seven modules: @@ -84,10 +94,13 @@ Akka is very modular and has many JARs for containing different features. The co - ``akka-remote-1.1.jar`` -- Remote Actors - ``akka-stm-1.1.jar`` -- STM (Software Transactional Memory), transactors and transactional datastructures - ``akka-http-1.1.jar`` -- Akka Mist for continuation-based asynchronous HTTP and also Jersey integration -- ``akka-slf4j-1.1.jar`` -- SLF4J Event Handler Listener +- ``akka-slf4j-1.1.jar`` -- SLF4J Event Handler Listener for logging with SLF4J - ``akka-testkit-1.1.jar`` -- Toolkit for testing Actors -We also have Akka Modules containing add-on modules outside the core of Akka. You can download the Akka Modules distribution from TODO. It contains Akka core as well. We will not be needing any modules there today, but for your information the module JARs are these: +We also have Akka Modules containing add-on modules outside the core of +Akka. You can download the Akka Modules distribution from TODO. It contains Akka +core as well. We will not be needing any modules there today, but for your +information the module JARs are these: - ``akka-kernel-1.1.jar`` -- Akka microkernel for running a bare-bones mini application server (embeds Jetty etc.) - ``akka-amqp-1.1.jar`` -- AMQP integration @@ -97,6 +110,7 @@ We also have Akka Modules containing add-on modules outside the core of Akka. Yo - ``akka-spring-1.1.jar`` -- Spring framework integration - ``akka-osgi-dependencies-bundle-1.1.jar`` -- OSGi support + Downloading and installing the Scala IDE for Eclipse ---------------------------------------------------- diff --git a/akka-docs/intro/getting-started-first-scala.rst b/akka-docs/intro/getting-started-first-scala.rst index 07cfec7548..b6e5fca400 100644 --- a/akka-docs/intro/getting-started-first-scala.rst +++ b/akka-docs/intro/getting-started-first-scala.rst @@ -58,39 +58,49 @@ You can test your installation by invoking ``java``:: Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode) + Downloading and installing Akka ------------------------------- -To build and run the tutorial sample from the command line, you have to download Akka. If you prefer to use SBT to build and run the sample then you can skip this section and jump to the next one. +To build and run the tutorial sample from the command line, you have to download +Akka. If you prefer to use SBT to build and run the sample then you can skip +this section and jump to the next one. -Let's get the ``akka-1.1`` distribution of Akka core (not Akka Modules) from `http://akka.io/downloads `_. Once you have downloaded the distribution unzip it in the folder you would like to have Akka installed in, in my case I choose to install it in ``/Users/jboner/tools/``, simply by unzipping it to this directory. +Let's get the ``akka-actors-1.1.zip`` distribution of Akka from +http://akka.io/downloads/ which includes everything we need for this +tutorial. Once you have downloaded the distribution unzip it in the folder you +would like to have Akka installed in. In my case I choose to install it in +``/Users/jboner/tools/``, simply by unzipping it to this directory. -You need to do one more thing in order to install Akka properly: set the ``AKKA_HOME`` environment variable to the root of the distribution. In my case I'm opening up a shell, navigating down to the distribution, and setting the ``AKKA_HOME`` variable:: +You need to do one more thing in order to install Akka properly: set the +``AKKA_HOME`` environment variable to the root of the distribution. In my case +I'm opening up a shell, navigating down to the distribution, and setting the +``AKKA_HOME`` variable:: - $ cd /Users/jboner/tools/akka-1.1 + $ cd /Users/jboner/tools/akka-actors-1.1 $ export AKKA_HOME=`pwd` $ echo $AKKA_HOME - /Users/jboner/tools/akka-1.1 + /Users/jboner/tools/akka-actors-1.1 The distribution looks like this:: - $ ls -l - total 16944 - drwxr-xr-x 7 jboner staff 238 Apr 6 11:15 . - drwxr-xr-x 28 jboner staff 952 Apr 6 11:16 .. - drwxr-xr-x 17 jboner staff 578 Apr 6 11:16 deploy - drwxr-xr-x 26 jboner staff 884 Apr 6 11:16 dist - drwxr-xr-x 3 jboner staff 102 Apr 6 11:15 lib_managed - -rwxr-xr-x 1 jboner staff 8674105 Apr 6 11:15 scala-library.jar - drwxr-xr-x 4 jboner staff 136 Apr 6 11:16 scripts + $ ls -1 + config + doc + lib + src -- In the ``dist`` directory we have the Akka JARs, including sources and docs. -- In the ``lib_managed/compile`` directory we have Akka's dependency JARs. -- In the ``deploy`` directory we have the sample JARs. -- In the ``scripts`` directory we have scripts for running Akka. -- Finally ``scala-library.jar`` is the JAR for the latest Scala distribution that Akka depends on. +- In the ``config`` directory we have the Akka conf files. +- In the ``doc`` directory we have the documentation, API, doc JARs, and also + the source files for the tutorials. +- In the ``lib`` directory we have the Scala and Akka JARs. +- In the ``src`` directory we have the source JARs for Akka. -The only JAR we will need for this tutorial (apart from the ``scala-library.jar`` JAR) is the ``akka-actor-1.1.jar`` JAR in the ``dist`` directory. This is a self-contained JAR with zero dependencies and contains everything we need to write a system using Actors. + +The only JAR we will need for this tutorial (apart from the +``scala-library.jar`` JAR) is the ``akka-actor-1.1.jar`` JAR in the ``lib/akka`` +directory. This is a self-contained JAR with zero dependencies and contains +everything we need to write a system using Actors. Akka is very modular and has many JARs for containing different features. The core distribution has seven modules: @@ -99,10 +109,13 @@ Akka is very modular and has many JARs for containing different features. The co - ``akka-remote-1.1.jar`` -- Remote Actors - ``akka-stm-1.1.jar`` -- STM (Software Transactional Memory), transactors and transactional datastructures - ``akka-http-1.1.jar`` -- Akka Mist for continuation-based asynchronous HTTP and also Jersey integration -- ``akka-slf4j-1.1.jar`` -- SLF4J Event Handler Listener +- ``akka-slf4j-1.1.jar`` -- SLF4J Event Handler Listener for logging with SLF4J - ``akka-testkit-1.1.jar`` -- Toolkit for testing Actors -We also have Akka Modules containing add-on modules outside the core of Akka. You can download the Akka Modules distribution from TODO. It contains Akka core as well. We will not be needing any modules there today, but for your information the module JARs are these: +We also have Akka Modules containing add-on modules outside the core of +Akka. You can download the Akka Modules distribution from TODO. It contains Akka +core as well. We will not be needing any modules there today, but for your +information the module JARs are these: - ``akka-kernel-1.1.jar`` -- Akka microkernel for running a bare-bones mini application server (embeds Jetty etc.) - ``akka-amqp-1.1.jar`` -- AMQP integration @@ -112,6 +125,7 @@ We also have Akka Modules containing add-on modules outside the core of Akka. Yo - ``akka-spring-1.1.jar`` -- Spring framework integration - ``akka-osgi-dependencies-bundle-1.1.jar`` -- OSGi support + Downloading and installing Scala -------------------------------- @@ -171,9 +185,7 @@ Now we need to create a project definition using our Akka SBT plugin. We do that import sbt._ - class TutorialOneProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject { - val akkaRepo = "Akka Repo" at "http://akka.io/repository" - } + class TutorialOneProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject The magic is in mixing in the ``AkkaProject`` trait. @@ -507,15 +519,15 @@ If you have not typed in (or copied) the code for the tutorial as ``$AKKA_HOME/t First we need to compile the source file. That is done with Scala's compiler ``scalac``. Our application depends on the ``akka-actor-1.1.jar`` JAR file, so let's add that to the compiler classpath when we compile the source:: - $ scalac -cp dist/akka-actor-1.1.jar tutorial/Pi.scala + $ scalac -cp lib/akka/akka-actor-1.1.jar tutorial/Pi.scala When we have compiled the source file we are ready to run the application. This is done with ``java`` but yet again we need to add the ``akka-actor-1.1.jar`` JAR file to the classpath, and this time we also need to add the Scala runtime library ``scala-library.jar`` and the classes we compiled ourselves:: $ java \ - -cp dist/akka-actor-1.1.jar:scala-library.jar:tutorial \ + -cp lib/scala-library.jar:lib/akka/akka-actor-1.1.jar:. \ akka.tutorial.first.scala.Pi - AKKA_HOME is defined as [/Users/jboner/src/akka-stuff/akka-core] - loading config from [/Users/jboner/src/akka-stuff/akka-core/config/akka.conf]. + AKKA_HOME is defined as [/Users/jboner/tools/akka-actors-1.1] + loading config from [/Users/jboner/tools/akka-actors-1.1/config/akka.conf]. Pi estimate: 3.1435501812459323 Calculation time: 858 millis diff --git a/akka-tutorials/akka-tutorial-first/README b/akka-tutorials/akka-tutorial-first/README new file mode 100644 index 0000000000..f4b42f631f --- /dev/null +++ b/akka-tutorials/akka-tutorial-first/README @@ -0,0 +1,7 @@ +================ + First Tutorial +================ + +This is the source code for the first tutorial. + +See the Akka Documentation for information about this tutorial. diff --git a/akka-tutorials/akka-tutorial-first/pom.xml b/akka-tutorials/akka-tutorial-first/pom.xml index e6b1758877..b3e9f7319c 100644 --- a/akka-tutorials/akka-tutorial-first/pom.xml +++ b/akka-tutorials/akka-tutorial-first/pom.xml @@ -8,7 +8,7 @@ akka.tutorial.first.java akka-tutorial-first-java jar - 1.0-SNAPSHOT + 1.2-SNAPSHOT http://akka.io @@ -23,7 +23,7 @@ Akka Akka Maven2 Repository - http://www.scalablesolutions.se/akka/repository/ + http://akka.io/repository/ diff --git a/akka-tutorials/akka-tutorial-first/project/build.properties b/akka-tutorials/akka-tutorial-first/project/build.properties new file mode 100644 index 0000000000..bcee7b19c1 --- /dev/null +++ b/akka-tutorials/akka-tutorial-first/project/build.properties @@ -0,0 +1,5 @@ +project.organization=akka.tutorial.first.scala +project.name=akka-tutorial-first-scala +project.version=1.2-SNAPSHOT +build.scala.versions=2.9.0.RC3 +sbt.version=0.7.6.RC0 diff --git a/akka-tutorials/akka-tutorial-first/project/build/Project.scala b/akka-tutorials/akka-tutorial-first/project/build/Project.scala new file mode 100644 index 0000000000..975f2ce970 --- /dev/null +++ b/akka-tutorials/akka-tutorial-first/project/build/Project.scala @@ -0,0 +1,3 @@ +import sbt._ + +class TutorialOneProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject diff --git a/akka-tutorials/akka-tutorial-first/project/plugins/Plugins.scala b/akka-tutorials/akka-tutorial-first/project/plugins/Plugins.scala new file mode 100644 index 0000000000..aa263a988e --- /dev/null +++ b/akka-tutorials/akka-tutorial-first/project/plugins/Plugins.scala @@ -0,0 +1,6 @@ +import sbt._ + +class Plugins(info: ProjectInfo) extends PluginDefinition(info) { + val akkaRepo = "Akka Repo" at "http://akka.io/repository" + val akkaPlugin = "se.scalablesolutions.akka" % "akka-sbt-plugin" % "1.2-SNAPSHOT" +} diff --git a/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java b/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java index 24264b52a7..bb081af751 100644 --- a/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java +++ b/akka-tutorials/akka-tutorial-first/src/main/java/akka/tutorial/first/java/Pi.java @@ -18,31 +18,6 @@ import akka.routing.UntypedLoadBalancer; import java.util.concurrent.CountDownLatch; -/** - * First part in Akka tutorial for Java. - *

- * Calculates Pi. - *

- * Run on command line: - *

- *   $ cd akka-1.1
- *   $ export AKKA_HOME=`pwd`
- *   $ javac -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar akka/tutorial/first/java/Pi.java
- *   $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.first.java.Pi
- *   $ ...
- * 
- *

- * Run it in Maven: - *

- *   $ mvn
- *   > scala:console
- *   > val pi = new akka.tutorial.first.java.Pi
- *   > pi.calculate(4, 10000, 10000)
- *   > ...
- * 
- * - * @author Jonas Bonér - */ public class Pi { public static void main(String[] args) throws Exception { diff --git a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala index 6164ae00cb..51fcfac45d 100644 --- a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala +++ b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala @@ -12,32 +12,6 @@ import Routing._ import System.{currentTimeMillis => now} import java.util.concurrent.CountDownLatch -/** - * First part in Akka tutorial. - *

- * Calculates Pi. - *

- * Run on command line: - *

- *   $ cd akka-1.1
- *   $ export AKKA_HOME=`pwd`
- *   $ scalac -cp dist/akka-actor-1.2-SNAPSHOT.jar Pi.scala
- *   $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.first.scala.Pi
- *   $ ...
- * 
- *

- * Run it in SBT: - *

- *   $ sbt
- *   > update
- *   > console
- *   > akka.tutorial.first.scala.Pi.calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
- *   > ...
- *   > :quit
- * 
- * - * @author Jonas Bonér - */ object Pi extends App { calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000) diff --git a/akka-tutorials/akka-tutorial-second/README b/akka-tutorials/akka-tutorial-second/README new file mode 100644 index 0000000000..ed31bbca22 --- /dev/null +++ b/akka-tutorials/akka-tutorial-second/README @@ -0,0 +1,7 @@ +================= + Second Tutorial +================= + +This is the source code for the second tutorial. + +See the Akka Documentation for information about this tutorial. diff --git a/akka-tutorials/akka-tutorial-second/pom.xml b/akka-tutorials/akka-tutorial-second/pom.xml new file mode 100644 index 0000000000..cf7c46fd3b --- /dev/null +++ b/akka-tutorials/akka-tutorial-second/pom.xml @@ -0,0 +1,43 @@ + + + 4.0.0 + + akka-tutorial-second-java + akka.tutorial.second.java + akka-tutorial-second-java + jar + 1.2-SNAPSHOT + http://akka.io + + + + se.scalablesolutions.akka + akka-actor + 1.2-SNAPSHOT + + + + + + Akka + Akka Maven2 Repository + http://akka.io/repository/ + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.6 + 1.6 + + + + + diff --git a/akka-tutorials/akka-tutorial-second/project/build.properties b/akka-tutorials/akka-tutorial-second/project/build.properties new file mode 100644 index 0000000000..ae73049d36 --- /dev/null +++ b/akka-tutorials/akka-tutorial-second/project/build.properties @@ -0,0 +1,5 @@ +project.organization=akka.tutorial.second.scala +project.name=akka-tutorial-second-scala +project.version=1.2-SNAPSHOT +build.scala.versions=2.9.0.RC3 +sbt.version=0.7.6.RC0 diff --git a/akka-tutorials/akka-tutorial-second/project/build/Project.scala b/akka-tutorials/akka-tutorial-second/project/build/Project.scala new file mode 100644 index 0000000000..1d0b230149 --- /dev/null +++ b/akka-tutorials/akka-tutorial-second/project/build/Project.scala @@ -0,0 +1,3 @@ +import sbt._ + +class TutorialTwoProject(info: ProjectInfo) extends DefaultProject(info) with AkkaProject diff --git a/akka-tutorials/akka-tutorial-second/project/plugins/Plugins.scala b/akka-tutorials/akka-tutorial-second/project/plugins/Plugins.scala new file mode 100644 index 0000000000..aa263a988e --- /dev/null +++ b/akka-tutorials/akka-tutorial-second/project/plugins/Plugins.scala @@ -0,0 +1,6 @@ +import sbt._ + +class Plugins(info: ProjectInfo) extends PluginDefinition(info) { + val akkaRepo = "Akka Repo" at "http://akka.io/repository" + val akkaPlugin = "se.scalablesolutions.akka" % "akka-sbt-plugin" % "1.2-SNAPSHOT" +} diff --git a/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java b/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java index 1829428f5b..c8b47f46a2 100644 --- a/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java +++ b/akka-tutorials/akka-tutorial-second/src/main/java/akka/tutorial/java/second/Pi.java @@ -20,31 +20,6 @@ import akka.routing.InfiniteIterator; import akka.routing.Routing.Broadcast; import akka.routing.UntypedLoadBalancer; -/** - * Second part in Akka tutorial for Java. - *

- * Calculates Pi. - *

- * Run on command line: - *

- *   $ cd akka-1.1
- *   $ export AKKA_HOME=`pwd`
- *   $ javac -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar akka/tutorial/java/second/Pi.java
- *   $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.java.second.Pi
- *   $ ...
- * 
- *

- * Run it in Maven: - *

- *   $ mvn
- *   > scala:console
- *   > val pi = new akka.tutorial.java.second.Pi
- *   > pi.calculate(4, 10000, 10000)
- *   > ...
- * 
- * - * @author Jonas Bonér - */ public class Pi { public static void main(String[] args) throws Exception { diff --git a/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala b/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala index f671605359..ff4b8d9c4a 100644 --- a/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala +++ b/akka-tutorials/akka-tutorial-second/src/main/scala/Pi.scala @@ -13,32 +13,6 @@ import akka.dispatch.Future import System.{currentTimeMillis => now} -/** - * Second part in Akka tutorial. - *

- * Calculates Pi. - *

- * Run on command line: - *

- *   $ cd akka-1.1
- *   $ export AKKA_HOME=`pwd`
- *   $ scalac -cp dist/akka-actor-1.2-SNAPSHOT.jar Pi.scala
- *   $ java -cp dist/akka-actor-1.2-SNAPSHOT.jar:scala-library.jar:. akka.tutorial.second.Pi
- *   $ ...
- * 
- *

- * Run it in SBT: - *

- *   $ sbt
- *   > update
- *   > console
- *   > akka.tutorial.second.Pi.calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000)
- *   > ...
- *   > :quit
- * 
- * - * @author Jonas Bonér - */ object Pi extends App { calculate(nrOfWorkers = 4, nrOfElements = 10000, nrOfMessages = 10000) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 746f9d2f39..bab3658c35 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -244,9 +244,9 @@ class AkkaParentProject(info: ProjectInfo) extends ParentProject(info) with Exec } dependsOn (docs) lazy val releaseDownloads = task { - val distArchive = akkaDist.akkaCoreDist.distArchive + val distArchives = akkaDist.akkaActorsDist.distArchive +++ akkaDist.akkaCoreDist.distArchive val downloadsPath = localReleasePath / "downloads" - FileUtilities.copy(distArchive.get, downloadsPath, log).left.toOption + FileUtilities.copy(distArchives.get, downloadsPath, log).left.toOption } dependsOn (dist) lazy val dist = task { None } // dummy task @@ -494,6 +494,25 @@ class AkkaParentProject(info: ProjectInfo) extends ParentProject(info) with Exec class AkkaActorsDistProject(info: ProjectInfo) extends DefaultProject(info) with DistDocProject { def distName = "akka-actors" override def distDocName = "akka" + + override def distConfigSources = (akkaParent.info.projectPath / "config") * "*" + + override def distAction = super.distAction dependsOn (distTutorials) + + val distTutorialsPath = distDocPath / "tutorials" + + lazy val distTutorials = task { + val tutorials = Set(akka_tutorials.akka_tutorial_first, + akka_tutorials.akka_tutorial_second) + + tutorials.map { tutorial => + val tutorialPath = (tutorial.info.projectPath ##) + val tutorialFilterOut = ((tutorial.outputPath ##) ***) + val tutorialSources = (tutorialPath ***) --- tutorialFilterOut + val tutorialOutputPath = distTutorialsPath / tutorial.name + copyPaths(tutorialSources, tutorialOutputPath) + }.foldLeft(None: Option[String])(_ orElse _) + } dependsOn (distBase) } class AkkaCoreDistProject(info: ProjectInfo)extends DefaultProject(info) with DistProject {