From 98b569c45486fd2dca2ec6d6c8c2bdcb8649477e Mon Sep 17 00:00:00 2001 From: Michael Kober Date: Tue, 25 May 2010 11:17:18 +0200 Subject: [PATCH 1/2] added new task publish-local-mvn --- project/build/AkkaProject.scala | 46 ++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index ff4e13ef5a..560c535cbe 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -4,7 +4,6 @@ import sbt._ import sbt.CompileOrder._ -import spde._ import java.util.jar.Attributes import java.util.jar.Attributes.Name._ @@ -23,6 +22,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------ lazy val deployPath = info.projectPath / "deploy" lazy val distPath = info.projectPath / "dist" + lazy val parentPath = info.projectPath override def compileOptions = super.compileOptions ++ Seq("-deprecation", "-Xmigration", "-Xcheckinit", @@ -131,6 +131,24 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { repo + + // 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.") // ------------------------------------------------------------ // subprojects @@ -153,7 +171,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val aopalliance = "aopalliance" % "aopalliance" % "1.0" % "compile" val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" val multiverse = "org.multiverse" % "multiverse-alpha" % "0.5" % "compile" - val jgroups = "jgroups" % "jgroups" % "2.9.0.GA" % "compile" + val jgroups = "jgroups" % "jgroups" % "2.8.0.CR7" % "compile" // testing val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test" @@ -199,7 +217,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { - val redis = "com.redis" % "redisclient" % "2.8.0.RC2-1.4-SNAPSHOT" % "compile" + val redis = "com.redis" % "redisclient" % "2.8.0.Beta1-1.3" % "compile" override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil } @@ -250,9 +268,8 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { //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" } - - // ================= TESTS ================== + // examples 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" @@ -266,15 +283,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val jmock = "org.jmock" % "jmock" % "2.4.0" % "test" } - // ================= 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) { @@ -310,8 +319,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) { - 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", new AkkaSampleChatProject(_), akka_kernel) lazy val akka_sample_pubsub = project("akka-sample-pubsub", "akka-sample-pubsub", @@ -355,6 +362,12 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { !jar.toString.endsWith("scala-library-2.7.7.jar") ) } + + def akkaArtifacts = { + descendents(info.projectPath / "dist", "*" + buildScalaVersion + "-" + version + ".jar") + } + // ------------------------------------------------------------ + class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject @@ -363,17 +376,14 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { 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") } - private def gen(jar: Path, toDir: Path, flag: Boolean, msg: String): Option[String] = if (flag) { log.info(msg + " " + jar) From f0bbb1edf48ea9999e033a60eae36310803b2f38 Mon Sep 17 00:00:00 2001 From: Michael Kober Date: Tue, 25 May 2010 12:17:54 +0200 Subject: [PATCH 2/2] fixed merge error --- project/build/AkkaProject.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala index 9330278f80..26327d9c0c 100644 --- a/project/build/AkkaProject.scala +++ b/project/build/AkkaProject.scala @@ -4,7 +4,8 @@ import sbt._ import sbt.CompileOrder._ - +import spde._ + import java.util.jar.Attributes import java.util.jar.Attributes.Name._ import java.io.File @@ -22,7 +23,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { // ------------------------------------------------------------ lazy val deployPath = info.projectPath / "deploy" lazy val distPath = info.projectPath / "dist" - lazy val parentPath = info.projectPath override def compileOptions = super.compileOptions ++ Seq("-deprecation", "-Xmigration", "-Xcheckinit", @@ -171,7 +171,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { val aopalliance = "aopalliance" % "aopalliance" % "1.0" % "compile" val protobuf = "com.google.protobuf" % "protobuf-java" % "2.2.0" % "compile" val multiverse = "org.multiverse" % "multiverse-alpha" % "0.5" % "compile" - val jgroups = "jgroups" % "jgroups" % "2.8.0.CR7" % "compile" + val jgroups = "jgroups" % "jgroups" % "2.9.0.GA" % "compile" // testing val scalatest = "org.scalatest" % "scalatest" % SCALATEST_VERSION % "test" @@ -217,7 +217,7 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) { } class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) { - val redis = "com.redis" % "redisclient" % "2.8.0.Beta1-1.3" % "compile" + val redis = "com.redis" % "redisclient" % "2.8.0.RC2-1.4-SNAPSHOT" % "compile" override def testOptions = TestFilter((name: String) => name.endsWith("Test")) :: Nil }