diff --git a/akka-core/pom.xml b/akka-core/pom.xml
new file mode 100644
index 0000000000..b9753200c8
--- /dev/null
+++ b/akka-core/pom.xml
@@ -0,0 +1,127 @@
+
+ 4.0.0
+
+ akka-core
+ Akka Core - Actors, Remote Actors, Transactors and STM Module
+
+ jar
+
+
+ akka
+ se.scalablesolutions.akka
+ 0.7-SNAPSHOT
+
+
+
+
+
+ akka-util-java
+ ${project.groupId}
+ ${project.version}
+
+
+ akka-util
+ ${project.groupId}
+ ${project.version}
+
+
+ org.scala-lang
+ scala-library
+ ${scala.version}
+
+
+ org.codehaus.aspectwerkz
+ aspectwerkz-nodeps-jdk5
+ 2.1
+
+
+ org.codehaus.aspectwerkz
+ aspectwerkz-jdk5
+ 2.1
+
+
+ org.jboss.netty
+ netty
+ 3.2.0.ALPHA3
+
+
+ org.scala-tools
+ javautils
+ 2.7.4-0.1
+
+
+
+
+ voldemort.store.compress
+ h2-lzf
+ 1.0
+
+
+ org.codehaus.jackson
+ jackson-core-asl
+ 1.2.1
+
+
+ org.codehaus.jackson
+ jackson-mapper-asl
+ 1.2.1
+
+
+ sbinary
+ sbinary
+ 0.3
+
+
+ net.databinder
+ dispatch-json_2.7.7
+ 0.6.4
+
+
+ commons-io
+ commons-io
+ 1.4
+
+
+ net.databinder
+ dispatch-http_2.7.7
+ 0.6.4
+
+
+ sjson.json
+ sjson
+ 0.4
+
+
+
+
+ org.scalatest
+ scalatest
+ 1.0
+ test
+
+
+ junit
+ junit
+ 4.5
+ test
+
+
+
+
+
+
+ org.apache.felix
+ maven-bundle-plugin
+
+
+
+ se.scalablesolutions.akka.*;version=${project.version};-split-package:=merge-first
+
+
+
+
+
+
+
diff --git a/akka-karaf/akka-features/src/main/resources/features.xml b/akka-karaf/akka-features/src/main/resources/features.xml
new file mode 100644
index 0000000000..7506820024
--- /dev/null
+++ b/akka-karaf/akka-features/src/main/resources/features.xml
@@ -0,0 +1,22 @@
+
+
+
+
+ mvn:com.weiglewilczek.scala-lang-osgi/scala-library/2.8.0.RC2
+ mvn:org.eclipse.scalamodules/scalamodules-core/2.0-M2
+
+
+
+
+ mvn:se.scalablesolutions.akka.akka-wrap/dispatch-json_2.8.0.RC3_osgi/0.7.4
+ mvn:org.objenesis/objenesis/1.2
+ mvn:sjson.json/sjson/0.6-SNAPSHOT
+
+
+
+ sjson
+ mvn:se.scalablesolutions.akka.akka-wrap/jgroups-wrapper_2.8.0.RC3_osgi/2.9.0.GA
+ mvn:org.jboss.netty/netty/3.2.0.CR1
+ mvn:se.scalablesolutions.akka/akka-core_2.8.0.RC3_osgi/0.9
+
+
diff --git a/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala b/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala
new file mode 100644
index 0000000000..04c7f165b9
--- /dev/null
+++ b/akka-samples/akka-sample-osgi/src/main/scala/Activator.scala
@@ -0,0 +1,24 @@
+/**
+ * Copyright (C) 2009-2010 Scalable Solutions AB
+ */
+
+package sample.osgi
+
+import org.osgi.framework.{BundleActivator, BundleContext}
+
+
+class Activator extends BundleActivator {
+
+ def start(context: BundleContext) {
+ println("Start")
+ val osgiActor = new OSGiActor
+ //osgiActor ! "Hello"
+ Unit
+ }
+
+ def stop(context: BundleContext) {
+ println("stop")
+ }
+
+}
+
diff --git a/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala b/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala
new file mode 100644
index 0000000000..90bd521d7b
--- /dev/null
+++ b/akka-samples/akka-sample-osgi/src/main/scala/Actor.scala
@@ -0,0 +1,12 @@
+package sample.osgi
+
+import se.scalablesolutions.akka.actor.Actor
+
+
+class OSGiActor extends Actor {
+ def receive = {
+ case msg: String =>
+ println("Got message: " + msg)
+ }
+}
+
diff --git a/project/build/AkkaProject.scala b/project/build/AkkaProject.scala
index 89685dffd6..b24f477d75 100644
--- a/project/build/AkkaProject.scala
+++ b/project/build/AkkaProject.scala
@@ -2,21 +2,21 @@
| Copyright (C) 2009-2010 Scalable Solutions AB |
\---------------------------------------------------------------------------*/
-import sbt._
-import sbt.CompileOrder._
-
-import spde._
+import com.weiglewilczek.bnd4sbt.BNDPlugin
import de.tuxed.codefellow.plugin.CodeFellowPlugin
-
+import java.io.File
import java.util.jar.Attributes
import java.util.jar.Attributes.Name._
-import java.io.File
+import sbt._
+import sbt.CompileOrder._
+import spde._
class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// Compile settings
// -------------------------------------------------------------------------------------------------------------------
+
override def compileOptions = super.compileOptions ++
Seq("-deprecation",
"-Xmigration",
@@ -30,6 +30,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// Deploy/dist settings
// -------------------------------------------------------------------------------------------------------------------
+
lazy val deployPath = info.projectPath / "deploy"
lazy val distPath = info.projectPath / "dist"
def distName = "%s_%s-%s.zip".format(name, buildScalaVersion, version)
@@ -38,6 +39,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// All repositories *must* go here! See ModuleConigurations below.
// -------------------------------------------------------------------------------------------------------------------
+
object Repositories {
lazy val AkkaRepo = MavenRepository("Akka Repository", "http://scalablesolutions.se/akka/repository")
lazy val CodehausSnapshotRepo = MavenRepository("Codehaus Snapshots", "http://snapshots.repository.codehaus.org")
@@ -55,6 +57,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// must be resolved from a ModuleConfiguration. This will result in a significant acceleration of the update action.
// Therefore, if repositories are defined, this must happen as def, not as val.
// -------------------------------------------------------------------------------------------------------------------
+
import Repositories._
lazy val atmosphereModuleConfig = ModuleConfiguration("org.atmosphere", SonatypeSnapshotRepo)
lazy val grizzlyModuleConfig = ModuleConfiguration("com.sun.grizzly", JavaNetRepo)
@@ -75,6 +78,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// Versions
// -------------------------------------------------------------------------------------------------------------------
+
lazy val ATMO_VERSION = "0.6"
lazy val CAMEL_VERSION = "2.4.0"
lazy val CASSANDRA_VERSION = "0.6.1"
@@ -91,6 +95,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------------------------------------------------
+
object Dependencies {
// Compile
@@ -150,16 +155,16 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
lazy val jsr311 = "javax.ws.rs" % "jsr311-api" % "1.1" % "compile"
- lazy val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive()
+ lazy val jta_1_1 = "org.apache.geronimo.specs" % "geronimo-jta_1.1_spec" % "1.1.1" % "compile" intransitive
- lazy val lift = "net.liftweb" % "lift-webkit" % LIFT_VERSION % "compile"
- lazy val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile"
+ lazy val lift_util = "net.liftweb" % "lift-util" % LIFT_VERSION % "compile"
+ lazy val lift_webkit = "net.liftweb" % "lift-webkit" % LIFT_VERSION % "compile"
lazy val log4j = "log4j" % "log4j" % "1.2.15" % "compile"
lazy val mongo = "org.mongodb" % "mongo-java-driver" % "1.4" % "compile"
- lazy val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile" intransitive()
+ lazy val multiverse = "org.multiverse" % "multiverse-alpha" % MULTIVERSE_VERSION % "compile" intransitive
lazy val netty = "org.jboss.netty" % "netty" % "3.2.1.Final" % "compile"
@@ -204,6 +209,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// Subprojects
// -------------------------------------------------------------------------------------------------------------------
+
lazy val akka_core = project("akka-core", "akka-core", new AkkaCoreProject(_))
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)
@@ -213,10 +219,13 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
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)
+ lazy val akka_osgi = project("akka-osgi", "akka-osgi", new AkkaOSGiParentProject(_))
lazy val akka_samples = project("akka-samples", "akka-samples", new AkkaSamplesParentProject(_))
- // ------------------------------------------------------------
- // Run Akka microkernel using 'sbt run' + use for packaging executable JAR
+ // -------------------------------------------------------------------------------------------------------------------
+ // Miscellaneous
+ // -------------------------------------------------------------------------------------------------------------------
+
override def mainClass = Some("se.scalablesolutions.akka.kernel.Main")
override def packageOptions =
@@ -298,12 +307,13 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
" -Dpackaging=jar -DgeneratePom=true"
command ! log
}
- None
+ None
} dependsOn(dist) describedAs("Run mvn install for artifacts in dist.")
// -------------------------------------------------------------------------------------------------------------------
// akka-core subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaCoreProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin {
val aopalliance = Dependencies.aopalliance
val commons_codec = Dependencies.commons_codec
@@ -334,6 +344,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-amqp subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaAMQPProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin {
val commons_io = Dependencies.commons_io
val rabbit = Dependencies.rabbit
@@ -347,6 +358,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-http subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaHttpProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin {
val annotation = Dependencies.annotation
val atmo = Dependencies.atmo
@@ -375,6 +387,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-camel subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaCamelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin {
val camel_core = Dependencies.camel_core
}
@@ -382,6 +395,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaPersistenceParentProject(info: ProjectInfo) extends ParentProject(info) {
lazy val akka_persistence_common = project("akka-persistence-common", "akka-persistence-common",
new AkkaPersistenceCommonProject(_), akka_core)
@@ -404,6 +418,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence-redis subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaRedisProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val commons_codec = Dependencies.commons_codec
val redis = Dependencies.redis
@@ -414,6 +429,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence-mongo subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaMongoProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val mongo = Dependencies.mongo
@@ -423,6 +439,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-persistence-cassandra subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaCassandraProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) {
val cassandra = Dependencies.cassandra
val log4j = Dependencies.log4j
@@ -441,11 +458,13 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-kernel subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaKernelProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath)
// -------------------------------------------------------------------------------------------------------------------
// akka-spring subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaSpringProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin {
val spring_beans = Dependencies.spring_beans
val spring_context = Dependencies.spring_context
@@ -459,6 +478,7 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
// -------------------------------------------------------------------------------------------------------------------
// akka-jta subproject
// -------------------------------------------------------------------------------------------------------------------
+
class AkkaJTAProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with CodeFellowPlugin {
val atomikos_transactions = Dependencies.atomikos_transactions
val atomikos_transactions_api = Dependencies.atomikos_transactions_api
@@ -467,7 +487,112 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
//val atomikos_transactions_util = "com.atomikos" % "transactions-util" % "3.2.3" % "compile"
}
- // ================= EXAMPLES ==================
+ // -------------------------------------------------------------------------------------------------------------------
+ // OSGi stuff
+ // -------------------------------------------------------------------------------------------------------------------
+
+ class AkkaOSGiParentProject(info: ProjectInfo) extends ParentProject(info) {
+ lazy val akka_osgi_dependencies_bundle = project("akka-osgi-dependencies-bundle", "akka-osgi-dependencies-bundle",
+ new AkkaOSGiDependenciesBundleProject(_), akka_kernel, akka_jta) // akka_kernel does not depend on akka_jta (why?) therefore we list akka_jta here
+ lazy val akka_osgi_assembly = project("akka-osgi-assembly", "akka-osgi-assembly",
+ new AkkaOSGiAssemblyProject(_), akka_osgi_dependencies_bundle, akka_core, akka_amqp, akka_http,
+ akka_camel, akka_spring, akka_jta, akka_persistence.akka_persistence_common,
+ akka_persistence.akka_persistence_redis, akka_persistence.akka_persistence_mongo,
+ akka_persistence.akka_persistence_cassandra)
+ }
+
+ class AkkaOSGiDependenciesBundleProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin {
+ override def bndClasspath = compileClasspath
+ override def bndPrivatePackage = Seq("")
+ override def bndImportPackage = Seq("*;resolution:=optional")
+ override def bndExportPackage = Seq(
+ "org.aopalliance.*;version=1.0.0",
+
+ // Provided by other bundles
+ "!se.scalablesolutions.akka.*",
+ "!net.liftweb.*",
+ "!com.google.inject.*",
+ "!javax.transaction.*",
+ "!javax.ws.rs.*",
+ "!javax.jms.*",
+ "!javax.transaction,*",
+ "!org.apache.commons.io.*",
+ "!org.apache.commons.pool.*",
+ "!org.codehaus.jackson.*",
+ "!org.jboss.netty.*",
+ "!org.springframework.*",
+ "!org.apache.camel.*",
+ "!org.fusesource.commons.management.*",
+
+ "*;version=0.0.0")
+ }
+
+ class AkkaOSGiAssemblyProject(info: ProjectInfo) extends DefaultProject(info) {
+
+ // Scala bundle
+ val scala_bundle = "com.weiglewilczek.scala-lang-osgi" % "scala-library" % buildScalaVersion % "compile" intransitive
+
+ // Lift bundles
+// val lift_util = Dependencies.lift_util.intransitive
+// val lift_actor = "net.liftweb" % "lift-actor" % LIFT_VERSION % "compile" intransitive
+// val lift_common = "net.liftweb" % "lift-common" % LIFT_VERSION % "compile" intransitive
+// val lift_json = "net.liftweb" % "lift-json" % LIFT_VERSION % "compile" intransitive
+
+ // Camel bundles
+ val camel_core = Dependencies.camel_core.intransitive
+ val fusesource_commonman = "org.fusesource.commonman" % "commons-management" % "1.0" intransitive
+
+ // Spring bundles
+ val spring_beans = Dependencies.spring_beans.intransitive
+ val spring_context = Dependencies.spring_context.intransitive
+ val spring_aop = "org.springframework" % "spring-aop" % SPRING_VERSION % "compile" intransitive
+ val spring_asm = "org.springframework" % "spring-asm" % SPRING_VERSION % "compile" intransitive
+ val spring_core = "org.springframework" % "spring-core" % SPRING_VERSION % "compile" intransitive
+ val spring_expression = "org.springframework" % "spring-expression" % SPRING_VERSION % "compile" intransitive
+ val spring_jms = "org.springframework" % "spring-jms" % SPRING_VERSION % "compile" intransitive
+ val spring_tx = "org.springframework" % "spring-tx" % SPRING_VERSION % "compile" intransitive
+
+ val commons_codec = Dependencies.commons_codec.intransitive
+ val commons_io = Dependencies.commons_io.intransitive
+ val commons_pool = Dependencies.commons_pool.intransitive
+ val guicey = Dependencies.guicey.intransitive
+ val jackson = Dependencies.jackson.intransitive
+ val jackson_core = Dependencies.jackson_core.intransitive
+ val jsr311 = Dependencies.jsr311.intransitive
+ val jta_1_1 = Dependencies.jta_1_1.intransitive
+ val netty = Dependencies.netty.intransitive
+ val commons_fileupload = "commons-fileupload" % "commons-fileupload" % "1.2.1" % "compile" intransitive
+ val jms_1_1 = "org.apache.geronimo.specs" % "geronimo-jms_1.1_spec" % "1.1.1" % "compile" intransitive
+ val joda = "joda-time" % "joda-time" % "1.6" intransitive
+
+ override def packageAction =
+ task {
+ val libs: Seq[Path] = managedClasspath(config("compile")).get.toSeq
+ val prjs: Seq[Path] = info.dependencies.toSeq.asInstanceOf[Seq[DefaultProject]] map { _.jarPath }
+ val all = libs ++ prjs
+ val destination = outputPath / "bundles"
+ FileUtilities.copyFlat(all, destination, log)
+ log info "Copied %s bundles to %s".format(all.size, destination)
+ None
+ }
+
+ override def artifacts = Set.empty
+ }
+
+ // -------------------------------------------------------------------------------------------------------------------
+ // Test
+ // -------------------------------------------------------------------------------------------------------------------
+
+ class AkkaActiveObjectTestProject(info: ProjectInfo) extends DefaultProject(info) {
+ // testing
+ val junit = "junit" % "junit" % "4.5" % "test"
+ val jmock = "org.jmock" % "jmock" % "2.4.0" % "test"
+ }
+
+ // -------------------------------------------------------------------------------------------------------------------
+ // Examples
+ // -------------------------------------------------------------------------------------------------------------------
+
class AkkaSampleAntsProject(info: ProjectInfo) extends DefaultSpdeProject(info) with CodeFellowPlugin {
// val scalaToolsSnapshots = ScalaToolsSnapshots
override def spdeSourcePath = mainSourcePath / "spde"
@@ -478,8 +603,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
class AkkaSampleLiftProject(info: ProjectInfo) extends DefaultWebProject(info) with DeployProject with CodeFellowPlugin {
val commons_logging = Dependencies.commons_logging
- val lift = Dependencies.lift
val lift_util = Dependencies.lift_util
+ val lift_webkit = Dependencies.lift_webkit
val servlet = Dependencies.servlet
// testing
@@ -520,6 +645,16 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
val jsr311 = Dependencies.jsr311
}
+ class AkkaSampleOSGiProject(info: ProjectInfo) extends AkkaDefaultProject(info, distPath) with BNDPlugin {
+ override def bndClasspath = compileClasspath
+
+ val osgi_core = "org.osgi" % "org.osgi.core" % "4.2.0"
+
+ override def bndBundleActivator = Some("sample.osgi.Activator")
+ override def bndPrivatePackage = Nil
+ override def bndExportPackage = Seq("sample.osgi.*;version=0.9")
+ }
+
class AkkaSamplesParentProject(info: ProjectInfo) extends ParentProject(info) {
lazy val akka_sample_ants = project("akka-sample-ants", "akka-sample-ants",
new AkkaSampleAntsProject(_), akka_core)
@@ -539,10 +674,14 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
new AkkaSampleSecurityProject(_), akka_kernel)
lazy val akka_sample_remote = project("akka-sample-remote", "akka-sample-remote",
new AkkaSampleRemoteProject(_), akka_kernel)
+ lazy val akka_sample_osgi = project("akka-sample-osgi", "akka-sample-osgi",
+ new AkkaSampleOSGiProject(_), akka_core)
}
- // ------------------------------------------------------------
- // helper functions
+ // -------------------------------------------------------------------------------------------------------------------
+ // Helpers
+ // -------------------------------------------------------------------------------------------------------------------
+
def removeDupEntries(paths: PathFinder) =
Path.lazyPathFinder {
val mapped = paths.get map { p => (p.relativePath, p) }
@@ -566,11 +705,11 @@ class AkkaParentProject(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
+ class AkkaDefaultProject(info: ProjectInfo, val deployPath: Path) extends DefaultProject(info) with DeployProject with OSGiProject
trait DeployProject { self: Project =>
// defines where the deployTask copies jars to
@@ -591,4 +730,8 @@ class AkkaParentProject(info: ProjectInfo) extends DefaultProject(info) {
FileUtilities.copyFile(jar, toDir / jar.name, log)
} else None
}
+
+ trait OSGiProject extends DefaultProject with BNDPlugin {
+ override def bndExportPackage = Seq("se.scalablesolutions.akka.*;version=%s".format(projectVersion.value))
+ }
}
diff --git a/project/build/AkkaWrappersProject.scala b/project/build/AkkaWrappersProject.scala
new file mode 100644
index 0000000000..f92e91d191
--- /dev/null
+++ b/project/build/AkkaWrappersProject.scala
@@ -0,0 +1,88 @@
+ /*---------------------------------------------------------------------------\
+| Copyright (C) 2009-2010 Scalable Solutions AB |
+\---------------------------------------------------------------------------*/
+
+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 = Seq("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 MultiverseWrapperProject(info: ProjectInfo) extends OSGiWrapperProject(info) {
+ override def wrappedVersion = "0.5.2"
+
+ val multiverse = "org.multiverse" % "multiverse-alpha" % 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(_))
+ lazy val multiverse_wrapper = project("multiverse-wrapper", "multiverse-wrapper",
+ new MultiverseWrapperProject(_))
+ }
+
+ 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 bndExportPackage = Seq("*")
+ }
+
+
+}
diff --git a/project/plugins/Plugins.scala b/project/plugins/Plugins.scala
index b19b0ebf8c..f0332505da 100644
--- a/project/plugins/Plugins.scala
+++ b/project/plugins/Plugins.scala
@@ -6,6 +6,7 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
// All repositories *must* go here! See ModuleConigurations below.
// -------------------------------------------------------------------------------------------------------------------
object Repositories {
+ lazy val AquteRepo = "aQute Maven Repository" at "http://www.aqute.biz/repo"
lazy val DatabinderRepo = "Databinder Repository" at "http://databinder.net/repo"
lazy val EmbeddedRepo = "Embedded Repo" at (info.projectPath / "embedded-repo").asURL.toString
}
@@ -17,12 +18,14 @@ class Plugins(info: ProjectInfo) extends PluginDefinition(info) {
// Therefore, if repositories are defined, this must happen as def, not as val.
// -------------------------------------------------------------------------------------------------------------------
import Repositories._
+ lazy val aquteModuleConfig = ModuleConfiguration("biz.aQute", AquteRepo)
lazy val codeFellowModuleConfig = ModuleConfiguration("de.tuxed", EmbeddedRepo)
lazy val spdeModuleConfig = ModuleConfiguration("us.technically.spde", DatabinderRepo)
// -------------------------------------------------------------------------------------------------------------------
// Dependencies
// -------------------------------------------------------------------------------------------------------------------
- lazy val codeFellow = "de.tuxed" % "codefellow-plugin" % "0.3" // for code completion and more in VIM
- lazy val spdeSbt = "us.technically.spde" % "spde-sbt-plugin" % "0.4.1"
+ lazy val bnd4sbt = "com.weiglewilczek.bnd4sbt" % "bnd4sbt" % "1.0.0.RC4"
+ lazy val codeFellow = "de.tuxed" % "codefellow-plugin" % "0.3" // for code completion and more in VIM
+ lazy val spdeSbt = "us.technically.spde" % "spde-sbt-plugin" % "0.4.1"
}