pulled wrappers into AkkaWrapperProject trait file; sjson, objenesis, dispatch-json, netty ok; multiverse is next

This commit is contained in:
Andreas Kollegger 2010-06-08 22:57:55 -04:00
parent 96728a0b5a
commit 2c5fd110e5
3 changed files with 97 additions and 51 deletions

View file

@ -1,7 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="akka 0.9">
<feature name="scala-osgi" version="1.5">
<bundle>mvn:com.weiglewilczek.scala-lang-osgi/scala-library/2.8.0.RC2</bundle>
<bundle>mvn:org.eclipse.scalamodules/scalamodules-core/2.0-M2</bundle>
</feature>
<feature name="sjson" version="0.6-SNAPSHOT">
<bundle>mvn:se.scalablesolutions.akka.akka-wrap/dispatch-json_2.8.0.RC3_osgi/0.7.4</bundle>
<bundle>mvn:org.objenesis/objenesis/1.2</bundle>
<bundle>mvn:sjson.json/sjson/0.6-SNAPSHOT</bundle>
</feature>
<feature name="akka-core" version="0.9-SNAPSHOT">
<feature>sjson</feature>
<bundle>mvn:se.scalablesolutions.akka.akka-wrap/jgroups-wrapper_2.8.0.RC3_osgi/2.9.0.GA</bundle>
<bundle>mvn:org.jboss.netty/netty/3.2.0.CR1</bundle>
<bundle>mvn:se.scalablesolutions.akka/akka-core_2.8.0.RC3_osgi/0.9</bundle>
</feature>
</features>

View file

@ -12,7 +12,7 @@ import java.io.File
import com.weiglewilczek.bnd4sbt._
class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
class AkkaParent(info: ProjectInfo) extends DefaultProject(info) with AkkaWrappersProject {
// ------------------------------------------------------------
// project versions
@ -86,9 +86,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
// examples
lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_))
// OSGi wrappers
lazy val akka_wrappers = project("akka-wrap", "akka-wrap", new AkkaWrappersParentProject(_))
// ------------------------------------------------------------
// Run Akka microkernel using 'sbt run' + use for packaging executable JAR
override def mainClass = Some("se.scalablesolutions.akka.kernel.Main")
@ -175,25 +172,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
None
} dependsOn(dist) describedAs("Run mvn install for artifacts in dist.")
lazy val publishLocalMvnWrapped = runMvnInstallWrapped
def runMvnInstallWrapped = task {
for (absPath <- wrappedArtifacts.getPaths) {
val artifactRE = """.*/([^/]+)-([^-]+).jar""".r
val artifactRE(artifactId, artifactVersion) = absPath
val command = "mvn install:install-file" +
" -Dfile=" + absPath +
" -DgroupId=se.scalablesolutions.akka.akka-wrap" +
" -DartifactId=" + artifactId +
" -Dversion=" + artifactVersion +
" -Dpackaging=jar -DgeneratePom=true"
command ! log
}
None
} dependsOn(`package`) describedAs("Run mvn install for wrapped artifacts in akka-wrap.")
// ------------------------------------------------------------
// subprojects
class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
@ -384,23 +362,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
new AkkaSampleRemoteProject(_), akka_kernel)
}
// ================= OSGi Wrappers ==================
class JgroupsWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) {
override def wrappedVersion = "2.9.0.GA"
override def bndImportPackage = Set("org.testng.*;resolution:=optional",
"org.bouncycastle.jce.provider;resolution:=optional",
"bsh;resolution:=optional",
"*")
val jgroups = "jgroups" % "jgroups" % wrappedVersion % "compile"
}
class AkkaWrappersParentProject(info: ProjectInfo) extends ParentProject(info) {
lazy val jgroups_wrapper = project("jgroups-wrapper", "jgroups-wrapper",
new JgroupsWrapperProject(_))
}
// ------------------------------------------------------------
// helper functions
def removeDupEntries(paths: PathFinder) =
@ -429,8 +390,6 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
def akkaArtifacts = descendents(info.projectPath / "dist", "*" + buildScalaVersion + "_osgi-" + version + ".jar")
def wrappedArtifacts = descendents(info.projectPath / "akka-wrap", "*" + buildScalaVersion + "_osgi-" + "*.jar")
// ------------------------------------------------------------
class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject with OSGiProject
@ -460,13 +419,4 @@ class AkkaParent(info: ProjectInfo) extends DefaultProject(info) {
}
abstract class OSGiWrapperProject(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin {
def wrappedVersion:String
override def version = OpaqueVersion(wrappedVersion)
override def artifactID = moduleID + "_osgi"
override def bndEmbedDependencies = true
override def bndExportPackage = Set("*")
}
}

View file

@ -0,0 +1,81 @@
/*---------------------------------------------------------------------------\
| Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se> |
\---------------------------------------------------------------------------*/
import sbt._
import sbt.CompileOrder._
import spde._
import java.util.jar.Attributes
import java.util.jar.Attributes.Name._
import java.io.File
import com.weiglewilczek.bnd4sbt._
trait AkkaWrappersProject extends DefaultProject {
// ------------------------------------------------------------
// project versions
val JERSEY_VERSION:String
val ATMO_VERSION:String
val CASSANDRA_VERSION:String
val LIFT_VERSION:String
val SCALATEST_VERSION:String
val MULTIVERSE_VERSION:String
// OSGi wrappers
lazy val akka_wrappers = project("akka-wrap", "akka-wrap", new AkkaWrappersParentProject(_))
import Process._
lazy val publishLocalMvnWrapped = runMvnInstallWrapped
def runMvnInstallWrapped = task {
for (absPath <- wrappedArtifacts.getPaths) {
val artifactRE = """.*/([^/]+)-([^-]+).jar""".r
val artifactRE(artifactId, artifactVersion) = absPath
val command = "mvn install:install-file" +
" -Dfile=" + absPath +
" -DgroupId=se.scalablesolutions.akka.akka-wrap" +
" -DartifactId=" + artifactId +
" -Dversion=" + artifactVersion +
" -Dpackaging=jar -DgeneratePom=true"
command ! log
}
None
} dependsOn(`package`) describedAs("Run mvn install for wrapped artifacts in akka-wrap.")
// ================= OSGi Wrappers ==================
class JgroupsWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) {
override def wrappedVersion = "2.9.0.GA"
override def bndImportPackage = Set("org.testng.*;resolution:=optional",
"org.bouncycastle.jce.provider;resolution:=optional",
"bsh;resolution:=optional",
"*")
val jgroups = "jgroups" % "jgroups" % wrappedVersion % "compile"
}
class DispatchJsonWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) {
override def wrappedVersion = "0.7.4"
val dispatch_json = "net.databinder" % "dispatch-json_2.8.0.RC3" % wrappedVersion % "compile"
}
class AkkaWrappersParentProject(info: ProjectInfo) extends ParentProject(info) {
lazy val jgroups_wrapper = project("jgroups-wrapper", "jgroups-wrapper",
new JgroupsWrapperProject(_))
lazy val dispath_json = project("dispatch-json", "dispatch-json",
new DispatchJsonWrapperProject(_))
}
def wrappedArtifacts = descendents(info.projectPath / "akka-wrap", "*" + buildScalaVersion + "_osgi-" + "*.jar")
abstract class OSGiWrapperProject(info: ProjectInfo) extends DefaultProject(info) with BNDPlugin {
def wrappedVersion:String
override def version = OpaqueVersion(wrappedVersion)
override def artifactID = moduleID + "_osgi"
override def bndEmbedDependencies = true
override def bndExportPackage = Set("*")
}
}