pekko/project/Build.scala
Raman Gupta c02c071170 Added Pax Exam based in-container integration test
New module integration-test that contains integration tests. Created an
initial test that obtains a reference to the DiningHakkerService, creates
a dining Hakker, and then interrogates its name and current state.

The dining Hakker messages were moved to the API bundle, so that the
integration test has access to them without seeing the implementation
classes in core.

The test is run via the standard "mvn install" command.

Update Maven scala plugin to 3.1.2

Update to Akka 2.2-SNAPSHOT (failing integration test)

- Netty was updated to 3.6.2.Final (at least 3.6.0 is required by
akka-remote)

- Removed the temporary import on akka.remote.netty in core

- Removed the temporary settings in application.conf

- Changed references to akka-actor to akka-osgi

Conflicts:

	core/src/main/resources/application.conf

Add karaf tar.gz/zip as deps to avoid pax exam download

Add an example of a Karaf cfg to only access jars locally

Conflicts:

	project/Build.scala
2013-03-01 20:05:24 +01:00

124 lines
4.8 KiB
Scala

/*
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"
}