pekko/project/build/AkkaProject.scala

407 lines
21 KiB
Scala
Raw Normal View History

/*---------------------------------------------------------------------------\
| Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se> |
\---------------------------------------------------------------------------*/
2010-03-07 08:14:48 +01:00
2010-03-02 00:34:14 -05:00
import sbt._
import sbt.CompileOrder._
import spde._
2010-05-25 12:17:54 +02:00
import java.util.jar.Attributes
import java.util.jar.Attributes.Name._
import java.io.File
2010-04-01 10:06:43 +02:00
class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
2010-03-02 00:34:14 -05:00
// ------------------------------------------------------------
2010-04-01 23:02:13 +02:00
// project versions
val JERSEY_VERSION = "1.1.5"
val ATMO_VERSION = "0.5.4"
2010-05-25 12:24:15 +02:00
val CASSANDRA_VERSION = "0.6.1"
2010-04-01 23:02:13 +02:00
val LIFT_VERSION = "2.0-scala280-SNAPSHOT"
val SCALATEST_VERSION = "1.2-for-scala-2.8.0.RC2-SNAPSHOT"
2010-05-27 09:12:17 +12:00
val MULTIVERSE_VERSION = "0.5.2"
// ------------------------------------------------------------
lazy val deployPath = info.projectPath / "deploy"
lazy val distPath = info.projectPath / "dist"
override def compileOptions = super.compileOptions ++
2010-05-25 12:24:15 +02:00
Seq("-deprecation",
"-Xmigration",
"-Xcheckinit",
"-Xstrict-warnings",
"-Xwarninit",
"-encoding", "utf8")
.map(x => CompileOption(x))
override def javaCompileOptions = JavaCompileOption("-Xlint:unchecked") :: super.javaCompileOptions.toList
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-04-01 23:02:13 +02:00
// repositories
val embeddedrepo = "embedded repo" at (info.projectPath / "embedded-repo").asURL.toString
2010-04-01 23:02:13 +02:00
val sunjdmk = "sunjdmk" at "http://wp5.e-taxonomy.eu/cdmlib/mavenrepo"
val databinder = "DataBinder" at "http://databinder.net/repo"
// val configgy = "Configgy" at "http://www.lag.net/repo"
val codehaus = "Codehaus" at "http://repository.codehaus.org"
val codehaus_snapshots = "Codehaus Snapshots" at "http://snapshots.repository.codehaus.org"
2010-05-10 22:18:12 +02:00
val jboss = "jBoss" at "https://repository.jboss.org/nexus/content/groups/public/"
2010-04-01 23:02:13 +02:00
val guiceyfruit = "GuiceyFruit" at "http://guiceyfruit.googlecode.com/svn/repo/releases/"
val google = "Google" at "http://google-maven-repository.googlecode.com/svn/repository"
val java_net = "java.net" at "http://download.java.net/maven/2"
2010-04-01 23:02:13 +02:00
val scala_tools_snapshots = "scala-tools snapshots" at "http://scala-tools.org/repo-snapshots"
val scala_tools_releases = "scala-tools releases" at "http://scala-tools.org/repo-releases"
2010-04-01 23:02:13 +02:00
// ------------------------------------------------------------
// project defintions
lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_))
2010-04-01 23:02:13 +02:00
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)
2010-04-01 23:02:13 +02:00
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)
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)
2010-03-02 00:34:14 -05:00
2010-04-01 23:02:13 +02:00
// functional tests in java
lazy val akka_fun_test = project("akka-fun-test-java", "akka-fun-test-java", new AkkaFunTestProject(_), akka_kernel)
2010-04-01 23:02:13 +02:00
// examples
lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_))
// ------------------------------------------------------------
// Run Akka microkernel using 'sbt run' + use for packaging executable JAR
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("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-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)
val sourceArtifact = Artifact(artifactID, "source", "jar", Some("source"), 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")
override def packageSrcJar= defaultJarPath("-source.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-05-25 11:17:18 +02:00
// publish to local mvn
import Process._
lazy val publishLocalMvn = runMvnInstall
def runMvnInstall = task {
for(absPath <- akkaArtifacts.getPaths) {
2010-05-27 09:01:56 +02:00
val artifactRE = """(.*)/dist/(.*)-(.*).jar""".r
2010-05-25 11:17:18 +02:00
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.")
2010-03-02 00:34:14 -05:00
// ------------------------------------------------------------
2010-03-02 00:34:14 -05:00
// subprojects
class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
2010-05-10 22:18:12 +02:00
val netty = "org.jboss.netty" % "netty" % "3.2.0.CR1" % "compile"
2010-03-05 09:17:15 +01:00
val commons_io = "commons-io" % "commons-io" % "1.4" % "compile"
2010-05-28 17:24:41 +02:00
val dispatch_json = "net.databinder" % "dispatch-json_2.8.0.RC3" % "0.7.4" % "compile"
val dispatch_htdisttp = "net.databinder" % "dispatch-http_2.8.0.RC3" % "0.7.4" % "compile"
val sjson = "sjson.json" % "sjson" % "0.6-SNAPSHOT-2.8.RC3" % "compile"
2010-05-28 17:24:41 +02:00
val sbinary = "sbinary" % "sbinary" % "2.8.0.RC3-0.3.1-SNAPSHOT" % "compile"
2010-03-05 09:17:15 +01:00
val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % "1.2.1" % "compile"
val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile"
2010-04-17 19:28:14 +02:00
val h2_lzf = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile"
val jsr166x = "jsr166x" % "jsr166x" % "1.0" % "compile"
2010-04-17 19:28:14 +02:00
val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile"
2010-03-05 09:17:15 +01:00
val werkz = "org.codehaus.aspectwerkz" % "aspectwerkz-nodeps-jdk5" % "2.1" % "compile"
val werkz_core = "org.codehaus.aspectwerkz" % "aspectwerkz-jdk5" % "2.1" % "compile"
val configgy = "net.lag" % "configgy" % "2.8.0.RC2-1.5.2-SNAPSHOT" % "compile"
2010-05-12 12:27:16 +02:00
val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile"
val aopalliance = "aopalliance" % "aopalliance" % "1.0" % "compile"
2010-03-05 09:17:15 +01:00
val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile"
2010-05-27 09:12:17 +12:00
val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile"
2010-05-24 12:30:37 +02:00
val jgroups = "jgroups" % "jgroups" % "2.9.0.GA" % "compile"
// testing
val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test"
val junit = "junit" % "junit" % "4.5" % "test"
2010-03-02 00:34:14 -05:00
}
class AkkaAMQPProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val commons_io = "commons-io" % "commons-io" % "1.4" % "compile"
val rabbit = "com.rabbitmq" % "amqp-client" % "1.7.2" % "compile"
2010-03-02 00:34:14 -05:00
}
class AkkaHttpProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val jackson_core_asl = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile"
val stax_api = "javax.xml.stream" % "stax-api" % "1.0-2" % "compile"
val servlet = "javax.servlet" % "servlet-api" % "2.5" % "compile"
2010-03-05 09:17:15 +01:00
val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile"
val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile"
val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile"
val jersey_contrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEY_VERSION % "compile"
val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile"
2010-03-02 00:34:14 -05:00
val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile"
2010-03-05 09:17:15 +01:00
val atmo = "org.atmosphere" % "atmosphere-annotations" % ATMO_VERSION % "compile"
val atmo_jersey = "org.atmosphere" % "atmosphere-jersey" % ATMO_VERSION % "compile"
val atmo_runtime = "org.atmosphere" % "atmosphere-runtime" % ATMO_VERSION % "compile"
val commons_logging = "commons-logging" % "commons-logging" % "1.1.1" % "compile"
val annotation = "javax.annotation" % "jsr250-api" % "1.0" % "compile"
val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile"
val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile"
2010-03-05 09:17:15 +01:00
// testing
val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test"
2010-03-02 00:34:14 -05:00
val junit = "junit" % "junit" % "4.5" % "test"
val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test"
}
class AkkaCamelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
2010-03-16 06:45:04 +01:00
val camel_core = "org.apache.camel" % "camel-core" % "2.2.0" % "compile"
}
2010-03-02 00:34:14 -05:00
class AkkaPersistenceCommonProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
2010-05-25 12:24:15 +02:00
val thrift = "com.facebook" % "thrift" % "r917130" % "compile"
2010-03-29 10:15:10 +02:00
val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile"
2010-03-02 00:34:14 -05:00
}
class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val redis = "com.redis" % "redisclient" % "2.8.0.RC3-1.4-SNAPSHOT" % "compile"
override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
2010-03-02 00:34:14 -05:00
}
class AkkaMongoProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val mongo = "org.mongodb" % "mongo-java-driver" % "1.4" % "compile"
override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
2010-03-02 00:34:14 -05:00
}
class AkkaCassandraProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
2010-03-05 09:17:15 +01:00
val cassandra = "org.apache.cassandra" % "cassandra" % CASSANDRA_VERSION % "compile"
2010-05-11 19:00:26 +02:00
val slf4j = "org.slf4j" % "slf4j-api" % "1.6.0" % "compile"
val slf4j_log4j = "org.slf4j" % "slf4j-log4j12" % "1.6.0" % "compile"
val log4j = "log4j" % "log4j" % "1.2.15" % "compile"
// testing
2010-03-05 09:17:15 +01:00
val high_scale = "org.apache.cassandra" % "high-scale-lib" % CASSANDRA_VERSION % "test"
val cassandra_clhm = "org.apache.cassandra" % "clhm-production" % CASSANDRA_VERSION % "test"
val commons_coll = "commons-collections" % "commons-collections" % "3.2.1" % "test"
val google_coll = "com.google.collections" % "google-collections" % "1.0" % "test"
override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil
2010-03-02 00:34:14 -05:00
}
class AkkaPersistenceParentProject(info: ProjectInfo) extends ParentProject(info) {
lazy val akka_persistence_common = project("akka-persistence-common", "akka-persistence-common",
2010-03-20 10:54:52 +01:00
new AkkaPersistenceCommonProject(_), akka_core)
lazy val akka_persistence_redis = project("akka-persistence-redis", "akka-persistence-redis",
2010-03-20 10:54:52 +01:00
new AkkaRedisProject(_), akka_persistence_common)
lazy val akka_persistence_mongo = project("akka-persistence-mongo", "akka-persistence-mongo",
2010-03-20 10:54:52 +01:00
new AkkaMongoProject(_), akka_persistence_common)
lazy val akka_persistence_cassandra = project("akka-persistence-cassandra", "akka-persistence-cassandra",
2010-03-20 10:54:52 +01:00
new AkkaCassandraProject(_), akka_persistence_common)
2010-03-02 00:34:14 -05:00
}
class AkkaKernelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath)
class AkkaSpringProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val spring_beans = "org.springframework" % "spring-beans" % "3.0.1.RELEASE" % "compile"
val spring_context = "org.springframework" % "spring-context" % "3.0.1.RELEASE" % "compile"
// testing
val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test"
val junit = "junit" % "junit" % "4.5" % "test"
}
class AkkaJTAProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val atomikos_transactions = "com.atomikos" % "transactions" % "3.2.3" % "compile"
val atomikos_transactions_jta = "com.atomikos" % "transactions-jta" % "3.2.3" % "compile"
val atomikos_transactions_api = "com.atomikos" % "transactions-api" % "3.2.3" % "compile"
//val atomikos_transactions_util = "com.atomikos" % "transactions-util" % "3.2.3" % "compile"
val jta_spec = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile"
}
2010-05-25 13:07:49 +02:00
// ================= TEST ==================
2010-04-01 10:06:43 +02:00
class AkkaFunTestProject(info: ProjectInfo) extends DefaultProject(info) {
val jackson_core_asl = "org.codehaus.jackson" % "jackson-core-asl" % "1.2.1" % "compile"
val stax_api = "javax.xml.stream" % "stax-api" % "1.0-2" % "compile"
val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile"
2010-03-02 23:44:16 -05:00
val grizzly = "com.sun.grizzly" % "grizzly-comet-webserver" % "1.9.18-i" % "compile"
2010-03-05 09:17:15 +01:00
val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile"
val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile"
val jersey_atom = "com.sun.jersey" % "jersey-atom" % JERSEY_VERSION % "compile"
// 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-05-25 13:07:49 +02:00
// ================= EXAMPLES ==================
class AkkaSampleAntsProject(info: ProjectInfo) extends DefaultSpdeProject(info) {
val scalaToolsSnapshots = ScalaToolsSnapshots
override def spdeSourcePath = mainSourcePath / "spde"
}
class AkkaSampleChatProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
class AkkaSamplePubSubProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
class AkkaSampleLiftProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) {
val commons_logging = "commons-logging" % "commons-logging" % "1.1.1" % "compile"
val lift = "net.liftweb" % "lift-webkit" % LIFT_VERSION % "compile"
val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile"
val servlet = "javax.servlet" % "servlet-api" % "2.5" % "compile"
2010-03-05 09:17:15 +01:00
// testing
2010-03-19 08:14:00 +01:00
val jetty = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test"
2010-03-02 23:44:16 -05:00
val junit = "junit" % "junit" % "4.5" % "test"
}
class AkkaSampleRestJavaProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
2010-05-04 10:40:58 +02:00
class AkkaSampleRemoteProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
class AkkaSampleRestScalaProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) {
val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1.1" % "compile"
2010-03-02 23:44:16 -05:00
}
class AkkaSampleCamelProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) {
val commons_codec = "commons-codec" % "commons-codec" % "1.3" % "compile"
val spring_jms = "org.springframework" % "spring-jms" % "3.0.1.RELEASE" % "compile"
2010-03-19 08:14:00 +01:00
val camel_jetty = "org.apache.camel" % "camel-jetty" % "2.2.0" % "compile"
2010-03-16 06:45:04 +01:00
val camel_jms = "org.apache.camel" % "camel-jms" % "2.2.0" % "compile"
val activemq_core = "org.apache.activemq" % "activemq-core" % "5.3.0" % "compile"
}
class AkkaSampleSecurityProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath) {
val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1.1" % "compile"
val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" % "compile"
2010-03-30 21:20:01 +02:00
val commons_codec = "commons-codec" % "commons-codec" % "1.3" % "compile"
2010-03-02 23:44:16 -05: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)
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-04-01 10:06:43 +02:00
// ------------------------------------------------------------
// helper functions
def removeDupEntries(paths: PathFinder) =
Path.lazyPathFinder {
val mapped = paths.get map { p => (p.relativePath, p) }
(Map() ++ mapped).values.toList
}
def allArtifacts = {
Path.fromFile(buildScalaInstance.libraryJar) +++
(removeDupEntries(runClasspath filter ClasspathUtilities.isArchive) +++
((outputPath ##) / defaultJarName) +++
mainResources +++
mainDependencies.scalaJars +++
descendents(info.projectPath, "*.conf") +++
2010-05-08 00:26:05 +02:00
descendents(info.projectPath / "scripts", "run_akka.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-05-25 11:17:18 +02:00
def akkaArtifacts = {
descendents(info.projectPath / "dist", "*" + buildScalaVersion + "-" + version + ".jar")
}
// ------------------------------------------------------------
2010-04-01 10:06:43 +02:00
class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject
2010-04-01 10:06:43 +02:00
trait DeployProject extends DefaultProject {
// defines where the deployTask copies jars to
def deployPath: Path
lazy val dist = distAction
def distAction = 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 {
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
}
private 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
2010-04-01 10:06:43 +02:00
}
2010-03-02 00:34:14 -05:00
}