diff --git a/README.md b/README.md
index f3d2b6e231..303b611346 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,12 @@
-akka-osgi-sample : Clustered DiningHakker
+akka-osgi-sample : Clustered DiningHakkers
================
-This project may be used to test akka bundles in OSGi Frameworks. The build tool (sbt for the moment) provide scripts to run in an OSGi Framework (Karaf only for the moment) a version of the DiningHakkers that runs on several nodes unsing the akka-cluster module.
+This project may be used to test akka bundles in OSGi Frameworks. The build tool (sbt for the moment) provide scripts to run in an OSGi Framework (Karaf only for the moment) a version of the DiningHakkers that runs on several nodes using the akka-cluster module.
## Bundle overview
This project provides three Osgi Bundles
- api providing an API for the Service exposed by the core and used by the command
- - core implementing the whole logic: clustered connections, Hakkers, ChopSticks. It finally provide an ActorRef of one created Hakker
+ - core implementing the whole logic: clustered connections, Hakkers, ChopSticks. Finally it provides an ActorRef of one created Hakker
- command use a service to get a Hakker (ActorRef) with its position around the table
An integration testing module is provided to verify OSGi functionality:
@@ -25,7 +25,7 @@ sbt clean
sbt package
sbt osgi-bundle
```
-sbt will creates the bundles in each subproject (api, command, core)/target/scala-2.10 directories. To have integration tests and OSGi environment loaded, please use the Maven build (at least for the moment)
+sbt will creates the bundles in each subproject akka-sample/akka-sample-osgi-dining-hakkers/(api, command, core)/target directories. To have integration tests and OSGi environment loaded, please use the Maven build (at least for the moment)
### Setup with Maven
```bash
mvn clean install
@@ -38,7 +38,7 @@ This can be extracted to any location, and bin/karaf executed. The provided kara
Extract the OSGi Framework from the tar.gz described above into any location, or run:
``./karaf.sh``
-Execute the framework by running bin ``/karaf`` from inside the extracted directory.
+Execute the framework by running ``bin/karaf`` from inside the extracted directory.
Then try to restart some bundles, to test the stability of the bundles:
@@ -46,4 +46,4 @@ Then try to restart some bundles, to test the stability of the bundles:
``restart #bundle_number`` to restart the bundle using its ID
``exit`` or CTRL-D to exit the Karaf console
-Depending on the akka version you're using, you may need to modify the core bundle when deploying on a second machine, to set it's akka.remote.netty.hostname in the application.conf.
+Depending on the akka version you're using, you may need to modify the core bundle when deploying on a second machine, to set its akka.remote.netty.hostname in the application.conf.
diff --git a/akka-osgi/src/main/scala/akka/osgi/ActorSystemActivator.scala b/akka-osgi/src/main/scala/akka/osgi/ActorSystemActivator.scala
index dfe55728aa..37fa8293e2 100644
--- a/akka-osgi/src/main/scala/akka/osgi/ActorSystemActivator.scala
+++ b/akka-osgi/src/main/scala/akka/osgi/ActorSystemActivator.scala
@@ -54,7 +54,8 @@ abstract class ActorSystemActivator extends BundleActivator {
val logServiceListner = new ServiceListener {
def serviceChanged(event: ServiceEvent) {
event.getType match {
- case ServiceEvent.REGISTERED ⇒ system.eventStream.publish(serviceForReference[LogService](context, event.getServiceReference))
+ case ServiceEvent.REGISTERED ⇒
+ system.eventStream.publish(serviceForReference[LogService](context, event.getServiceReference))
case ServiceEvent.UNREGISTERING ⇒ system.eventStream.publish(UnregisteringLogService)
}
}
diff --git a/api/pom.xml b/api/pom.xml
index 5f01624123..ead1a955ad 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- osgi-sample
- com.typesafe.akka
+ parent
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers
2.2.0-SNAPSHOT
4.0.0
diff --git a/api/src/main/scala/akka/osgi/sample/api/DiningHakkersMessages.scala b/api/src/main/scala/akka/osgi/sample/api/DiningHakkersMessages.scala
index c83ccac228..2fb5625f42 100644
--- a/api/src/main/scala/akka/osgi/sample/api/DiningHakkersMessages.scala
+++ b/api/src/main/scala/akka/osgi/sample/api/DiningHakkersMessages.scala
@@ -1,4 +1,7 @@
-package akka.osgi.sample.api
+/**
+ * Copyright (C) 2009-2013 Typesafe Inc. .
+ */
+package akka.sample.osgi.api
import akka.actor.ActorRef
diff --git a/assembly-dist/pom.xml b/assembly-dist/pom.xml
index d64a144d9b..8927186364 100644
--- a/assembly-dist/pom.xml
+++ b/assembly-dist/pom.xml
@@ -5,12 +5,11 @@
4.0.0
- com.typesafe.akka
- osgi-sample
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers
+ parent
2.2.0-SNAPSHOT
- com.typesafe.akka
assembly-dist
Dining Hakkers :: Distribution
@@ -55,7 +54,7 @@
mvn:org.apache.karaf.assemblies.features/standard/${karaf.version}/xml/features
mvn:org.apache.karaf.assemblies.features/enterprise/${karaf.version}/xml/features
- mvn:com.typesafe.akka/assembly-features/${project.version}/xml/features
+ mvn:com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers/assembly-features/${project.version}/xml/features
target/generated-features-repo
@@ -79,20 +78,6 @@
target/generated-features-repo
-
unpack
diff --git a/assembly-dist/src/main/descriptors/bin.xml b/assembly-dist/src/main/descriptors/bin.xml
index ef595a1b4d..cb15aa8e91 100644
--- a/assembly-dist/src/main/descriptors/bin.xml
+++ b/assembly-dist/src/main/descriptors/bin.xml
@@ -77,16 +77,9 @@
bin/**
+ unix
0755
-
diff --git a/assembly-features/pom.xml b/assembly-features/pom.xml
index fe08a18165..8501daca1b 100644
--- a/assembly-features/pom.xml
+++ b/assembly-features/pom.xml
@@ -5,12 +5,11 @@
4.0.0
- com.typesafe.akka
- osgi-sample
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers
+ parent
2.2.0-SNAPSHOT
- com.typesafe.akka
assembly-features
Dining Hakkers :: Features
pom
diff --git a/assembly-features/src/main/resources/features.xml b/assembly-features/src/main/resources/features.xml
index ea31066b21..3799c1d421 100644
--- a/assembly-features/src/main/resources/features.xml
+++ b/assembly-features/src/main/resources/features.xml
@@ -11,7 +11,7 @@
- mvn:com.typesafe.akka/uncommons/1.2.2
+ mvn:com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers/uncommons/1.2.2
@@ -40,8 +40,8 @@
akka
- mvn:com.typesafe.akka/api/${project.version}
- mvn:com.typesafe.akka/core/${project.version}
- mvn:com.typesafe.akka/command/${project.version}
+ mvn:com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers/api/${project.version}
+ mvn:com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers/core/${project.version}
+ mvn:com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers/command/${project.version}
diff --git a/command/pom.xml b/command/pom.xml
index 42c5a4b963..d8de23a7c1 100644
--- a/command/pom.xml
+++ b/command/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- osgi-sample
- com.typesafe.akka
+ parent
+ com.typesafe.akka.akka-sample.akka-sample-osgi
2.2.0-SNAPSHOT
4.0.0
@@ -38,7 +38,8 @@
maven-bundle-plugin
- akka.osgi.sample.command.Activator
+ akka.sample.osgi.command.Activator
+ *
diff --git a/core/pom.xml b/core/pom.xml
index 4e49595a39..daebda5b32 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- osgi-sample
- com.typesafe.akka
+ parent
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers
2.2.0-SNAPSHOT
4.0.0
diff --git a/core/src/main/resources/application.conf b/core/src/main/resources/application.conf
index 1b4600d742..1db639fc76 100644
--- a/core/src/main/resources/application.conf
+++ b/core/src/main/resources/application.conf
@@ -5,16 +5,14 @@ akka {
}
remote {
- transport = "akka.remote.netty.NettyRemoteTransport"
- log-remote-lifecycle-events = off
- netty {
+ netty.tcp {
hostname = "localhost"
- port = 2552
+ port = 4242
}
}
cluster {
- seed-nodes = ["akka://akka-osgi-sample@localhost:2552"]
+ seed-nodes = ["akka.tcp://akka-osgi-sample@localhost:4242"]
auto-down = on
}
diff --git a/core/src/main/scala/akka/osgi/sample/activation/Activator.scala b/core/src/main/scala/akka/osgi/sample/activation/Activator.scala
index 5de4746eac..a9102d3283 100644
--- a/core/src/main/scala/akka/osgi/sample/activation/Activator.scala
+++ b/core/src/main/scala/akka/osgi/sample/activation/Activator.scala
@@ -28,22 +28,28 @@ class Activator extends ActorSystemActivator {
import Activator._
- val services: ListBuffer[ServiceRegistration[_]] = ListBuffer()
+ var diningHakkerService: Option[ServiceRegistration[_]] = None
def configure(context: BundleContext, system: ActorSystem) {
val log = Logging(system, this)
log.info("Core bundle configured")
system.actorOf(Props[Table], "table")
+ registerService(context, system)
registerHakkersService(context, system)
- log.info("Hakker service registred")
+ log.info("Hakker service registered")
}
+ /**
+ * registers the DinningHakkerService as a Service to be tracked and find by other OSGi bundles.
+ * in other words, this instance may be used in other bundles which listen or track the OSGi Service
+ * @param context OSGi BundleContext
+ * @param system ActorSystem
+ */
def registerHakkersService(context: BundleContext, system: ActorSystem) {
val hakkersService = new DiningHakkersServiceImpl(system)
- services += context.registerService(classOf[DiningHakkersService], hakkersService, null)
- services += context.registerService(classOf[ActorSystem], system, null)
+ diningHakkerService = Some(context.registerService(classOf[DiningHakkersService], hakkersService, null))
}
@@ -54,7 +60,7 @@ class Activator extends ActorSystemActivator {
}
def unregisterServices(context: BundleContext) {
- services foreach (_.unregister())
+ diningHakkerService foreach (_.unregister())
}
override def getActorSystemName(context: BundleContext): String = "akka-osgi-sample"
diff --git a/core/src/main/scala/akka/osgi/sample/internal/Hakker.scala b/core/src/main/scala/akka/osgi/sample/internal/Hakker.scala
index 3fcad7a30e..6362951184 100644
--- a/core/src/main/scala/akka/osgi/sample/internal/Hakker.scala
+++ b/core/src/main/scala/akka/osgi/sample/internal/Hakker.scala
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2009-2010 Typesafe Inc. .
+ * Copyright (C) 2009-2013 Typesafe Inc. .
*/
package akka.osgi.sample.internal
diff --git a/integration-test/pom.xml b/integration-test/pom.xml
index 6e795793f6..48b910f017 100644
--- a/integration-test/pom.xml
+++ b/integration-test/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- osgi-sample
- com.typesafe.akka
+ parent
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers
2.2.0-SNAPSHOT
4.0.0
diff --git a/integration-test/src/test/scala/akka/osgi/sample/test/HakkerStatusTest.scala b/integration-test/src/test/scala/akka/osgi/sample/test/HakkerStatusTest.scala
index f9b0786899..28f3ed9d44 100644
--- a/integration-test/src/test/scala/akka/osgi/sample/test/HakkerStatusTest.scala
+++ b/integration-test/src/test/scala/akka/osgi/sample/test/HakkerStatusTest.scala
@@ -48,12 +48,12 @@ class HakkerStatusTest extends JUnitSuite with ShouldMatchersForJUnit {
)
// Junit @Before and @After can be used as well
-/*
- @Before
+
+/* @Before
def setupAkkaTestkit() {
testProbe = new TestProbe(actorSystem)
- }
-*/
+ }*/
+
@Test
def verifyObtainingAHakkerViaTheTheDiningHakkersService() {
@@ -65,17 +65,22 @@ class HakkerStatusTest extends JUnitSuite with ShouldMatchersForJUnit {
hakker should not be (null)
/* TODO Getting some weird config error with TestProbe, is it a TestProbe inside OSGi issue?
+ Exception in thread "RMI TCP Connection(idle)" java.lang.NullPointerException
+ at com.typesafe.config.impl.SerializedConfigValue.writeOrigin(SerializedConfigValue.java:202)
+ at com.typesafe.config.impl.ConfigImplUtil.writeOrigin(ConfigImplUtil.java:224)
+ at com.typesafe.config.ConfigException.writeObject(ConfigException.java:58)
+ at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
+
java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.readUnsignedByte(ObjectInputStream.java:2747)
at java.io.ObjectInputStream.readUnsignedByte(ObjectInputStream.java:924)
at com.typesafe.config.impl.SerializedConfigValue.readCode(SerializedConfigValue.java:412)
at com.typesafe.config.impl.SerializedConfigValue.readOrigin(SerializedConfigValue.java:218)
...
-
testProbe.send(hakker, Identify)
val identification = testProbe.expectMsgClass(classOf[Identification])
val (fromHakker, busyWith) = (identification.name, identification.busyWith)
-*/
+ */
// create an "Interrogator" actor that receives a Hakker's identification
// this is to work around the TestProbe Exception above
diff --git a/integration-test/src/test/scala/akka/osgi/sample/test/TestOptions.scala b/integration-test/src/test/scala/akka/osgi/sample/test/TestOptions.scala
index b3e7880fbd..669bb33ec9 100644
--- a/integration-test/src/test/scala/akka/osgi/sample/test/TestOptions.scala
+++ b/integration-test/src/test/scala/akka/osgi/sample/test/TestOptions.scala
@@ -53,7 +53,7 @@ object TestOptions {
}
def akkaFeature(feature: String): PaxOption = {
- scanFeatures(maven.groupId("com.typesafe.akka").artifactId("assembly-features").`type`("xml").classifier("features")
+ scanFeatures(maven.groupId("com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers").artifactId("assembly-features").`type`("xml").classifier("features")
.version(System.getProperty("project.version")), feature)
}
diff --git a/pom.xml b/pom.xml
index a2a425baeb..37be7303a8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- com.typesafe.akka
- osgi-sample
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers
+ parent
2.2.0-SNAPSHOT
@@ -33,7 +33,7 @@
integration-test
pom
- com.typesafe.akka.akka-osgi.sample
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers.sample
diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala
index 14e77d1ed1..1716d7c213 100644
--- a/project/AkkaBuild.scala
+++ b/project/AkkaBuild.scala
@@ -357,7 +357,7 @@ object AkkaBuild extends Build {
id = "akka-samples",
base = file("akka-samples"),
settings = parentSettings,
- aggregate = Seq(camelSample, fsmSample, helloSample, helloKernelSample, remoteSample, clusterSample, multiNodeSample)
+ aggregate = Seq(camelSample, fsmSample, helloSample, helloKernelSample, remoteSample, clusterSample, multiNodeSample, osgiDiningHakkersSample)
)
lazy val camelSample = Project(
@@ -427,6 +427,45 @@ object AkkaBuild extends Build {
)
) configs (MultiJvm)
+ lazy val osgiDiningHakkersSample = Project(id = "akka-sample-osgi-dining-hakkers",
+ base = file("akka-samples/akka-sample-osgi-dining-hakkers"),
+ settings = sampleSettings ++ Seq(
+ test in Test ~= { x => {
+ if({List("sh", "-c", "which mvn") !} != 0 ) {throw new Exception("Maven is not installed or not in the $PATH")}
+ if({List("sh", "-c", "cd akka-samples/akka-sample-osgi-dining-hakkers; mvn clean install") !} != 0 ) {throw new Exception("Osgi sample Dining hakkers failed")}
+ } }
+ )
+ ) aggregate(osgiDiningHakkersSampleApi, osgiDiningHakkersSampleCommand, osgiDiningHakkersSampleCore, uncommons)
+
+ lazy val osgiDiningHakkersSampleApi = Project(id = "akka-sample-osgi-dining-hakkers-api",
+ base = file("akka-samples/akka-sample-osgi-dining-hakkers/api"),
+ settings = sampleSettings ++ OSGi.osgiDiningHakkersSampleApi
+ )dependsOn(actor)
+
+ lazy val osgiDiningHakkersSampleCommand = Project(id = "akka-sample-osgi-dining-hakkers-command",
+ base = file("akka-samples/akka-sample-osgi-dining-hakkers/command"),
+ settings = sampleSettings ++ OSGi.osgiDiningHakkersSampleCommand ++ Seq(
+ libraryDependencies ++= Dependencies.osgiDiningHakkerSampleCommand
+ )
+ ) dependsOn (osgiDiningHakkersSampleApi, actor)
+
+
+ lazy val osgiDiningHakkersSampleCore = Project(id = "akka-sample-osgi-dining-hakkers-core",
+ base = file("akka-samples/akka-sample-osgi-dining-hakkers/core"),
+ settings = sampleSettings ++ OSGi.osgiDiningHakkersSampleCore ++ Seq(
+ libraryDependencies ++= Dependencies.osgiDiningHakkerSampleCore
+ )
+ ) dependsOn (osgiDiningHakkersSampleApi, actor, remote, cluster, osgi)
+
+ //TODO to remove it as soon as the uncommons gets OSGified, see ticket #2990
+ lazy val uncommons = Project(id = "akka-sample-osgi-dining-hakkers-uncommons",
+ base = file("akka-samples/akka-sample-osgi-dining-hakkers//uncommons"),
+ settings = sampleSettings ++ OSGi.osgiDiningHakkersSampleUncommons ++ Seq(
+ libraryDependencies ++= Dependencies.uncommons,
+ version := "1.2.2"
+ )
+ )
+
lazy val docs = Project(
id = "akka-docs",
base = file("akka-docs"),
@@ -800,6 +839,14 @@ object AkkaBuild extends Build {
OsgiKeys.importPackage := (osgiOptionalImports map optionalResolution) ++ Seq("!sun.misc", scalaImport(),configImport(), "*")
)
+ val osgiDiningHakkersSampleApi = exports(Seq("akka.sample.osgi.api"))
+
+ val osgiDiningHakkersSampleCommand = osgiSettings ++ Seq(OsgiKeys.bundleActivator := Option("akka.sample.osgi.command.Activator"), OsgiKeys.privatePackage := Seq("akka.sample.osgi.command"))
+
+ val osgiDiningHakkersSampleCore = exports(Seq("")) ++ Seq(OsgiKeys.bundleActivator := Option("akka.sample.osgi.activation.Activator"), OsgiKeys.privatePackage := Seq("akka.sample.osgi.internal", "akka.sample.osgi.activation", "akka.sample.osgi.service"))
+
+ val osgiDiningHakkersSampleUncommons = exports(Seq("org.uncommons.maths.random")) ++ Seq(OsgiKeys.privatePackage := Seq("org.uncommons.maths.binary", "org.uncommons.maths", "org.uncommons.maths.number"))
+
val osgiAries = exports() ++ Seq(OsgiKeys.privatePackage := Seq("akka.osgi.aries.*"))
val remote = exports(Seq("akka.remote.*"), imports = Seq(protobufImport()))
@@ -870,8 +917,8 @@ object Dependencies {
// Camel Sample
val camelJetty = "org.apache.camel" % "camel-jetty" % camelCore.revision // ApacheV2
- // Cluster Sample
- val sigar = "org.fusesource" % "sigar" % "1.6.4" // ApacheV2
+ // Cluster Sample //TODO check for fusesource
+ val sigar = "org.hyperic" % "sigar" % "1.6.4" // ApacheV2
// Test
@@ -925,7 +972,13 @@ object Dependencies {
val osgi = Seq(osgiCore, osgiCompendium, Test.logback, Test.commonsIo, Test.pojosr, Test.tinybundles, Test.scalatest, Test.junit)
- val osgiAries = Seq(osgiCore, ariesBlueprint, Test.ariesProxy)
+ val osgiDiningHakkerSampleCore = Seq(config, osgiCore, osgiCompendium)
+
+ val osgiDiningHakkerSampleCommand = Seq(osgiCore, osgiCompendium)
+
+ val uncommons = Seq(uncommonsMath)
+
+ val osgiAries = Seq(osgiCore, osgiCompendium, ariesBlueprint, Test.ariesProxy)
val docs = Seq(Test.scalatest, Test.junit, Test.junitIntf)
diff --git a/project/Build.scala b/project/Build.scala
deleted file mode 100644
index 1dc9c52e4e..0000000000
--- a/project/Build.scala
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
-Copyright 2013 Crossing-Tech
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
- limitations under the License.
- */
-import sbt._
-import Keys._
-import com.typesafe.sbt.osgi.SbtOsgi.{OsgiKeys, osgiSettings}
-
-
-object OsgiSampleBuild extends Build {
-
- override lazy val settings =
- super.settings ++
- buildSettings ++
- Seq(
- shellPrompt := {
- s => Project.extract(s).currentProject.id + " > "
- }
- )
-
- lazy val buildSettings = Seq(
- scalaVersion := "2.10.0",
- resolvers ++= Seq("oss-sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases",
- "JBoss Repo" at "http://repository.jboss.org/nexus/content/groups/public/",
- "Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases/"),
- version := "2.2.0-SNAPSHOT"
- )
-
-
- lazy val root = Project(id = "osgi-sample",
- base = file("."),
- settings = Project.defaultSettings ++ Seq(
- libraryDependencies ++= Seq()
- )
- ) aggregate(api, command, core, uncommons)
-
- lazy val api = Project(id = "api",
- base = file("./api"),
- settings = Project.defaultSettings ++ exports(Seq("akka.osgi.sample.api")) ++ Seq(libraryDependencies ++= Seq(Dependencies.akka_actor))
- )
-
- lazy val command = Project(id = "command",
- base = file("./command"),
- settings = Project.defaultSettings ++ exports(Seq("akka.osgi.sample.command"), Seq("akka.osgi.sample.api", "org.osgi.framework")) ++ Seq(
- libraryDependencies ++= Dependencies.command,
- OsgiKeys.bundleActivator := Option("akka.osgi.sample.command.Activator")
- )
- ) dependsOn (api)
-
-
- lazy val core = Project(id = "core",
- base = file("./core"),
- settings = Project.defaultSettings ++ exports(Seq("akka.osgi.sample.service", "akka.osgi.sample.activation"), defaultImports, Seq("akka.osgi.sample.internal")) ++ Seq(
- libraryDependencies ++= Dependencies.core,
- OsgiKeys.bundleActivator := Option("akka.osgi.sample.activation.Activator")
- )
- ) dependsOn (api)
-
- lazy val uncommons = Project(id = "uncommons",
- base = file("./uncommons"),
- settings = Project.defaultSettings ++ exports(Seq("org.uncommons.maths.random"), privates = Seq("org.uncommons.maths.binary", "org.uncommons.maths", "org.uncommons.maths.number")) ++ Seq(
- libraryDependencies ++= Dependencies.uncommons,
- version := "1.2.2"
- )
- )
-
- def exports(packages: Seq[String] = Seq(), imports: Seq[String] = Nil, privates: Seq[String] = Nil) = osgiSettings ++ Seq(
- OsgiKeys.importPackage := imports ++ Seq("*"),
- OsgiKeys.privatePackage := privates,
- OsgiKeys.exportPackage := packages
- )
-
- def copyFile(source: String, sink: String){
- val src = new java.io.File(source)
- val dest = new java.io.File(sink)
- new java.io.FileOutputStream(dest) getChannel() transferFrom(
- new java.io.FileInputStream(src) getChannel, 0, Long.MaxValue )
- }
-
-
- def defaultImports = Seq("!sun.misc", akkaImport(), configImport(), scalaImport())
-
- def akkaImport(packageName: String = "akka.*") = "%s;version=\"[2.2,2.3)\"".format(packageName)
-
- def configImport(packageName: String = "com.typesafe.config.*") = "%s;version=\"[0.4.1,1.1.0)\"".format(packageName)
-
- def protobufImport(packageName: String = "com.google.protobuf.*") = "%s;version=\"[2.4.0,2.5.0)\"".format(packageName)
-
- def scalaImport(packageName: String = "scala.*") = "%s;version=\"[2.10,2.11)\"".format(packageName)
-
-}
-
-object Dependencies {
- val akka_actor = "com.typesafe.akka" % "akka-actor_2.10" % "2.2-SNAPSHOT"
- val akka_osgi = "com.typesafe.akka" % "akka-osgi_2.10" % "2.2-SNAPSHOT" exclude("org.osgi.core", "org.osgi.compendium")
- val akka_remote = "com.typesafe.akka" % "akka-remote_2.10" % "2.2-SNAPSHOT"
- val akka_cluster = "com.typesafe.akka" % "akka-cluster-experimental_2.10" % "2.2-SNAPSHOT"
- val config = "com.typesafe" % "config" % "1.0.0"
-
- val osgiCore = "org.osgi" % "org.osgi.core" % "4.3.0"
- val osgiCompendium = "org.osgi" % "org.osgi.compendium" % "4.3.0"
- val core = Seq(akka_actor, akka_osgi, akka_remote, akka_cluster, config, osgiCore, osgiCompendium)
- val command = Seq(akka_actor, osgiCore, osgiCompendium)
-
- val uncommons_math = "org.uncommons.maths" % "uncommons-maths" % "1.2.2"
- val jcommon = "jfree" % "jcommon" % "1.0.16"
- val jfreechart = "jfree" % "jfreechart" % "1.0.13"
- val uncommons = Seq(uncommons_math, jcommon, jfreechart)
-
- val protobuf = "com.google.protobuf" % "protobuf-java" % "2.4.1"
-
-}
-
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 72e24c5b2c..ba3f4b7f33 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -8,7 +8,7 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-multi-jvm" % "0.3.5")
addSbtPlugin("com.typesafe.sbt" % "sbt-scalariform" % "1.0.0")
-addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.0-M1")
+addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.6.2")
addSbtPlugin("com.typesafe.sbtosgi" % "sbtosgi" % "0.3.0")
diff --git a/uncommons/pom.xml b/uncommons/pom.xml
index d6c01f6baa..959cbe1e1d 100644
--- a/uncommons/pom.xml
+++ b/uncommons/pom.xml
@@ -3,8 +3,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- osgi-sample
- com.typesafe.akka
+ parent
+ com.typesafe.akka.akka-sample.akka-sample-osgi-dining-hakkers
2.2.0-SNAPSHOT
4.0.0
@@ -12,6 +12,7 @@
uncommons