added new task publish-local-mvn

This commit is contained in:
Michael Kober 2010-05-25 11:17:18 +02:00
parent b503e29260
commit 98b569c454

View file

@ -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) {
<distribution>repo</distribution>
</license>
</licenses>
// 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)