pekko/project/build/AkkaProject.scala

778 lines
40 KiB
Scala
Raw Normal View History

/*---------------------------------------------------------------------------\
| Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se> |
\---------------------------------------------------------------------------*/
2010-03-07 08:14:48 +01:00
import com.weiglewilczek.bnd4sbt.BNDPlugin
import java.io.File
import java.util.jar.Attributes
import java.util.jar.Attributes.Name._
import sbt._
import sbt.CompileOrder._
import spde._
class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// Compile settings
// -------------------------------------------------------------------------------------------------------------------
override def compileOptions = super.compileOptions ++
2010-06-01 18:41:39 +02:00
Seq("-deprecation",
"-Xmigration",
"-Xcheckinit",
"-Xstrict-warnings",
"-Xwarninit",
2010-05-25 12:24:15 +02:00
"-encoding", "utf8")
.map(x => CompileOption(x))
override def javaCompileOptions = JavaCompileOption("-Xlint:unchecked") :: super.javaCompileOptions.toList
// -------------------------------------------------------------------------------------------------------------------
// Deploy/dist settings
// -------------------------------------------------------------------------------------------------------------------
lazy val deployPath = info.projectPath / "deploy"
lazy val distPath = info.projectPath / "dist"
def distName = "%s_%s-%s.zip".format(name, buildScalaVersion, version)
2010-04-01 10:06:43 +02:00
lazy val dist = zipTask(allArtifacts, "dist", distName) dependsOn (`package`) describedAs("Zips up the distribution.")
// -------------------------------------------------------------------------------------------------------------------
2010-07-31 12:37:08 +02:00
// All repositories *must* go here! See ModuleConigurations below.
// -------------------------------------------------------------------------------------------------------------------
object Repositories {
lazy val AkkaRepo = MavenRepository("Akka Repository", "http://scalablesolutions.se/akka/repository")
2010-08-21 21:17:54 +12:00
lazy val CodehausRepo = MavenRepository("Codehaus Repo", "http://repository.codehaus.org")
2010-07-31 12:37:08 +02:00
lazy val EmbeddedRepo = MavenRepository("Embedded Repo", (info.projectPath / "embedded-repo").asURL.toString)
lazy val FusesourceSnapshotRepo = MavenRepository("Fusesource Snapshots", "http://repo.fusesource.com/nexus/content/repositories/snapshots")
lazy val GuiceyFruitRepo = MavenRepository("GuiceyFruit Repo", "http://guiceyfruit.googlecode.com/svn/repo/releases/")
lazy val JBossRepo = MavenRepository("JBoss Repo", "https://repository.jboss.org/nexus/content/groups/public/")
lazy val JavaNetRepo = MavenRepository("java.net Repo", "http://download.java.net/maven/2")
lazy val SonatypeSnapshotRepo = MavenRepository("Sonatype OSS Repo", "http://oss.sonatype.org/content/repositories/releases")
lazy val SunJDMKRepo = MavenRepository("Sun JDMK Repo", "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo")
2010-07-31 12:37:08 +02:00
}
// -------------------------------------------------------------------------------------------------------------------
// ModuleConfigurations
// Every dependency that cannot be resolved from the built-in repositories (Maven Central and Scala Tools Releases)
// must be resolved from a ModuleConfiguration. This will result in a significant acceleration of the update action.
// Therefore, if repositories are defined, this must happen as def, not as val.
// -------------------------------------------------------------------------------------------------------------------
2010-07-31 12:37:08 +02:00
import Repositories._
lazy val atmosphereModuleConfig = ModuleConfiguration("org.atmosphere", SonatypeSnapshotRepo)
lazy val grizzlyModuleConfig = ModuleConfiguration("com.sun.grizzly", JavaNetRepo)
lazy val guiceyFruitModuleConfig = ModuleConfiguration("org.guiceyfruit", GuiceyFruitRepo)
// lazy val hawtdispatchModuleConfig = ModuleConfiguration("org.fusesource.hawtdispatch", FusesourceSnapshotRepo)
lazy val jbossModuleConfig = ModuleConfiguration("org.jboss", JBossRepo)
lazy val jdmkModuleConfig = ModuleConfiguration("com.sun.jdmk", SunJDMKRepo)
2010-08-10 13:00:52 +02:00
lazy val jmsModuleConfig = ModuleConfiguration("javax.jms", SunJDMKRepo)
lazy val jmxModuleConfig = ModuleConfiguration("com.sun.jmx", SunJDMKRepo)
lazy val jerseyContrModuleConfig = ModuleConfiguration("com.sun.jersey.contribs", JavaNetRepo)
lazy val jerseyModuleConfig = ModuleConfiguration("com.sun.jersey", JavaNetRepo)
lazy val jgroupsModuleConfig = ModuleConfiguration("jgroups", JBossRepo)
2010-08-09 17:42:14 +02:00
lazy val liftModuleConfig = ModuleConfiguration("net.liftweb", ScalaToolsReleases)
2010-08-21 21:17:54 +12:00
lazy val multiverseModuleConfig = ModuleConfiguration("org.multiverse", CodehausRepo)
lazy val nettyModuleConfig = ModuleConfiguration("org.jboss.netty", JBossRepo)
lazy val scalaTestModuleConfig = ModuleConfiguration("org.scalatest", ScalaToolsSnapshots)
2010-08-11 13:41:09 +02:00
lazy val logbackModuleConfig = ModuleConfiguration("ch.qos.logback",sbt.DefaultMavenRepository)
lazy val embeddedRepo = EmbeddedRepo // This is the only exception, because the embedded repo is fast!
// -------------------------------------------------------------------------------------------------------------------
// Versions
// -------------------------------------------------------------------------------------------------------------------
lazy val ATMO_VERSION = "0.6.1"
lazy val CAMEL_VERSION = "2.4.0"
lazy val CASSANDRA_VERSION = "0.6.1"
lazy val DISPATCH_VERSION = "0.7.4"
lazy val HAWT_DISPATCH_VERSION = "1.0"
lazy val JACKSON_VERSION = "1.2.1"
lazy val JERSEY_VERSION = "1.2"
lazy val LIFT_VERSION = "2.1-M1"
lazy val MULTIVERSE_VERSION = "0.6"
lazy val SCALATEST_VERSION = "1.2-for-scala-2.8.0.final-SNAPSHOT"
lazy val LOGBACK_VERSION = "0.9.24"
lazy val SLF4J_VERSION = "1.6.0"
lazy val SPRING_VERSION = "3.0.3.RELEASE"
lazy val ASPECTWERKZ_VERSION = "2.2.1"
// -------------------------------------------------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------------------------------------------------
object Dependencies {
// Compile
lazy val annotation = "javax.annotation" % "jsr250-api" % "1.0" % "compile"
lazy val aopalliance = "aopalliance" % "aopalliance" % "1.0" % "compile"
lazy val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile"
lazy val atmo_jbossweb = "org.atmosphere" % "atmosphere-compat-jbossweb" % ATMO_VERSION % "compile"
lazy val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile"
lazy val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile"
lazy val atmo_tomcat = "org.atmosphere" % "atmosphere-compat-tomcat" % ATMO_VERSION % "compile"
lazy val atmo_weblogic = "org.atmosphere" % "atmosphere-compat-weblogic" % ATMO_VERSION % "compile"
lazy val atomikos_transactions = "com.atomikos" % "transactions" % "3.2.3" % "compile"
lazy val atomikos_transactions_api = "com.atomikos" % "transactions-api" % "3.2.3" % "compile"
lazy val atomikos_transactions_jta = "com.atomikos" % "transactions-jta" % "3.2.3" % "compile"
lazy val camel_core = "org.apache.camel" % "camel-core" % CAMEL_VERSION % "compile"
lazy val cassandra = "org.apache.cassandra" % "cassandra" % CASSANDRA_VERSION % "compile"
lazy val commons_codec = "commons-codec" % "commons-codec" % "1.4" % "compile"
lazy val commons_io = "commons-io" % "commons-io" % "1.4" % "compile"
lazy val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile"
lazy val configgy = "net.lag" % "configgy" % "2.8.0-1.5.5" % "compile"
lazy val dispatch_http = "net.databinder" % "dispatch-http_2.8.0" % DISPATCH_VERSION % "compile"
lazy val dispatch_json = "net.databinder" % "dispatch-json_2.8.0" % DISPATCH_VERSION % "compile"
lazy val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile"
lazy val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile"
lazy val h2_lzf = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile"
lazy val hawtdispatch = "org.fusesource.hawtdispatch" % "hawtdispatch-scala" % HAWT_DISPATCH_VERSION % "compile"
lazy val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % JACKSON_VERSION % "compile"
lazy val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % JACKSON_VERSION % "compile"
lazy val jackson_core_asl = "org.codehaus.jackson" % "jackson-core-asl" % JACKSON_VERSION % "compile"
lazy val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile"
lazy val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile"
lazy val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile"
lazy val jersey_contrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEY_VERSION % "compile"
lazy val jgroups = "jgroups" % "jgroups" % "2.9.0.GA" % "compile"
lazy val jsr166x = "jsr166x" % "jsr166x" % "1.0" % "compile"
lazy val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" % "compile"
lazy val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile"
lazy val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive
2010-03-02 00:34:14 -05:00
2010-08-09 17:42:14 +02:00
lazy val lift_util = "net.liftweb" % "lift-util_2.8.0" % LIFT_VERSION % "compile"
lazy val lift_webkit = "net.liftweb" % "lift-webkit_2.8.0" % LIFT_VERSION % "compile"
2010-03-02 00:34:14 -05:00
lazy val mongo = "org.mongodb" % "mongo-java-driver" % "2.0" % "compile"
lazy val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile" intransitive
lazy val netty = "org.jboss.netty" % "netty" % "3.2.1.Final" % "compile"
lazy val protobuf = "com.google.protobuf" % "protobuf-java" % "2.3.0" % "compile"
2010-07-21 11:17:43 +02:00
lazy val osgi_core = "org.osgi" % "org.osgi.core" % "4.2.0"
lazy val rabbit = "com.rabbitmq" % "amqp-client" % "1.8.1" % "compile"
lazy val redis = "com.redis" % "redisclient" % "2.8.0-1.4" % "compile"
lazy val sbinary = "sbinary" % "sbinary" % "2.8.0-0.3.1" % "compile"
lazy val servlet = "javax.servlet" % "servlet-api" % "2.5" % "compile"
2010-07-29 16:00:05 +05:30
lazy val sjson = "sjson.json" % "sjson" % "0.7-2.8.0" % "compile"
2010-08-11 17:02:44 +02:00
lazy val slf4j = "org.slf4j" % "slf4j-api" % SLF4J_VERSION % "compile"
2010-08-11 13:41:09 +02:00
lazy val logback = "ch.qos.logback" % "logback-classic" % LOGBACK_VERSION % "compile"
lazy val logback_core = "ch.qos.logback" % "logback-core" % LOGBACK_VERSION % "compile"
lazy val spring_beans = "org.springframework" % "spring-beans" % SPRING_VERSION % "compile"
lazy val spring_context = "org.springframework" % "spring-context" % SPRING_VERSION % "compile"
lazy val stax_api = "javax.xml.stream" % "stax-api" % "1.0-2" % "compile"
lazy val thrift = "com.facebook" % "thrift" % "r917130" % "compile"
lazy val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % ASPECTWERKZ_VERSION % "compile"
lazy val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % ASPECTWERKZ_VERSION % "compile"
// Test
lazy val camel_spring = "org.apache.camel" % "camel-spring" % CAMEL_VERSION % "test"
lazy val cassandra_clhm = "org.apache.cassandra" % "clhm-production" % CASSANDRA_VERSION % "test"
lazy val commons_coll = "commons-collections" % "commons-collections" % "3.2.1" % "test"
lazy val google_coll = "com.google.collections" % "google-collections" % "1.0" % "test"
lazy val high_scale = "org.apache.cassandra" % "high-scale-lib" % CASSANDRA_VERSION % "test"
lazy val jettyServer = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test"
lazy val junit = "junit" % "junit" % "4.5" % "test"
lazy val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test"
lazy val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test"
}
// -------------------------------------------------------------------------------------------------------------------
// Subprojects
// -------------------------------------------------------------------------------------------------------------------
lazy val akka_actors = project("akka-actors", "akka-actors", new AkkaCoreProject(_))
lazy val akka_typed_actors = project("akka-typed-actors", "akka-typed-actors", new AkkaCoreProject(_), akka_actors)
lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_), akka_typed_actors)
lazy val akka_amqp = project("akka-amqp", "akka-amqp", new AkkaAMQPProject(_), akka_core)
lazy val akka_http = project("akka-http", "akka-http", new AkkaHttpProject(_), akka_core, akka_camel)
lazy val akka_camel = project("akka-camel", "akka-camel", new AkkaCamelProject(_), akka_core)
lazy val akka_persistence = project("akka-persistence", "akka-persistence", new AkkaPersistenceParentProject(_))
lazy val akka_spring = project("akka-spring", "akka-spring", new AkkaSpringProject(_), akka_core, akka_camel)
lazy val akka_jta = project("akka-jta", "akka-jta", new AkkaJTAProject(_), akka_core)
lazy val akka_kernel = project("akka-kernel", "akka-kernel", new AkkaKernelProject(_),
akka_core, akka_http, akka_spring, akka_camel, akka_persistence, akka_amqp)
lazy val akka_osgi = project("akka-osgi", "akka-osgi", new AkkaOSGiParentProject(_))
lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_))
// -------------------------------------------------------------------------------------------------------------------
// Miscellaneous
// -------------------------------------------------------------------------------------------------------------------
2010-03-11 09:50:15 +01:00
override def mainClass = Some("se.scalablesolutions.akka.kernel.Main")
override def packageOptions =
manifestClassPath.map(cp => ManifestAttributes(
(Attributes.Name.CLASS_PATH, cp),
(IMPLEMENTATION_TITLE, "Akka"),
(IMPLEMENTATION_URL, "http://akkasource.org"),
2010-03-30 19:37:48 +02:00
(IMPLEMENTATION_VENDOR, "The Akka Project")
)).toList :::
getMainClass(false).map(MainClass(_)).toList
// create a manifest with all akka jars and dependency jars on classpath
override def manifestClassPath = Some(allArtifacts.getFiles
.filter(_.getName.endsWith(".jar"))
.filter(!_.getName.contains("servlet_2.4"))
.filter(!_.getName.contains("scala-library"))
.map("lib_managed/scala_%s/compile/".format(buildScalaVersion) + _.getName)
.mkString(" ") +
" scala-library.jar" +
" dist/akka-core_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-http_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-camel_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-amqp_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-persistence-common_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-persistence-redis_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-persistence-mongo_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-persistence-cassandra_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-kernel_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-spring_%s-%s.jar".format(buildScalaVersion, version) +
" dist/akka-jta_%s-%s.jar".format(buildScalaVersion, version)
)
2010-08-11 17:02:44 +02:00
//Exclude slf4j1.5.11 from the classpath, it's conflicting...
override def fullClasspath(config: Configuration): PathFinder = {
2010-08-12 13:38:13 +02:00
super.fullClasspath(config) ---
(super.fullClasspath(config) ** "slf4j*1.5.11.jar")
2010-08-11 17:02:44 +02:00
}
2010-08-06 16:03:36 +02:00
override def mainResources = super.mainResources +++
2010-08-12 13:38:13 +02:00
descendents(info.projectPath / "config", "*") ---
2010-08-16 12:48:15 +02:00
(super.mainResources ** "logback-test.xml")
2010-08-12 13:38:13 +02:00
2010-08-16 12:48:15 +02:00
override def testResources = super.testResources --- (super.testResources ** "logback-test.xml")
2010-05-28 22:05:44 +02:00
// ------------------------------------------------------------
2010-04-01 23:02:13 +02:00
// publishing
override def managedStyle = ManagedStyle.Maven
//override def defaultPublishRepository = Some(Resolver.file("maven-local", Path.userHome / ".m2" / "repository" asFile))
val publishTo = Resolver.file("maven-local", Path.userHome / ".m2" / "repository" asFile)
2010-08-23 13:55:14 +02:00
val sourceArtifact = Artifact(artifactID, "sources", "jar", Some("sources"), Nil, None)
val docsArtifact = Artifact(artifactID, "docs", "jar", Some("docs"), Nil, None)
2010-04-01 23:02:13 +02:00
// Credentials(Path.userHome / ".akka_publish_credentials", log)
//override def documentOptions = encodingUtf8.map(SimpleDocOption(_))
override def packageDocsJar = defaultJarPath("-docs.jar")
2010-08-23 13:55:14 +02:00
override def packageSrcJar= defaultJarPath("-sources.jar")
2010-04-01 23:02:13 +02:00
override def packageToPublishActions = super.packageToPublishActions ++ Seq(packageDocs, packageSrc)
override def pomExtra =
<inceptionYear>2009</inceptionYear>
<url>http://akkasource.org</url>
<organization>
<name>Scalable Solutions AB</name>
<url>http://scalablesolutions.se</url>
</organization>
<licenses>
<license>
<name>Apache 2</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
2010-06-01 18:41:39 +02:00
// publish to local mvn
import Process._
lazy val publishLocalMvn = runMvnInstall
def runMvnInstall = task {
for (absPath <- akkaArtifacts.getPaths) {
val artifactRE = """(.*)/dist/(.*)-(.*).jar""".r
val artifactRE(path, artifactId, artifactVersion) = absPath
val command = "mvn install:install-file" +
" -Dfile=" + absPath +
" -DgroupId=se.scalablesolutions.akka" +
" -DartifactId=" + artifactId +
" -Dversion=" + version +
" -Dpackaging=jar -DgeneratePom=true"
command ! log
}
None
} dependsOn(dist) describedAs("Run mvn install for artifacts in dist.")
// -------------------------------------------------------------------------------------------------------------------
// akka-actors subproject
// -------------------------------------------------------------------------------------------------------------------
class AkkaActorsProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val configgy = Dependencies.configgy
val hawtdispatch = Dependencies.hawtdispatch
val multiverse = Dependencies.multiverse
val jsr166x = Dependencies.jsr166x
val slf4j = Dependencies.slf4j
val logback = Dependencies.logback
val logback_core = Dependencies.logback_core
// testing
val junit = Dependencies.junit
val scalatest = Dependencies.scalatest
}
class AkkaTypedActorsProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val aopalliance = Dependencies.aopalliance
val werkz = Dependencies.werkz
val werkz_core = Dependencies.werkz_core
// testing
val junit = Dependencies.junit
val scalatest = Dependencies.scalatest
}
2010-03-02 00:34:14 -05:00
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-core subproject
// -------------------------------------------------------------------------------------------------------------------
2010-08-18 15:15:22 +02:00
class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val commons_codec = Dependencies.commons_codec
val commons_io = Dependencies.commons_io
val dispatch_http = Dependencies.dispatch_http
val dispatch_json = Dependencies.dispatch_json
val guicey = Dependencies.guicey
val h2_lzf = Dependencies.h2_lzf
val jackson = Dependencies.jackson
val jackson_core = Dependencies.jackson_core
val jgroups = Dependencies.jgroups
val jta_1_1 = Dependencies.jta_1_1
val netty = Dependencies.netty
val protobuf = Dependencies.protobuf
val sbinary = Dependencies.sbinary
val sjson = Dependencies.sjson
2010-06-01 18:41:39 +02:00
// testing
val junit = Dependencies.junit
val scalatest = Dependencies.scalatest
2010-08-03 16:13:19 +02:00
override def bndImportPackage = "javax.transaction;version=1.1" :: super.bndImportPackage.toList
2010-03-02 00:34:14 -05:00
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-amqp subproject
// -------------------------------------------------------------------------------------------------------------------
2010-08-18 15:15:22 +02:00
class AkkaAMQPProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val commons_io = Dependencies.commons_io
val rabbit = Dependencies.rabbit
val protobuf = Dependencies.protobuf
2010-07-02 09:50:26 +02:00
// testing
val junit = Dependencies.junit
val multiverse = Dependencies.multiverse
val scalatest = Dependencies.scalatest
2010-03-02 00:34:14 -05:00
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-http subproject
// -------------------------------------------------------------------------------------------------------------------
2010-08-18 15:15:22 +02:00
class AkkaHttpProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val annotation = Dependencies.annotation
val atmo = Dependencies.atmo
val atmo_jbossweb = Dependencies.atmo_jbossweb
val atmo_jersey = Dependencies.atmo_jersey
val atmo_runtime = Dependencies.atmo_runtime
val atmo_tomcat = Dependencies.atmo_tomcat
val atmo_weblogic = Dependencies.atmo_weblogic
val grizzly = Dependencies.grizzly
val jackson_core_asl = Dependencies.jackson_core_asl
val jersey = Dependencies.jersey
val jersey_contrib = Dependencies.jersey_contrib
val jersey_json = Dependencies.jersey_json
val jersey_server = Dependencies.jersey_server
val jsr311 = Dependencies.jsr311
val servlet = Dependencies.servlet
val stax_api = Dependencies.stax_api
2010-06-01 18:41:39 +02:00
2010-03-05 09:17:15 +01:00
// testing
val junit = Dependencies.junit
val mockito = Dependencies.mockito
val scalatest = Dependencies.scalatest
2010-03-02 00:34:14 -05:00
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-camel subproject
// -------------------------------------------------------------------------------------------------------------------
2010-08-18 15:15:22 +02:00
class AkkaCamelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val camel_core = Dependencies.camel_core
2010-03-16 06:45:04 +01:00
}
2010-03-02 00:34:14 -05:00
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence subproject
// -------------------------------------------------------------------------------------------------------------------
class AkkaPersistenceParentProject(info: ProjectInfo) extends ParentProject(info) {
lazy val akka_persistence_common = project("akka-persistence-common", "akka-persistence-common",
new AkkaPersistenceCommonProject(_), akka_core)
lazy val akka_persistence_redis = project("akka-persistence-redis", "akka-persistence-redis",
new AkkaRedisProject(_), akka_persistence_common)
lazy val akka_persistence_mongo = project("akka-persistence-mongo", "akka-persistence-mongo",
new AkkaMongoProject(_), akka_persistence_common)
lazy val akka_persistence_cassandra = project("akka-persistence-cassandra", "akka-persistence-cassandra",
new AkkaCassandraProject(_), akka_persistence_common)
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence-common subproject
// -------------------------------------------------------------------------------------------------------------------
2010-08-10 21:42:27 +02:00
class AkkaPersistenceCommonProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val commons_pool = Dependencies.commons_pool
val thrift = Dependencies.thrift
2010-03-02 00:34:14 -05:00
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence-redis subproject
// -------------------------------------------------------------------------------------------------------------------
class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val commons_codec = Dependencies.commons_codec
val redis = Dependencies.redis
override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
2010-03-02 00:34:14 -05:00
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence-mongo subproject
// -------------------------------------------------------------------------------------------------------------------
class AkkaMongoProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val mongo = Dependencies.mongo
override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
2010-03-02 00:34:14 -05:00
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence-cassandra subproject
// -------------------------------------------------------------------------------------------------------------------
class AkkaCassandraProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val cassandra = Dependencies.cassandra
// testing
val cassandra_clhm = Dependencies.cassandra_clhm
val commons_coll = Dependencies.commons_coll
val google_coll = Dependencies.google_coll
val high_scale = Dependencies.high_scale
2010-03-02 00:34:14 -05:00
override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
2010-03-02 00:34:14 -05:00
}
// -------------------------------------------------------------------------------------------------------------------
// akka-kernel subproject
// -------------------------------------------------------------------------------------------------------------------
class AkkaKernelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath)
// -------------------------------------------------------------------------------------------------------------------
// akka-spring subproject
// -------------------------------------------------------------------------------------------------------------------
2010-08-18 15:15:22 +02:00
class AkkaSpringProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val spring_beans = Dependencies.spring_beans
val spring_context = Dependencies.spring_context
// testing
val camel_spring = Dependencies.camel_spring
val junit = Dependencies.junit
val scalatest = Dependencies.scalatest
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// akka-jta subproject
// -------------------------------------------------------------------------------------------------------------------
2010-08-18 15:15:22 +02:00
class AkkaJTAProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val atomikos_transactions = Dependencies.atomikos_transactions
val atomikos_transactions_api = Dependencies.atomikos_transactions_api
val atomikos_transactions_jta = Dependencies.atomikos_transactions_jta
val jta_1_1 = Dependencies.jta_1_1
//val atomikos_transactions_util = "com.atomikos" % "transactions-util" % "3.2.3" % "compile"
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// OSGi stuff
// -------------------------------------------------------------------------------------------------------------------
class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) {
lazy val akka_osgi_dependencies_bundle = project("akka-osgi-dependencies-bundle", "akka-osgi-dependencies-bundle",
new AkkaOSGiDependenciesBundleProject(_), akka_kernel, akka_jta) // akka_kernel does not depend on akka_jta (why?) therefore we list akka_jta here
lazy val akka_osgi_assembly = project("akka-osgi-assembly", "akka-osgi-assembly",
new AkkaOSGiAssemblyProject(_), akka_osgi_dependencies_bundle, akka_core, akka_amqp, akka_http,
akka_camel, akka_spring, akka_jta, akka_persistence.akka_persistence_common,
akka_persistence.akka_persistence_redis, akka_persistence.akka_persistence_mongo,
akka_persistence.akka_persistence_cassandra)
}
2010-06-07 16:28:19 +02:00
class AkkaOSGiDependenciesBundleProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin {
override def bndClasspath = compileClasspath
2010-06-17 14:19:33 +02:00
override def bndPrivatePackage = Seq("")
override def bndImportPackage = Seq("*;resolution:=optional")
override def bndExportPackage = Seq(
"org.aopalliance.*;version=1.0.0",
// Provided by other bundles
2010-07-29 17:29:51 +02:00
"!se.scalablesolutions.akka.*",
2010-06-17 14:19:33 +02:00
"!net.liftweb.*",
"!com.google.inject.*",
"!javax.transaction.*",
"!javax.ws.rs.*",
2010-06-17 14:19:33 +02:00
"!javax.jms.*",
"!javax.transaction,*",
"!org.apache.commons.io.*",
"!org.apache.commons.pool.*",
"!org.codehaus.jackson.*",
"!org.jboss.netty.*",
"!org.springframework.*",
"!org.apache.camel.*",
"!org.fusesource.commons.management.*",
"*;version=0.0.0")
2010-06-07 16:28:19 +02:00
}
class AkkaOSGiAssemblyProject(info: ProjectInfo) extends DefaultProject(info) {
// Scala bundle
val scala_bundle = "com.weiglewilczek.scala-lang-osgi" % "scala-library" % buildScalaVersion % "compile" intransitive
2010-06-17 14:19:33 +02:00
// Lift bundles
// val lift_util = Dependencies.lift_util.intransitive
// val lift_actor = "net.liftweb" % "lift-actor" % LIFT_VERSION % "compile" intransitive
// val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile" intransitive
// val lift_json = "net.liftweb" % "lift-json" % LIFT_VERSION % "compile" intransitive
2010-06-17 14:19:33 +02:00
// Camel bundles
val camel_core = Dependencies.camel_core.intransitive
val fusesource_commonman = "org.fusesource.commonman" % "commons-management" % "1.0" intransitive
// Spring bundles
val spring_beans = Dependencies.spring_beans.intransitive
val spring_context = Dependencies.spring_context.intransitive
val spring_aop = "org.springframework" % "spring-aop" % SPRING_VERSION % "compile" intransitive
val spring_asm = "org.springframework" % "spring-asm" % SPRING_VERSION % "compile" intransitive
val spring_core = "org.springframework" % "spring-core" % SPRING_VERSION % "compile" intransitive
val spring_expression = "org.springframework" % "spring-expression" % SPRING_VERSION % "compile" intransitive
val spring_jms = "org.springframework" % "spring-jms" % SPRING_VERSION % "compile" intransitive
val spring_tx = "org.springframework" % "spring-tx" % SPRING_VERSION % "compile" intransitive
val commons_codec = Dependencies.commons_codec.intransitive
val commons_io = Dependencies.commons_io.intransitive
val commons_pool = Dependencies.commons_pool.intransitive
val guicey = Dependencies.guicey.intransitive
val jackson = Dependencies.jackson.intransitive
val jackson_core = Dependencies.jackson_core.intransitive
val jsr311 = Dependencies.jsr311.intransitive
val jta_1_1 = Dependencies.jta_1_1.intransitive
val netty = Dependencies.netty.intransitive
val commons_fileupload = "commons-fileupload" % "commons-fileupload" % "1.2.1" % "compile" intransitive
val jms_1_1 = "org.apache.geronimo.specs" % "geronimo-jms_1.1_spec" % "1.1.1" % "compile" intransitive
val joda = "joda-time" % "joda-time" % "1.6" intransitive
2010-07-29 17:29:51 +02:00
override def packageAction =
task {
val libs: Seq[Path] = managedClasspath(config("compile")).get.toSeq
val prjs: Seq[Path] = info.dependencies.toSeq.asInstanceOf[Seq[DefaultProject]] map { _.jarPath }
val all = libs ++ prjs
val destination = outputPath / "bundles"
FileUtilities.copyFlat(all, destination, log)
log info "Copied %s bundles to %s".format(all.size, destination)
None
}
override def artifacts = Set.empty
}
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// Test
// -------------------------------------------------------------------------------------------------------------------
class AkkaTypedActorTestProject(info: ProjectInfo) extends DefaultProject(info) {
2010-03-05 09:17:15 +01:00
// testing
2010-03-02 23:44:16 -05:00
val junit = "junit" % "junit" % "4.5" % "test"
val jmock = "org.jmock" % "jmock" % "2.4.0" % "test"
}
2010-06-01 18:41:39 +02:00
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// Examples
// -------------------------------------------------------------------------------------------------------------------
2010-08-18 15:15:22 +02:00
class AkkaSampleAntsProject(info: ProjectInfo) extends DefaultSpdeProject(info) {
//val scalaToolsSnapshots = ScalaToolsSnapshots
2010-05-25 13:07:49 +02:00
override def spdeSourcePath = mainSourcePath / "spde"
}
2010-08-18 15:15:22 +02:00
class AkkaSampleChatProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
class AkkaSamplePubSubProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
class AkkaSampleFSMProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
2010-08-18 15:15:22 +02:00
class AkkaSampleLiftProject(info: ProjectInfo) extends DefaultWebProject(info) with DeployProject {
2010-08-16 12:48:15 +02:00
//val commons_logging = Dependencies.commons_logging
val lift_util = Dependencies.lift_util
val lift_webkit = Dependencies.lift_webkit
val servlet = Dependencies.servlet
2010-03-05 09:17:15 +01:00
// testing
val jettyServer = Dependencies.jettyServer
val junit = Dependencies.junit
def deployPath = AkkaParentProject.this.deployPath
2010-08-09 09:35:41 +02:00
override def jarPath = warPath
2010-03-02 23:44:16 -05:00
}
2010-08-18 15:15:22 +02:00
class AkkaSampleRestJavaProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
2010-08-18 15:15:22 +02:00
class AkkaSampleRemoteProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
2010-05-04 10:40:58 +02:00
2010-08-18 15:15:22 +02:00
class AkkaSampleRestScalaProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) {
val jsr311 = Dependencies.jsr311
2010-03-02 23:44:16 -05:00
}
2010-08-18 15:15:22 +02:00
class AkkaSampleCamelProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) {
2010-08-06 16:03:36 +02:00
//Must be like this to be able to exclude the geronimo-servlet_2.4_spec which is a too old Servlet spec
2010-07-16 00:36:47 +02:00
override def ivyXML =
<dependencies>
<dependency org="org.springframework" name="spring-jms" rev={SPRING_VERSION}>
2010-07-16 00:36:47 +02:00
</dependency>
<dependency org="org.apache.geronimo.specs" name="geronimo-servlet_2.5_spec" rev="1.1.1">
</dependency>
<dependency org="org.apache.camel" name="camel-jetty" rev="2.4.0.1">
2010-07-16 00:36:47 +02:00
<exclude module="geronimo-servlet_2.4_spec"/>
</dependency>
<dependency org="org.apache.camel" name="camel-jms" rev={CAMEL_VERSION}>
2010-07-16 00:36:47 +02:00
</dependency>
<dependency org="org.apache.activemq" name="activemq-core" rev="5.3.2">
</dependency>
</dependencies>
2010-03-16 06:45:04 +01:00
}
2010-08-18 15:15:22 +02:00
class AkkaSampleSecurityProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) {
val commons_codec = Dependencies.commons_codec
val jsr250 = Dependencies.jsr250
val jsr311 = Dependencies.jsr311
2010-03-02 23:44:16 -05:00
}
2010-06-17 15:10:39 +02:00
class AkkaSampleOSGiProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin {
2010-07-21 11:17:43 +02:00
val osgi_core = Dependencies.osgi_core
override lazy val bndBundleActivator = Some("se.scalablesolutions.akka.sample.osgi.Activator")
override lazy val bndExportPackage = Nil // Necessary because of mixing-in AkkaDefaultProject which exports all ...akka.* packages!
2010-06-17 15:10:39 +02:00
}
class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) {
2010-05-25 13:07:49 +02:00
lazy val akka_sample_ants = project("akka-sample-ants", "akka-sample-ants",
new AkkaSampleAntsProject(_), akka_core)
lazy val akka_sample_chat = project("akka-sample-chat", "akka-sample-chat",
2010-03-20 10:54:52 +01:00
new AkkaSampleChatProject(_), akka_kernel)
lazy val akka_sample_pubsub = project("akka-sample-pubsub", "akka-sample-pubsub",
new AkkaSamplePubSubProject(_), akka_kernel)
2010-08-18 09:46:45 +02:00
lazy val akka_sample_fsm = project("akka-sample-fsm", "akka-sample-fsm",
new AkkaSampleFSMProject(_), akka_kernel)
lazy val akka_sample_lift = project("akka-sample-lift", "akka-sample-lift",
2010-03-20 10:54:52 +01:00
new AkkaSampleLiftProject(_), akka_kernel)
lazy val akka_sample_rest_java = project("akka-sample-rest-java", "akka-sample-rest-java",
2010-03-20 10:54:52 +01:00
new AkkaSampleRestJavaProject(_), akka_kernel)
lazy val akka_sample_rest_scala = project("akka-sample-rest-scala", "akka-sample-rest-scala",
2010-03-20 10:54:52 +01:00
new AkkaSampleRestScalaProject(_), akka_kernel)
lazy val akka_sample_camel = project("akka-sample-camel", "akka-sample-camel",
2010-03-20 10:54:52 +01:00
new AkkaSampleCamelProject(_), akka_kernel)
lazy val akka_sample_security = project("akka-sample-security", "akka-sample-security",
new AkkaSampleSecurityProject(_), akka_kernel)
2010-05-04 10:40:58 +02:00
lazy val akka_sample_remote = project("akka-sample-remote", "akka-sample-remote",
new AkkaSampleRemoteProject(_), akka_kernel)
2010-06-17 15:10:39 +02:00
lazy val akka_sample_osgi = project("akka-sample-osgi", "akka-sample-osgi",
new AkkaSampleOSGiProject(_), akka_core)
}
2010-04-01 10:06:43 +02:00
2010-07-31 12:37:08 +02:00
// -------------------------------------------------------------------------------------------------------------------
// Helpers
// -------------------------------------------------------------------------------------------------------------------
2010-04-01 10:06:43 +02:00
def removeDupEntries(paths: PathFinder) =
Path.lazyPathFinder {
val mapped = paths.get map { p => (p.relativePath, p) }
2010-06-09 15:20:22 +02:00
(Map() ++ mapped).values.toList
}
2010-04-01 10:06:43 +02:00
def allArtifacts = {
Path.fromFile(buildScalaInstance.libraryJar) +++
(removeDupEntries(runClasspath filter ClasspathUtilities.isArchive) +++
((outputPath ##) / defaultJarName) +++
mainResources +++
mainDependencies.scalaJars +++
2010-05-08 00:26:05 +02:00
descendents(info.projectPath / "scripts", "run_akka.sh") +++
descendents(info.projectPath / "scripts", "akka-init-script.sh") +++
2010-04-01 10:06:43 +02:00
descendents(info.projectPath / "dist", "*.jar") +++
descendents(info.projectPath / "deploy", "*.jar") +++
descendents(path("lib") ##, "*.jar") +++
descendents(configurationPath(Configurations.Compile) ##, "*.jar"))
.filter(jar => // remove redundant libs
!jar.toString.endsWith("stax-api-1.0.1.jar") ||
2010-04-01 10:06:43 +02:00
!jar.toString.endsWith("scala-library-2.7.7.jar")
)
2010-04-01 10:06:43 +02:00
}
2010-07-29 17:29:51 +02:00
def akkaArtifacts = descendents(info.projectPath / "dist", "*" + buildScalaVersion + "-" + version + ".jar")
2010-04-01 10:06:43 +02:00
2010-05-25 11:17:18 +02:00
// ------------------------------------------------------------
class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject with OSGiProject
2010-08-09 09:35:41 +02:00
}
2010-04-01 10:06:43 +02:00
2010-08-09 10:09:26 +02:00
trait DeployProject { self: BasicScalaProject =>
// defines where the deployTask copies jars to
def deployPath: Path
lazy val dist = deployTask(jarPath, packageDocsJar, packageSrcJar, deployPath, true, true, true) dependsOn(
`package`, packageDocs, packageSrc) describedAs("Deploying")
def deployTask(jar: Path, docs: Path, src: Path, toDir: Path,
genJar: Boolean, genDocs: Boolean, genSource: Boolean) = task {
def gen(jar: Path, toDir: Path, flag: Boolean, msg: String): Option[String] =
if (flag) {
log.info(msg + " " + jar)
FileUtilities.copyFile(jar, toDir / jar.name, log)
} else None
gen(jar, toDir, genJar, "Deploying bits") orElse
gen(docs, toDir, genDocs, "Deploying docs") orElse
gen(src, toDir, genSource, "Deploying sources")
2010-04-01 10:06:43 +02:00
}
2010-08-09 10:09:26 +02:00
}
2010-08-09 10:09:26 +02:00
trait OSGiProject extends BNDPlugin { self: DefaultProject =>
override def bndExportPackage = Seq("se.scalablesolutions.akka.*;version=%s".format(projectVersion.value))
2010-03-02 00:34:14 -05:00
}