2010-11-05 16:11:34 +13:00
|
|
|
/**
|
2010-12-22 15:35:50 +01:00
|
|
|
* Copyright (C) 2009-2011 Scalable Solutions AB <http://scalablesolutions.se>
|
2010-11-05 16:11:34 +13:00
|
|
|
*/
|
2010-03-07 08:14:48 +01:00
|
|
|
|
2010-07-20 11:26:34 +02:00
|
|
|
import com.weiglewilczek.bnd4sbt.BNDPlugin
|
|
|
|
|
import java.io.File
|
2010-03-09 22:07:14 +01:00
|
|
|
import java.util.jar.Attributes
|
2010-03-30 18:56:34 +02:00
|
|
|
import java.util.jar.Attributes.Name._
|
2010-07-20 11:26:34 +02:00
|
|
|
import sbt._
|
|
|
|
|
import sbt.CompileOrder._
|
|
|
|
|
import spde._
|
2010-06-07 15:59:47 +02:00
|
|
|
|
2010-07-20 08:39:18 +02:00
|
|
|
class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
|
2010-03-30 18:56:34 +02:00
|
|
|
|
2010-07-20 08:39:18 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Compile settings
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2011-02-01 17:46:45 +13:00
|
|
|
val scalaCompileSettings =
|
2010-06-01 18:41:39 +02:00
|
|
|
Seq("-deprecation",
|
|
|
|
|
"-Xmigration",
|
2011-02-02 08:53:29 +13:00
|
|
|
//"-Xcheckinit",
|
|
|
|
|
//"-optimise",
|
2010-06-01 18:41:39 +02:00
|
|
|
"-Xwarninit",
|
2010-05-25 12:24:15 +02:00
|
|
|
"-encoding", "utf8")
|
2011-02-01 17:46:45 +13:00
|
|
|
|
|
|
|
|
val javaCompileSettings = Seq("-Xlint:unchecked")
|
|
|
|
|
|
|
|
|
|
override def compileOptions = super.compileOptions ++ scalaCompileSettings.map(CompileOption)
|
|
|
|
|
override def javaCompileOptions = super.javaCompileOptions ++ javaCompileSettings.map(JavaCompileOption)
|
2010-03-10 17:16:10 +01:00
|
|
|
|
2010-07-20 08:39:18 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Deploy/dist settings
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2011-01-21 16:29:26 +13:00
|
|
|
val distName = "%s-%s".format(name, version)
|
|
|
|
|
val distArchiveName = distName + ".zip"
|
|
|
|
|
val deployPath = info.projectPath / "deploy"
|
|
|
|
|
val distPath = info.projectPath / "dist"
|
|
|
|
|
val distArchive = (distPath ##) / distArchiveName
|
2010-10-14 18:03:57 +02:00
|
|
|
|
2010-11-26 17:49:25 +01:00
|
|
|
lazy override val `package` = task { None }
|
|
|
|
|
|
2010-10-14 18:03:57 +02:00
|
|
|
//The distribution task, packages Akka into a zipfile and places it into the projectPath/dist directory
|
|
|
|
|
lazy val dist = task {
|
|
|
|
|
|
|
|
|
|
def transferFile(from: Path, to: Path) =
|
|
|
|
|
if ( from.asFile.renameTo(to.asFile) ) None
|
|
|
|
|
else Some("Couldn't transfer %s to %s".format(from,to))
|
|
|
|
|
|
|
|
|
|
//Creates a temporary directory where we can assemble the distribution
|
|
|
|
|
val genDistDir = Path.fromFile({
|
|
|
|
|
val d = File.createTempFile("akka","dist")
|
|
|
|
|
d.delete //delete the file
|
|
|
|
|
d.mkdir //Recreate it as a dir
|
|
|
|
|
d
|
|
|
|
|
}).## //## is needed to make sure that the zipped archive has the correct root folder
|
|
|
|
|
|
|
|
|
|
//Temporary directory to hold the dist currently being generated
|
|
|
|
|
val currentDist = genDistDir / distName
|
|
|
|
|
|
|
|
|
|
FileUtilities.copy(allArtifacts.get, currentDist, log).left.toOption orElse //Copy all needed artifacts into the root archive
|
2011-01-21 16:29:26 +13:00
|
|
|
FileUtilities.zip(List(currentDist), distArchiveName, true, log) orElse //Compress the root archive into a zipfile
|
|
|
|
|
transferFile(info.projectPath / distArchiveName, distArchive) orElse //Move the archive into the dist folder
|
2010-10-14 18:03:57 +02:00
|
|
|
FileUtilities.clean(genDistDir,log) //Cleanup the generated jars
|
|
|
|
|
|
|
|
|
|
} dependsOn (`package`) describedAs("Zips up the distribution.")
|
2010-04-01 10:06:43 +02:00
|
|
|
|
2010-05-28 20:24:00 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-31 12:37:08 +02:00
|
|
|
// All repositories *must* go here! See ModuleConigurations below.
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
object Repositories {
|
2010-11-23 15:59:37 +01:00
|
|
|
lazy val EmbeddedRepo = MavenRepository("Embedded Repo", (info.projectPath / "embedded-repo").asURL.toString)
|
2010-11-25 15:08:04 +01:00
|
|
|
lazy val LocalMavenRepo = MavenRepository("Local Maven Repo", (Path.userHome / ".m2" / "repository").asURL.toString)
|
2010-08-09 10:42:00 +02:00
|
|
|
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-08-09 10:42:00 +02:00
|
|
|
lazy val GuiceyFruitRepo = MavenRepository("GuiceyFruit Repo", "http://guiceyfruit.googlecode.com/svn/repo/releases/")
|
2010-10-26 14:23:55 +02:00
|
|
|
lazy val JBossRepo = MavenRepository("JBoss Repo", "http://repository.jboss.org/nexus/content/groups/public/")
|
2010-08-09 10:42:00 +02:00
|
|
|
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")
|
2010-11-23 15:59:37 +01:00
|
|
|
lazy val GlassfishRepo = MavenRepository("Glassfish Repo", "http://download.java.net/maven/glassfish")
|
2010-10-06 22:11:02 +02:00
|
|
|
lazy val ScalaToolsRelRepo = MavenRepository("Scala Tools Releases Repo", "http://scala-tools.org/repo-releases")
|
2010-11-25 15:08:04 +01:00
|
|
|
lazy val DatabinderRepo = MavenRepository("Databinder Repo", "http://databinder.net/repo")
|
2010-07-31 12:37:08 +02:00
|
|
|
}
|
2010-07-20 08:39:18 +02:00
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// ModuleConfigurations
|
2010-05-28 20:24:00 +02:00
|
|
|
// 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.
|
2010-05-29 07:28:42 +02:00
|
|
|
// Therefore, if repositories are defined, this must happen as def, not as val.
|
2010-05-28 20:24:00 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-07-31 12:37:08 +02:00
|
|
|
import Repositories._
|
2010-11-23 15:59:37 +01:00
|
|
|
lazy val embeddedRepo = EmbeddedRepo // This is the only exception, because the embedded repo is fast!
|
2010-11-25 15:08:04 +01:00
|
|
|
lazy val localMavenRepo = LocalMavenRepo // Second exception, also fast! ;-)
|
2010-08-31 16:43:47 +02:00
|
|
|
lazy val jettyModuleConfig = ModuleConfiguration("org.eclipse.jetty", sbt.DefaultMavenRepository)
|
2010-08-09 10:42:00 +02:00
|
|
|
lazy val guiceyFruitModuleConfig = ModuleConfiguration("org.guiceyfruit", GuiceyFruitRepo)
|
2010-11-23 15:59:37 +01:00
|
|
|
lazy val glassfishModuleConfig = ModuleConfiguration("org.glassfish", GlassfishRepo)
|
2010-08-09 10:42:00 +02:00
|
|
|
lazy val jbossModuleConfig = ModuleConfiguration("org.jboss", JBossRepo)
|
|
|
|
|
lazy val jerseyContrModuleConfig = ModuleConfiguration("com.sun.jersey.contribs", JavaNetRepo)
|
|
|
|
|
lazy val jerseyModuleConfig = ModuleConfiguration("com.sun.jersey", JavaNetRepo)
|
2010-08-21 21:17:54 +12:00
|
|
|
lazy val multiverseModuleConfig = ModuleConfiguration("org.multiverse", CodehausRepo)
|
2010-08-09 10:42:00 +02:00
|
|
|
lazy val nettyModuleConfig = ModuleConfiguration("org.jboss.netty", JBossRepo)
|
2010-10-06 22:11:02 +02:00
|
|
|
lazy val scalaTestModuleConfig = ModuleConfiguration("org.scalatest", ScalaToolsRelRepo)
|
2010-11-23 15:59:37 +01:00
|
|
|
lazy val logbackModuleConfig = ModuleConfiguration("ch.qos.logback", sbt.DefaultMavenRepository)
|
2010-11-25 15:08:04 +01:00
|
|
|
lazy val spdeModuleConfig = ModuleConfiguration("us.technically.spde", DatabinderRepo)
|
|
|
|
|
lazy val processingModuleConfig = ModuleConfiguration("org.processing", DatabinderRepo)
|
2010-03-05 14:33:14 +01:00
|
|
|
|
2010-07-20 08:39:18 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Versions
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-08-21 18:05:06 +02:00
|
|
|
lazy val DISPATCH_VERSION = "0.7.4"
|
2011-01-22 01:43:29 +08:00
|
|
|
lazy val HAWT_DISPATCH_VERSION = "1.1"
|
2010-10-28 14:27:48 +02:00
|
|
|
lazy val JACKSON_VERSION = "1.4.3"
|
2010-09-22 22:14:07 +02:00
|
|
|
lazy val JERSEY_VERSION = "1.3"
|
2010-08-31 23:25:35 +02:00
|
|
|
lazy val MULTIVERSE_VERSION = "0.6.1"
|
2011-02-11 10:08:05 -07:00
|
|
|
lazy val SCALATEST_VERSION = "1.3"
|
2010-08-21 18:05:06 +02:00
|
|
|
lazy val LOGBACK_VERSION = "0.9.24"
|
|
|
|
|
lazy val SLF4J_VERSION = "1.6.0"
|
2010-10-14 14:22:08 +02:00
|
|
|
lazy val JETTY_VERSION = "7.1.6.v20100715"
|
2010-11-21 07:21:17 -08:00
|
|
|
lazy val JAVAX_SERVLET_VERSION = "3.0"
|
2010-11-24 21:05:12 +01:00
|
|
|
|
2010-07-20 08:39:18 +02:00
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Dependencies
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-07-20 08:39:18 +02:00
|
|
|
object Dependencies {
|
|
|
|
|
|
|
|
|
|
// Compile
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val aopalliance = "aopalliance" % "aopalliance" % "1.0" % "compile" //Public domain
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-23 10:35:14 +01:00
|
|
|
lazy val aspectwerkz = "org.codehaus.aspectwerkz" % "aspectwerkz" % "2.2.3" % "compile" //LGPL 2.1
|
|
|
|
|
|
|
|
|
|
lazy val commonsHttpClient = "commons-httpclient" % "commons-httpclient" % "3.1" % "compile" //ApacheV2
|
|
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val commons_codec = "commons-codec" % "commons-codec" % "1.4" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val commons_io = "commons-io" % "commons-io" % "1.4" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val commons_pool = "commons-pool" % "commons-pool" % "1.5.4" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-12-19 16:40:51 -07:00
|
|
|
lazy val configgy = "net.lag" % "configgy" % "2.0.2-nologgy" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val dispatch_http = "net.databinder" % "dispatch-http_2.8.0" % DISPATCH_VERSION % "compile" //LGPL v2
|
|
|
|
|
lazy val dispatch_json = "net.databinder" % "dispatch-json_2.8.0" % DISPATCH_VERSION % "compile" //LGPL v2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-23 15:59:37 +01:00
|
|
|
lazy val javax_servlet_30 = "org.glassfish" % "javax.servlet" % JAVAX_SERVLET_VERSION % "provided" //CDDL v1
|
2010-11-24 21:05:12 +01:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val jetty = "org.eclipse.jetty" % "jetty-server" % JETTY_VERSION % "compile" //Eclipse license
|
|
|
|
|
lazy val jetty_util = "org.eclipse.jetty" % "jetty-util" % JETTY_VERSION % "compile" //Eclipse license
|
|
|
|
|
lazy val jetty_xml = "org.eclipse.jetty" % "jetty-xml" % JETTY_VERSION % "compile" //Eclipse license
|
|
|
|
|
lazy val jetty_servlet = "org.eclipse.jetty" % "jetty-servlet" % JETTY_VERSION % "compile" //Eclipse license
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val uuid = "com.eaio" % "uuid" % "3.2" % "compile" //MIT license
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val guicey = "org.guiceyfruit" % "guice-all" % "2.0" % "compile" //ApacheV2
|
2010-08-31 19:12:14 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val h2_lzf = "voldemort.store.compress" % "h2-lzf" % "1.0" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val hawtdispatch = "org.fusesource.hawtdispatch" % "hawtdispatch-scala" % HAWT_DISPATCH_VERSION % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val jackson = "org.codehaus.jackson" % "jackson-mapper-asl" % JACKSON_VERSION % "compile" //ApacheV2
|
|
|
|
|
lazy val jackson_core = "org.codehaus.jackson" % "jackson-core-asl" % JACKSON_VERSION % "compile" //ApacheV2
|
2010-11-24 21:05:12 +01:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val jersey = "com.sun.jersey" % "jersey-core" % JERSEY_VERSION % "compile" //CDDL v1
|
|
|
|
|
lazy val jersey_json = "com.sun.jersey" % "jersey-json" % JERSEY_VERSION % "compile" //CDDL v1
|
|
|
|
|
lazy val jersey_server = "com.sun.jersey" % "jersey-server" % JERSEY_VERSION % "compile" //CDDL v1
|
|
|
|
|
lazy val jersey_contrib = "com.sun.jersey.contribs" % "jersey-scala" % JERSEY_VERSION % "compile" //CDDL v1
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val jsr166x = "jsr166x" % "jsr166x" % "1.0" % "compile" //CC Public Domain
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val jsr250 = "javax.annotation" % "jsr250-api" % "1.0" % "compile" //CDDL v1
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile" //CDDL v1
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile" intransitive //ApacheV2
|
2010-11-05 16:11:34 +13:00
|
|
|
lazy val multiverse_test = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "test" intransitive //ApacheV2
|
2010-09-09 14:31:18 +05:30
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val netty = "org.jboss.netty" % "netty" % "3.2.3.Final" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val protobuf = "com.google.protobuf" % "protobuf-java" % "2.3.0" % "compile" //New BSD
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val sbinary = "sbinary" % "sbinary" % "2.8.0-0.3.1" % "compile" //MIT
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val sjson = "sjson.json" % "sjson" % "0.8-2.8.0" % "compile" //ApacheV2
|
|
|
|
|
lazy val sjson_test = "sjson.json" % "sjson" % "0.8-2.8.0" % "test" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val logback = "ch.qos.logback" % "logback-classic" % LOGBACK_VERSION % "compile" //LGPL 2.1
|
2010-08-11 17:02:44 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val stax_api = "javax.xml.stream" % "stax-api" % "1.0-2" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val thrift = "com.facebook" % "thrift" % "r917130" % "compile" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val google_coll = "com.google.collections" % "google-collections" % "1.0" % "compile" //ApacheV2
|
2010-11-02 20:30:18 +01:00
|
|
|
|
2010-07-20 08:39:18 +02:00
|
|
|
// Test
|
|
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val commons_coll = "commons-collections" % "commons-collections" % "3.2.1" % "test" //ApacheV2
|
2010-10-20 20:49:36 -04:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val testJetty = "org.eclipse.jetty" % "jetty-server" % JETTY_VERSION % "test" //Eclipse license
|
|
|
|
|
lazy val testJettyWebApp= "org.eclipse.jetty" % "jetty-webapp" % JETTY_VERSION % "test" //Eclipse license
|
2010-08-31 16:43:47 +02:00
|
|
|
|
2010-11-08 15:58:09 +01:00
|
|
|
lazy val junit = "junit" % "junit" % "4.5" % "test" //Common Public License 1.0
|
|
|
|
|
lazy val mockito = "org.mockito" % "mockito-all" % "1.8.1" % "test" //MIT
|
|
|
|
|
lazy val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test" //ApacheV2
|
2010-07-20 08:39:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Subprojects
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-12-22 15:35:50 +01:00
|
|
|
lazy val akka_actor = project("akka-actor", "akka-actor", new AkkaActorProject(_))
|
|
|
|
|
lazy val akka_stm = project("akka-stm", "akka-stm", new AkkaStmProject(_), akka_actor)
|
2010-11-13 16:19:57 +13:00
|
|
|
lazy val akka_typed_actor = project("akka-typed-actor", "akka-typed-actor", new AkkaTypedActorProject(_), akka_stm)
|
2010-12-22 15:35:50 +01:00
|
|
|
lazy val akka_remote = project("akka-remote", "akka-remote", new AkkaRemoteProject(_), akka_typed_actor)
|
|
|
|
|
lazy val akka_http = project("akka-http", "akka-http", new AkkaHttpProject(_), akka_remote)
|
|
|
|
|
lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_))
|
2011-01-21 16:29:26 +13:00
|
|
|
lazy val akka_sbt_plugin = project("akka-sbt-plugin", "akka-sbt-plugin", new AkkaSbtPluginProject(_))
|
2010-03-09 22:07:14 +01:00
|
|
|
|
2010-07-20 12:01:02 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Miscellaneous
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-11-22 13:14:10 +13:00
|
|
|
override def disableCrossPaths = true
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-04-06 12:45:09 +02:00
|
|
|
override def packageOptions =
|
2010-03-30 18:56:34 +02:00
|
|
|
manifestClassPath.map(cp => ManifestAttributes(
|
2010-04-06 12:45:09 +02:00
|
|
|
(Attributes.Name.CLASS_PATH, cp),
|
|
|
|
|
(IMPLEMENTATION_TITLE, "Akka"),
|
2010-11-08 15:42:08 +01:00
|
|
|
(IMPLEMENTATION_URL, "http://akka.io"),
|
|
|
|
|
(IMPLEMENTATION_VENDOR, "Scalable Solutions AB")
|
2010-11-23 15:59:37 +01:00
|
|
|
)).toList
|
2010-03-10 17:16:10 +01:00
|
|
|
|
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
|
|
|
|
2010-11-26 17:49:25 +01:00
|
|
|
// override def mainResources = super.mainResources +++ (info.projectPath / "config").descendentsExcept("*", "logback-test.xml")
|
2010-08-12 13:38:13 +02:00
|
|
|
|
2010-11-26 17:49:25 +01:00
|
|
|
// override def runClasspath = super.runClasspath +++ "config"
|
2010-05-28 22:05:44 +02:00
|
|
|
|
2010-03-30 18:56:34 +02:00
|
|
|
// ------------------------------------------------------------
|
2010-04-01 23:02:13 +02:00
|
|
|
// publishing
|
|
|
|
|
override def managedStyle = ManagedStyle.Maven
|
2010-12-22 15:35:50 +01:00
|
|
|
|
2010-04-01 23:02:13 +02:00
|
|
|
//override def defaultPublishRepository = Some(Resolver.file("maven-local", Path.userHome / ".m2" / "repository" asFile))
|
|
|
|
|
val publishTo = Resolver.file("maven-local", Path.userHome / ".m2" / "repository" asFile)
|
2011-02-08 12:36:47 +13:00
|
|
|
|
|
|
|
|
override def artifacts = Set(Artifact(artifactID, "pom", "pom"))
|
|
|
|
|
|
2011-02-08 16:15:39 +13:00
|
|
|
override def deliverProjectDependencies =
|
|
|
|
|
super.deliverProjectDependencies.toList - akka_samples.projectID - akka_sbt_plugin.projectID
|
|
|
|
|
|
2011-02-08 12:36:47 +13:00
|
|
|
// val sourceArtifact = Artifact(artifactID, "src", "jar", Some("sources"), Nil, None)
|
|
|
|
|
// val docsArtifact = Artifact(artifactID, "doc", "jar", Some("docs"), Nil, None)
|
2010-03-05 14:33:14 +01:00
|
|
|
|
2010-04-01 23:02:13 +02:00
|
|
|
// Credentials(Path.userHome / ".akka_publish_credentials", log)
|
|
|
|
|
|
2011-02-08 12:36:47 +13:00
|
|
|
// override def documentOptions = encodingUtf8.map(SimpleDocOption(_))
|
|
|
|
|
// override def packageDocsJar = defaultJarPath("-docs.jar")
|
|
|
|
|
// override def packageSrcJar= defaultJarPath("-sources.jar")
|
|
|
|
|
// override def packageToPublishActions = super.packageToPublishActions ++ Seq(packageDocs, packageSrc)
|
2010-04-01 23:02:13 +02:00
|
|
|
|
|
|
|
|
override def pomExtra =
|
|
|
|
|
<inceptionYear>2009</inceptionYear>
|
2010-11-21 13:31:07 +01:00
|
|
|
<url>http://akka.io</url>
|
2010-04-01 23:02:13 +02:00
|
|
|
<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
|
|
|
|
2010-08-24 23:21:28 +02:00
|
|
|
// publish to local mvn
|
|
|
|
|
import Process._
|
|
|
|
|
lazy val publishLocalMvn = runMvnInstall
|
|
|
|
|
def runMvnInstall = task {
|
|
|
|
|
for (absPath <- akkaArtifacts.getPaths) {
|
2011-01-21 12:10:06 +01:00
|
|
|
val artifactRE = """(.*)/dist/(.*)-(\d.*)\.jar""".r
|
2010-08-24 23:21:28 +02:00
|
|
|
val artifactRE(path, artifactId, artifactVersion) = absPath
|
|
|
|
|
val command = "mvn install:install-file" +
|
|
|
|
|
" -Dfile=" + absPath +
|
2010-11-08 15:42:08 +01:00
|
|
|
" -DgroupId=se.scalablesolutions.akka" +
|
2010-08-24 23:21:28 +02:00
|
|
|
" -DartifactId=" + artifactId +
|
|
|
|
|
" -Dversion=" + version +
|
|
|
|
|
" -Dpackaging=jar -DgeneratePom=true"
|
|
|
|
|
command ! log
|
|
|
|
|
}
|
|
|
|
|
None
|
|
|
|
|
} dependsOn(dist) describedAs("Run mvn install for artifacts in dist.")
|
|
|
|
|
|
2011-01-21 16:29:26 +13:00
|
|
|
|
|
|
|
|
// Build release
|
|
|
|
|
|
|
|
|
|
val localReleasePath = outputPath / "release" / version.toString
|
|
|
|
|
val localReleaseRepository = Resolver.file("Local Release", localReleasePath / "repository" asFile)
|
|
|
|
|
val localReleaseDownloads = localReleasePath / "downloads"
|
|
|
|
|
|
|
|
|
|
override def otherRepositories = super.otherRepositories ++ Seq(localReleaseRepository)
|
|
|
|
|
|
|
|
|
|
lazy val publishRelease = {
|
|
|
|
|
val releaseConfiguration = new DefaultPublishConfiguration(localReleaseRepository, "release", false)
|
|
|
|
|
publishTask(publishIvyModule, releaseConfiguration) dependsOn (deliver, publishLocal, makePom)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lazy val buildRelease = task {
|
|
|
|
|
FileUtilities.copy(Seq(distArchive), localReleaseDownloads, log).left.toOption
|
|
|
|
|
} dependsOn (publishRelease, dist)
|
|
|
|
|
|
2010-08-24 23:21:28 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-08-28 16:48:27 +02:00
|
|
|
// akka-actor subproject
|
2010-08-24 23:21:28 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
2010-08-28 16:48:27 +02:00
|
|
|
class AkkaActorProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
|
2010-08-31 19:12:14 +02:00
|
|
|
val uuid = Dependencies.uuid
|
2010-08-24 23:21:28 +02:00
|
|
|
val configgy = Dependencies.configgy
|
|
|
|
|
val hawtdispatch = Dependencies.hawtdispatch
|
|
|
|
|
val jsr166x = Dependencies.jsr166x
|
|
|
|
|
val logback = Dependencies.logback
|
|
|
|
|
|
|
|
|
|
// testing
|
2010-11-05 16:11:34 +13:00
|
|
|
val junit = Dependencies.junit
|
|
|
|
|
val scalatest = Dependencies.scalatest
|
|
|
|
|
val multiverse_test = Dependencies.multiverse_test // StandardLatch
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// akka-stm subproject
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
class AkkaStmProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
|
|
|
|
|
val multiverse = Dependencies.multiverse
|
|
|
|
|
|
|
|
|
|
// testing
|
2010-12-22 15:35:50 +01:00
|
|
|
val junit = Dependencies.junit
|
|
|
|
|
val scalatest = Dependencies.scalatest
|
2010-08-24 23:21:28 +02:00
|
|
|
}
|
|
|
|
|
|
2010-08-28 16:48:27 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// akka-typed-actor subproject
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
class AkkaTypedActorProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
|
2010-12-22 15:35:50 +01:00
|
|
|
val aopalliance = Dependencies.aopalliance
|
|
|
|
|
val aspectwerkz = Dependencies.aspectwerkz
|
|
|
|
|
val guicey = Dependencies.guicey
|
2010-08-24 23:21:28 +02:00
|
|
|
|
|
|
|
|
// 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
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-08-28 16:48:27 +02:00
|
|
|
// akka-remote subproject
|
2010-07-31 12:37:08 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-08-28 16:48:27 +02:00
|
|
|
class AkkaRemoteProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
|
2010-07-20 08:39:18 +02:00
|
|
|
val commons_codec = Dependencies.commons_codec
|
|
|
|
|
val commons_io = Dependencies.commons_io
|
|
|
|
|
val dispatch_http = Dependencies.dispatch_http
|
2010-07-20 09:45:09 +02:00
|
|
|
val dispatch_json = Dependencies.dispatch_json
|
|
|
|
|
val guicey = Dependencies.guicey
|
|
|
|
|
val h2_lzf = Dependencies.h2_lzf
|
2010-07-20 08:39:18 +02:00
|
|
|
val jackson = Dependencies.jackson
|
|
|
|
|
val jackson_core = Dependencies.jackson_core
|
2010-07-20 09:45:09 +02:00
|
|
|
val netty = Dependencies.netty
|
|
|
|
|
val protobuf = Dependencies.protobuf
|
|
|
|
|
val sbinary = Dependencies.sbinary
|
|
|
|
|
val sjson = Dependencies.sjson
|
2010-06-01 18:41:39 +02:00
|
|
|
|
2010-05-06 20:59:04 +02:00
|
|
|
// testing
|
2010-07-20 08:39:18 +02:00
|
|
|
val junit = Dependencies.junit
|
2010-07-20 09:45:09 +02:00
|
|
|
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-http subproject
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-08-18 15:15:22 +02:00
|
|
|
class AkkaHttpProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
|
2010-11-08 15:58:09 +01:00
|
|
|
val jsr250 = Dependencies.jsr250
|
2010-11-21 07:21:17 -08:00
|
|
|
val javax_servlet30 = Dependencies.javax_servlet_30
|
2010-08-31 16:43:47 +02:00
|
|
|
val jetty = Dependencies.jetty
|
2010-08-31 18:11:13 +02:00
|
|
|
val jetty_util = Dependencies.jetty_util
|
2010-08-31 16:43:47 +02:00
|
|
|
val jetty_xml = Dependencies.jetty_xml
|
2010-09-03 11:45:01 +02:00
|
|
|
val jetty_servlet = Dependencies.jetty_servlet
|
2010-10-28 14:27:48 +02:00
|
|
|
val jackson_core = Dependencies.jackson_core
|
2010-07-20 09:45:09 +02:00
|
|
|
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 stax_api = Dependencies.stax_api
|
2010-06-01 18:41:39 +02:00
|
|
|
|
2010-03-05 09:17:15 +01:00
|
|
|
// testing
|
2010-07-20 09:45:09 +02:00
|
|
|
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
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Examples
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-08-18 15:15:22 +02:00
|
|
|
class AkkaSampleAntsProject(info: ProjectInfo) extends DefaultSpdeProject(info) {
|
2010-11-23 11:50:06 +13:00
|
|
|
override def disableCrossPaths = true
|
2010-05-25 13:07:49 +02:00
|
|
|
override def spdeSourcePath = mainSourcePath / "spde"
|
2011-02-08 12:36:47 +13:00
|
|
|
|
|
|
|
|
lazy val sourceArtifact = Artifact(this.artifactID, "src", "jar", Some("sources"), Nil, None)
|
|
|
|
|
lazy val docsArtifact = Artifact(this.artifactID, "doc", "jar", Some("docs"), Nil, None)
|
|
|
|
|
override def packageDocsJar = this.defaultJarPath("-docs.jar")
|
|
|
|
|
override def packageSrcJar = this.defaultJarPath("-sources.jar")
|
|
|
|
|
override def packageToPublishActions = super.packageToPublishActions ++ Seq(this.packageDocs, this.packageSrc)
|
|
|
|
|
|
|
|
|
|
lazy val publishRelease = {
|
|
|
|
|
val releaseConfiguration = new DefaultPublishConfiguration(localReleaseRepository, "release", false)
|
|
|
|
|
publishTask(publishIvyModule, releaseConfiguration) dependsOn (deliver, publishLocal, makePom)
|
|
|
|
|
}
|
2010-05-25 13:07:49 +02:00
|
|
|
}
|
2010-03-05 14:33:14 +01:00
|
|
|
|
2010-08-18 15:15:22 +02:00
|
|
|
class AkkaSampleRemoteProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
|
2010-12-22 15:35:50 +01:00
|
|
|
|
2010-11-24 15:44:42 +01:00
|
|
|
class AkkaSampleFSMProject(info: ProjectInfo) extends AkkaDefaultProject(info, deployPath)
|
2010-05-04 10:40:58 +02:00
|
|
|
|
2010-03-05 14:33:14 +01:00
|
|
|
class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) {
|
2010-11-23 12:28:21 +13:00
|
|
|
override def disableCrossPaths = true
|
|
|
|
|
|
2010-05-25 13:07:49 +02:00
|
|
|
lazy val akka_sample_ants = project("akka-sample-ants", "akka-sample-ants",
|
2010-11-05 16:11:34 +13:00
|
|
|
new AkkaSampleAntsProject(_), akka_stm)
|
2010-11-24 15:44:42 +01:00
|
|
|
lazy val akka_sample_fsm = project("akka-sample-fsm", "akka-sample-fsm",
|
|
|
|
|
new AkkaSampleFSMProject(_), akka_actor)
|
2010-05-04 10:40:58 +02:00
|
|
|
lazy val akka_sample_remote = project("akka-sample-remote", "akka-sample-remote",
|
2010-11-23 15:31:28 +01:00
|
|
|
new AkkaSampleRemoteProject(_), akka_remote)
|
2011-02-08 12:36:47 +13:00
|
|
|
|
|
|
|
|
lazy val publishRelease = {
|
|
|
|
|
val releaseConfiguration = new DefaultPublishConfiguration(localReleaseRepository, "release", false)
|
|
|
|
|
publishTask(publishIvyModule, releaseConfiguration) dependsOn (deliver, publishLocal, makePom)
|
|
|
|
|
}
|
2010-03-10 17:16:10 +01:00
|
|
|
}
|
2010-04-01 10:06:43 +02:00
|
|
|
|
2011-01-21 16:29:26 +13:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// akka-sbt-plugin subproject
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
class AkkaSbtPluginProject(info: ProjectInfo) extends PluginProject(info) {
|
|
|
|
|
lazy val publishRelease = {
|
|
|
|
|
val releaseConfiguration = new DefaultPublishConfiguration(localReleaseRepository, "release", false)
|
|
|
|
|
publishTask(publishIvyModule, releaseConfiguration) dependsOn (deliver, publishLocal, makePom)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2010-07-31 12:37:08 +02:00
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
// Helpers
|
|
|
|
|
// -------------------------------------------------------------------------------------------------------------------
|
2010-07-20 12:01:02 +02:00
|
|
|
|
2010-11-23 15:59:37 +01:00
|
|
|
def removeDupEntries(paths: PathFinder) = Path.lazyPathFinder {
|
|
|
|
|
val mapped = paths.get map { p => (p.relativePath, p) }
|
|
|
|
|
(Map() ++ mapped).values.toList
|
|
|
|
|
}
|
2010-04-01 10:06:43 +02:00
|
|
|
|
|
|
|
|
def allArtifacts = {
|
|
|
|
|
Path.fromFile(buildScalaInstance.libraryJar) +++
|
2011-01-22 12:24:21 +13:00
|
|
|
(removeDupEntries(runClasspath filter ClasspathUtilities.isArchive) ---
|
|
|
|
|
(akka_sbt_plugin.runClasspath filter ClasspathUtilities.isArchive) +++
|
2010-04-01 10:06:43 +02:00
|
|
|
((outputPath ##) / defaultJarName) +++
|
|
|
|
|
mainResources +++
|
|
|
|
|
mainDependencies.scalaJars +++
|
2010-05-08 00:26:05 +02:00
|
|
|
descendents(info.projectPath / "scripts", "run_akka.sh") +++
|
2010-08-18 12:16:14 +01:00
|
|
|
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
|
2010-04-06 12:45:09 +02:00
|
|
|
!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-06 12:45:09 +02:00
|
|
|
)
|
2010-04-01 10:06:43 +02:00
|
|
|
}
|
2010-07-29 17:29:51 +02:00
|
|
|
|
2010-11-20 21:08:57 +01:00
|
|
|
def akkaArtifacts = descendents(info.projectPath / "dist", "*-" + version + ".jar")
|
2010-09-23 21:30:20 +02:00
|
|
|
lazy val integrationTestsEnabled = systemOptional[Boolean]("integration.tests",false)
|
|
|
|
|
lazy val stressTestsEnabled = systemOptional[Boolean]("stress.tests",false)
|
2010-04-01 10:06:43 +02:00
|
|
|
|
2010-05-25 11:17:18 +02:00
|
|
|
// ------------------------------------------------------------
|
2010-12-22 15:35:50 +01:00
|
|
|
class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info)
|
|
|
|
|
with DeployProject with OSGiProject with McPom {
|
2010-11-22 13:14:10 +13:00
|
|
|
override def disableCrossPaths = true
|
2011-02-01 17:46:45 +13:00
|
|
|
|
|
|
|
|
override def compileOptions = super.compileOptions ++ scalaCompileSettings.map(CompileOption)
|
|
|
|
|
override def javaCompileOptions = super.javaCompileOptions ++ javaCompileSettings.map(JavaCompileOption)
|
|
|
|
|
|
2011-01-21 12:10:06 +01:00
|
|
|
lazy val sourceArtifact = Artifact(this.artifactID, "src", "jar", Some("sources"), Nil, None)
|
2010-10-21 11:00:10 +02:00
|
|
|
lazy val docsArtifact = Artifact(this.artifactID, "doc", "jar", Some("docs"), Nil, None)
|
2010-08-27 21:27:37 +02:00
|
|
|
override def runClasspath = super.runClasspath +++ (AkkaParentProject.this.info.projectPath / "config")
|
|
|
|
|
override def testClasspath = super.testClasspath +++ (AkkaParentProject.this.info.projectPath / "config")
|
2010-08-26 16:30:28 +02:00
|
|
|
override def packageDocsJar = this.defaultJarPath("-docs.jar")
|
|
|
|
|
override def packageSrcJar = this.defaultJarPath("-sources.jar")
|
2010-08-31 18:11:13 +02:00
|
|
|
override def packageToPublishActions = super.packageToPublishActions ++ Seq(this.packageDocs, this.packageSrc)
|
2010-12-08 10:14:27 +01:00
|
|
|
override def pomPostProcess(node: scala.xml.Node): scala.xml.Node = mcPom(AkkaParentProject.this.moduleConfigurations)(super.pomPostProcess(node))
|
2010-09-23 21:30:20 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Used for testOptions, possibility to enable the running of integration and or stresstests
|
|
|
|
|
*
|
|
|
|
|
* To enable set true and disable set false
|
|
|
|
|
* set integration.tests true
|
|
|
|
|
* set stress.tests true
|
|
|
|
|
*/
|
|
|
|
|
def createTestFilter(defaultTests: (String) => Boolean) = { TestFilter({
|
|
|
|
|
case s: String if defaultTests(s) => true
|
|
|
|
|
case s: String if integrationTestsEnabled.value => s.endsWith("TestIntegration")
|
|
|
|
|
case s: String if stressTestsEnabled.value => s.endsWith("TestStress")
|
|
|
|
|
case _ => false
|
|
|
|
|
}) :: Nil
|
|
|
|
|
}
|
2011-01-21 16:29:26 +13:00
|
|
|
|
|
|
|
|
lazy val publishRelease = {
|
|
|
|
|
val releaseConfiguration = new DefaultPublishConfiguration(localReleaseRepository, "release", false)
|
|
|
|
|
publishTask(publishIvyModule, releaseConfiguration) dependsOn (deliver, publishLocal, makePom)
|
|
|
|
|
}
|
2010-08-26 16:30:28 +02:00
|
|
|
}
|
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")
|
2010-11-23 15:59:37 +01:00
|
|
|
|
2010-08-09 10:09:26 +02:00
|
|
|
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-06-06 14:33:10 -04:00
|
|
|
|
2010-08-09 10:09:26 +02:00
|
|
|
trait OSGiProject extends BNDPlugin { self: DefaultProject =>
|
2010-10-26 12:49:25 +02:00
|
|
|
override def bndExportPackage = Seq("akka.*;version=%s".format(projectVersion.value))
|
2010-03-02 00:34:14 -05:00
|
|
|
}
|
2010-12-08 10:14:27 +01:00
|
|
|
|
|
|
|
|
trait McPom { self: DefaultProject =>
|
|
|
|
|
import scala.xml._
|
|
|
|
|
|
|
|
|
|
def mcPom(mcs: Set[ModuleConfiguration])(node: Node): Node = {
|
|
|
|
|
|
|
|
|
|
def cleanUrl(url: String) = url match {
|
2010-12-22 15:35:50 +01:00
|
|
|
case null => ""
|
|
|
|
|
case "" => ""
|
2010-12-08 10:14:27 +01:00
|
|
|
case u if u endsWith "/" => u
|
2010-12-22 15:35:50 +01:00
|
|
|
case u => u + "/"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val oldRepos =
|
|
|
|
|
(node \\ "project" \ "repositories" \ "repository").map { n =>
|
|
|
|
|
cleanUrl((n \ "url").text) -> (n \ "name").text
|
|
|
|
|
}.toList
|
|
|
|
|
|
|
|
|
|
val newRepos =
|
|
|
|
|
mcs.filter(_.resolver.isInstanceOf[MavenRepository]).map { m =>
|
|
|
|
|
val r = m.resolver.asInstanceOf[MavenRepository]
|
|
|
|
|
cleanUrl(r.root) -> r.name
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val repos = Map((oldRepos ++ newRepos): _*).map { pair =>
|
|
|
|
|
<repository>
|
|
|
|
|
<id>{pair._2.toSeq.filter(_.isLetterOrDigit).mkString}</id>
|
|
|
|
|
<name>{pair._2}</name>
|
|
|
|
|
<url>{pair._1}</url>
|
|
|
|
|
</repository>
|
2010-12-08 10:14:27 +01:00
|
|
|
}
|
|
|
|
|
|
2010-12-22 15:35:50 +01:00
|
|
|
def rewrite(pf: PartialFunction[Node, Node])(ns: Seq[Node]): Seq[Node] = for(subnode <- ns) yield subnode match {
|
|
|
|
|
case e: Elem =>
|
|
|
|
|
if (pf isDefinedAt e) pf(e)
|
|
|
|
|
else Elem(e.prefix, e.label, e.attributes, e.scope, rewrite(pf)(e.child):_*)
|
|
|
|
|
case other => other
|
2010-12-08 10:14:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
val rule: PartialFunction[Node,Node] = if ((node \\ "project" \ "repositories" ).isEmpty) {
|
|
|
|
|
case Elem(prefix, "project", attribs, scope, children @ _*) =>
|
|
|
|
|
Elem(prefix, "project", attribs, scope, children ++ <repositories>{repos}</repositories>:_*)
|
|
|
|
|
} else {
|
|
|
|
|
case Elem(prefix, "repositories", attribs, scope, children @ _*) =>
|
2010-12-22 15:35:50 +01:00
|
|
|
Elem(prefix, "repositories", attribs, scope, repos.toList: _*)
|
2010-12-08 10:14:27 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rewrite(rule)(node.theSeq)(0)
|
|
|
|
|
}
|
2010-12-18 21:36:28 -07:00
|
|
|
}
|