Merge branch '31-hseeberger'

This commit is contained in:
Heiko Seeberger 2010-07-21 07:50:38 +02:00
commit aae9506eb8
7 changed files with 440 additions and 21 deletions

127
akka-core/pom.xml Normal file
View file

@ -0,0 +1,127 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>akka-core</artifactId>
<name>Akka Core - Actors, Remote Actors, Transactors and STM Module</name>
<packaging>jar</packaging>
<parent>
<artifactId>akka</artifactId>
<groupId>se.scalablesolutions.akka</groupId>
<version>0.7-SNAPSHOT</version>
</parent>
<!-- Core deps -->
<dependencies>
<dependency>
<artifactId>akka-util-java</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<artifactId>akka-util</artifactId>
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.aspectwerkz</groupId>
<artifactId>aspectwerkz-nodeps-jdk5</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.aspectwerkz</groupId>
<artifactId>aspectwerkz-jdk5</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.jboss.netty</groupId>
<artifactId>netty</artifactId>
<version>3.2.0.ALPHA3</version>
</dependency>
<dependency>
<groupId>org.scala-tools</groupId>
<artifactId>javautils</artifactId>
<version>2.7.4-0.1</version>
</dependency>
<!-- For Protocol/Serialization -->
<dependency>
<groupId>voldemort.store.compress</groupId>
<artifactId>h2-lzf</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>sbinary</groupId>
<artifactId>sbinary</artifactId>
<version>0.3</version>
</dependency>
<dependency>
<groupId>net.databinder</groupId>
<artifactId>dispatch-json_2.7.7</artifactId>
<version>0.6.4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>net.databinder</groupId>
<artifactId>dispatch-http_2.7.7</artifactId>
<version>0.6.4</version>
</dependency>
<dependency>
<groupId>sjson.json</groupId>
<artifactId>sjson</artifactId>
<version>0.4</version>
</dependency>
<!-- For Testing -->
<dependency>
<groupId>org.scalatest</groupId>
<artifactId>scalatest</artifactId>
<version>1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Export-Package>
se.scalablesolutions.akka.*;version=${project.version};-split-package:=merge-first
</Export-Package>
</instructions>
</configuration>
</plugin>
</plugins>
</build>
</project>

View file

@ -0,0 +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

@ -0,0 +1,24 @@
/**
* Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se>
*/
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")
}
}

View file

@ -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)
}
}

View file

@ -2,21 +2,21 @@
| Copyright (C) 2009-2010 Scalable Solutions AB <http://scalablesolutions.se> |
\---------------------------------------------------------------------------*/
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))
}
}

View file

@ -0,0 +1,88 @@
/*---------------------------------------------------------------------------\
| 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 = 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("*")
}
}

View file

@ -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"
}