Akka is using the excellent `SBT <http://code.google.com/p/simple-build-tool>`_ build system. So the first thing you have to do is to download and install SBT. You can read more about how to do that `here <http://code.google.com/p/simple-build-tool/wiki/Setup>`_ .
The SBT commands that you'll need to build Akka are all included below. If you want to find out more about SBT and using it for your own projects do read the `SBT documentation <http://code.google.com/p/simple-build-tool/wiki/RunningSbt>`_.
The Akka SBT build file is ``project/build/AkkaProject.scala`` with some properties defined in ``project/build.properties``.
Note that in the examples above we are calling ``sbt compile`` and ``sbt test`` and so on. SBT also has an interactive mode. If you just run ``sbt`` you enter the interactive SBT prompt and can enter the commands directly. This saves starting up a new JVM instance for each command and can be much faster and more convenient.
For example, building Akka as above is more commonly done like this:
::
% sbt
[info] Building project akka 1.1-SNAPSHOT against Scala 2.8.1
[info] using AkkaParentProject with sbt 0.7.5.RC0 and Scala 2.7.7
It's also possible to combine commands in a single call. For example, updating, testing, and publishing Akka to the local Ivy repository can be done with:
To build Akka Modules first build and publish Akka to your local Ivy repository as described above. Or using:
::
cd akka
sbt update publish-local
Then you can build Akka Modules using the same steps as building Akka. First update to get all dependencies (including the Akka core modules), then compile, test, or publish-local as needed. For example:
To build the Akka Modules microkernel (the same as the Akka Modules distribution download) use the ``dist`` command:
::
sbt dist
The distribution zip can be found in the dist directory and is called ``akka-modules-{version}.zip``.
To run the mircokernel, unzip the zip file, change into the unzipped directory, set the ``AKKA_HOME`` environment variable, and run the main jar file. For example:
::
unzip dist/akka-modules-1.1-SNAPSHOT.zip
cd akka-modules-1.1-SNAPSHOT
export AKKA_HOME=`pwd`
java -jar akka-modules-1.1-SNAPSHOT.jar
The microkernel will boot up and install the sample applications that reside in the distribution's ``deploy`` directory. You can deploy your own applications into the ``deploy`` directory as well.
This little script might help a bit. Just make sure you have the Akka distribution in the '$AKKA_HOME/dist' directory and then invoke this script to start up the kernel. The distribution is created in the './dist' dir for you if you invoke 'sbt dist'.
If you are managing dependencies by hand you can find out what all the compile dependencies are for each module by looking in the ``lib_managed/compile`` directories. For example, you can run this to create a listing of dependencies (providing you have the source code and have run ``sbt update``):
::
cd akka
ls -1 */lib_managed/compile
Here are the dependencies used by the Akka core modules.
akka-actor
^^^^^^^^^^
* No dependencies
akka-stm
^^^^^^^^
* Depends on akka-actor
* multiverse-alpha-0.6.2.jar
akka-typed-actor
^^^^^^^^^^^^^^^^
* Depends on akka-stm
* aopalliance-1.0.jar
* aspectwerkz-2.2.3.jar
* guice-all-2.0.jar
akka-remote
^^^^^^^^^^^
* Depends on akka-typed-actor
* commons-codec-1.4.jar
* commons-io-2.0.1.jar
* dispatch-json_2.8.1-0.7.8.jar
* guice-all-2.0.jar
* h2-lzf-1.0.jar
* jackson-core-asl-1.7.1.jar
* jackson-mapper-asl-1.7.1.jar
* junit-4.8.1.jar
* netty-3.2.3.Final.jar
* objenesis-1.2.jar
* protobuf-java-2.3.0.jar
* sjson_2.8.1-0.9.1.jar
akka-http
^^^^^^^^^
* Depends on akka-remote
* jsr250-api-1.0.jar
* jsr311-api-1.1.jar
----
Here are the dependencies used by the Akka modules.
akka-amqp
^^^^^^^^^
* Depends on akka-remote
* commons-cli-1.1.jar
* amqp-client-1.8.1.jar
akka-camel
^^^^^^^^^^
* Depends on akka-actor
* camel-core-2.5.0.jar
* commons-logging-api-1.1.jar
* commons-management-1.0.jar
akka-camel-typed
^^^^^^^^^^^^^^^^
* Depends on akka-typed-actor
* camel-core-2.5.0.jar
* commons-logging-api-1.1.jar
* commons-management-1.0.jar
akka-spring
^^^^^^^^^^^
* Depends on akka-camel
* akka-camel-typed
* commons-logging-1.1.1.jar
* spring-aop-3.0.4.RELEASE.jar
* spring-asm-3.0.4.RELEASE.jar
* spring-beans-3.0.4.RELEASE.jar
* spring-context-3.0.4.RELEASE.jar
* spring-core-3.0.4.RELEASE.jar
* spring-expression-3.0.4.RELEASE.jar
akka-scalaz
^^^^^^^^^^^
* Depends on akka-actor
* hawtdispatch-1.1.jar
* hawtdispatch-scala-1.1.jar
* scalaz-core_2.8.1-6.0-SNAPSHOT.jar
akka-kernel
^^^^^^^^^^^
* Depends on akka-http, akka-amqp, and akka-spring