Skip to content

Commit

Permalink
Merge pull request akka#17549 from akka/wip-crosscompile-2.12-∂π
Browse files Browse the repository at this point in the history
add crosscompilation for 2.12.0-M1
  • Loading branch information
rkuhn committed May 22, 2015
2 parents 53c5d97 + 5dc25fb commit 3fad95b
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 84 deletions.
2 changes: 1 addition & 1 deletion akka-actor-tests/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ Unidoc.scaladocSettings

publishArtifact in Compile := false

libraryDependencies ++= Dependencies.actorTests
Dependencies.actorTests
2 changes: 1 addition & 1 deletion akka-actor/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unidoc.javadocSettings

OSGi.actor

libraryDependencies ++= Dependencies.actor
Dependencies.actor

MimaKeys.previousArtifact := akkaPreviousArtifact("akka-actor").value

Expand Down
2 changes: 1 addition & 1 deletion akka-agent/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Unidoc.javadocSettings

OSGi.agent

libraryDependencies ++= Dependencies.agent
Dependencies.agent

MimaKeys.previousArtifact := akkaPreviousArtifact("akka-agent").value
2 changes: 1 addition & 1 deletion akka-camel/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Unidoc.javadocSettings

OSGi.camel

libraryDependencies ++= Dependencies.camel
Dependencies.camel

MimaKeys.previousArtifact := akkaPreviousArtifact("akka-camel").value
2 changes: 1 addition & 1 deletion akka-cluster-metrics/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SigarLoader.sigarSettings

OSGi.clusterMetrics

libraryDependencies ++= Dependencies.clusterMetrics
Dependencies.clusterMetrics

//MimaKeys.previousArtifact := akkaPreviousArtifact("akka-cluster-metrics").value

Expand Down
2 changes: 1 addition & 1 deletion akka-cluster-sharding/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ OSGi.clusterSharding

MultiNode.multiJvmSettings

libraryDependencies ++= Dependencies.clusterSharding
Dependencies.clusterSharding

//MimaKeys.previousArtifact := akkaPreviousArtifact("akka-cluster-sharding").value
2 changes: 1 addition & 1 deletion akka-cluster-tools/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ OSGi.clusterTools

MultiNode.multiJvmSettings

libraryDependencies ++= Dependencies.clusterTools
Dependencies.clusterTools

//MimaKeys.previousArtifact := akkaPreviousArtifact("akka-cluster-tools").value
2 changes: 1 addition & 1 deletion akka-cluster/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ MultiNode.multiJvmSettings

OSGi.cluster

libraryDependencies ++= Dependencies.cluster
Dependencies.cluster

MimaKeys.previousArtifact := akkaPreviousArtifact("akka-cluster").value

Expand Down
2 changes: 1 addition & 1 deletion akka-contrib/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unidoc.javadocSettings

MultiNode.multiJvmSettings

libraryDependencies ++= Dependencies.contrib
Dependencies.contrib

MimaKeys.reportBinaryIssues := () // disable bin comp check

Expand Down
2 changes: 1 addition & 1 deletion akka-docs/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ SphinxDoc.sphinxPreprocessing

SphinxDoc.docsSettings

libraryDependencies ++= Dependencies.docs
Dependencies.docs

publishArtifact in Compile := false

Expand Down
2 changes: 1 addition & 1 deletion akka-kernel/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ Unidoc.scaladocSettingsNoVerificationOfDiagrams

Unidoc.javadocSettings

libraryDependencies ++= Dependencies.kernel
Dependencies.kernel

MimaKeys.previousArtifact := akkaPreviousArtifact("akka-kernel").value
2 changes: 1 addition & 1 deletion akka-osgi/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unidoc.javadocSettings

OSGi.osgi

libraryDependencies ++= Dependencies.osgi
Dependencies.osgi

parallelExecution in Test := false

Expand Down
2 changes: 1 addition & 1 deletion akka-persistence-tck/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Unidoc.javadocSettings

// OSGi.persistenceTck TODO: we do need to export this as OSGi bundle too?

libraryDependencies ++= Dependencies.persistenceTck
Dependencies.persistenceTck

MimaKeys.previousArtifact := None

Expand Down
2 changes: 1 addition & 1 deletion akka-remote/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unidoc.javadocSettings

OSGi.remote

libraryDependencies ++= Dependencies.remote
Dependencies.remote

parallelExecution in Test := false

Expand Down
2 changes: 1 addition & 1 deletion akka-slf4j/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ Unidoc.javadocSettings

OSGi.slf4j

libraryDependencies ++= Dependencies.slf4j
Dependencies.slf4j

MimaKeys.previousArtifact := akkaPreviousArtifact("akka-slf4j").value
2 changes: 1 addition & 1 deletion akka-testkit/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Unidoc.javadocSettings
OSGi.testkit

// to fix scaladoc generation
libraryDependencies ++= Dependencies.testkit
Dependencies.testkit

initialCommands += "import akka.testkit._"

Expand Down
4 changes: 2 additions & 2 deletions akka-typed/src/main/scala/akka/typed/ActorRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import language.implicitConversions
* [[akka.event.EventStream]] on a best effort basis
* (i.e. this delivery is not reliable).
*/
abstract class ActorRef[-T] extends java.lang.Comparable[ActorRef[_]] { this: ScalaActorRef[T]
abstract class ActorRef[-T] extends java.lang.Comparable[ActorRef[Any]] { this: ScalaActorRef[T]
/**
* INTERNAL API.
*
Expand Down Expand Up @@ -52,7 +52,7 @@ abstract class ActorRef[-T] extends java.lang.Comparable[ActorRef[_]] { this: Sc
case _ false
}
override def hashCode = untypedRef.hashCode
override def compareTo(other: ActorRef[_]) = untypedRef.compareTo(other.untypedRef)
override def compareTo(other: ActorRef[Any]) = untypedRef.compareTo(other.untypedRef)
}

/**
Expand Down
6 changes: 2 additions & 4 deletions project/AkkaBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ object AkkaBuild extends Build {

val parallelExecutionByDefault = false // TODO: enable this once we're sure it doesn not break things

lazy val buildSettings = Seq(
lazy val buildSettings = Dependencies.Versions ++ Seq(
organization := "com.typesafe.akka",
version := "2.4-SNAPSHOT",
scalaVersion := Dependencies.Versions.scalaVersion,
crossScalaVersions := Dependencies.Versions.crossScala
version := "2.4-SNAPSHOT"
)

lazy val root = Project(
Expand Down
91 changes: 33 additions & 58 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
package akka

import sbt._
import Keys._

object Dependencies {

import DependencyHelpers._
import DependencyHelpers.ScalaVersionDependentModuleID._
lazy val scalaTestVersion = settingKey[String]("The version of ScalaTest to use.")
lazy val scalaStmVersion = settingKey[String]("The version of ScalaSTM to use.")
lazy val scalaCheckVersion = settingKey[String]("The version of ScalaCheck to use.")

object Versions {
val crossScala = Seq("2.11.6")
val scalaVersion = crossScala.head
val scalaStmVersion = sys.props.get("akka.build.scalaStmVersion").getOrElse("0.7")
val scalaTestVersion = sys.props.get("akka.build.scalaTestVersion").getOrElse("2.2.4")
val scalaCheckVersion = sys.props.get("akka.build.scalaCheckVersion").getOrElse("1.11.6")
}
val Versions = Seq(
crossScalaVersions := Seq("2.11.6", "2.12.0-M1"),
scalaVersion := crossScalaVersions.value.head,
scalaStmVersion := sys.props.get("akka.build.scalaStmVersion").getOrElse("0.7"),
scalaCheckVersion := sys.props.get("akka.build.scalaCheckVersion").getOrElse("1.11.6"),
scalaTestVersion := (if (scalaVersion.value == "2.12.0-M1") "2.2.5-M1" else "2.2.4")
)

object Compile {
import Versions._

// Compile
val camelCore = "org.apache.camel" % "camel-core" % "2.13.4" exclude("org.slf4j", "slf4j-api") // ApacheV2

// when updating config version, update links ActorSystem ScalaDoc to link to the updated version
val config = "com.typesafe" % "config" % "1.3.0" // ApacheV2
val netty = "io.netty" % "netty" % "3.10.3.Final" // ApacheV2
val protobuf = "com.google.protobuf" % "protobuf-java" % "2.5.0" // New BSD
val scalaStm = "org.scala-stm" %% "scala-stm" % scalaStmVersion // Modified BSD (Scala)
val scalaStm = Def.setting { "org.scala-stm" %% "scala-stm" % scalaStmVersion.value } // Modified BSD (Scala)

val slf4jApi = "org.slf4j" % "slf4j-api" % "1.7.12" // MIT
// mirrored in OSGi sample
Expand All @@ -44,8 +44,8 @@ object Dependencies {
val logback = "ch.qos.logback" % "logback-classic" % "1.1.3" % "test" // EPL 1.0 / LGPL 2.1
val mockito = "org.mockito" % "mockito-all" % "1.10.19" % "test" // MIT
// changing the scalatest dependency must be reflected in akka-docs/rst/dev/multi-jvm-testing.rst
val scalatest = "org.scalatest" %% "scalatest" % scalaTestVersion % "test" // ApacheV2
val scalacheck = "org.scalacheck" %% "scalacheck" % scalaCheckVersion % "test" // New BSD
val scalatest = Def.setting { "org.scalatest" %% "scalatest" % scalaTestVersion.value % "test" } // ApacheV2
val scalacheck = Def.setting { "org.scalacheck" %% "scalacheck" % scalaCheckVersion.value % "test" } // New BSD
val pojosr = "com.googlecode.pojosr" % "de.kalpatec.pojosr.framework" % "0.2.1" % "test" // ApacheV2
val tinybundles = "org.ops4j.pax.tinybundles" % "tinybundles" % "1.0.0" % "test" // ApacheV2
val log4j = "log4j" % "log4j" % "1.2.14" % "test" // ApacheV2
Expand Down Expand Up @@ -75,66 +75,41 @@ object Dependencies {
}

import Compile._
val l = libraryDependencies

val actor = Seq(config)
val actor = l ++= Seq(config)

val testkit = Seq(Test.junit, Test.scalatest) ++ Test.metricsAll
val testkit = l ++= Seq(Test.junit, Test.scalatest.value) ++ Test.metricsAll

val actorTests = Seq(Test.junit, Test.scalatest, Test.commonsCodec, Test.commonsMath, Test.mockito, Test.scalacheck, protobuf, Test.junitIntf)
val actorTests = l ++= Seq(Test.junit, Test.scalatest.value, Test.commonsCodec, Test.commonsMath, Test.mockito, Test.scalacheck.value, protobuf, Test.junitIntf)

val remote = Seq(netty, protobuf, uncommonsMath, Test.junit, Test.scalatest)
val remote = l ++= Seq(netty, protobuf, uncommonsMath, Test.junit, Test.scalatest.value)

val remoteTests = deps(Test.junit, Test.scalatest, Test.scalaXml)
val remoteTests = l ++= Seq(Test.junit, Test.scalatest.value, Test.scalaXml)

val cluster = Seq(Test.junit, Test.scalatest)
val cluster = l ++= Seq(Test.junit, Test.scalatest.value)

val clusterTools = Seq(Test.junit, Test.scalatest)
val clusterTools = l ++= Seq(Test.junit, Test.scalatest.value)

val clusterSharding = Seq(Test.junit, Test.scalatest, Test.commonsIo)

val clusterMetrics = Seq(Provided.sigarLoader, Test.slf4jJul, Test.slf4jLog4j, Test.logback, Test.mockito)

val slf4j = Seq(slf4jApi, Test.logback)

val agent = Seq(scalaStm, Test.scalatest, Test.junit)

val persistence = deps(protobuf, Provided.levelDB, Provided.levelDBNative, Test.scalatest, Test.junit, Test.commonsIo, Test.scalaXml)
val clusterSharding = l ++= Seq(Test.junit, Test.scalatest.value, Test.commonsIo)

val persistenceTck = Seq(Test.scalatest.copy(configurations = Some("compile")), Test.junit.copy(configurations = Some("compile")))
val clusterMetrics = l ++= Seq(Provided.sigarLoader, Test.slf4jJul, Test.slf4jLog4j, Test.logback, Test.mockito)

val kernel = Seq(Test.scalatest, Test.junit)
val slf4j = l ++= Seq(slf4jApi, Test.logback)

val camel = Seq(camelCore, Test.scalatest, Test.junit, Test.mockito, Test.logback, Test.commonsIo, Test.junitIntf)
val agent = l ++= Seq(scalaStm.value, Test.scalatest.value, Test.junit)

val osgi = Seq(osgiCore, osgiCompendium, Test.logback, Test.commonsIo, Test.pojosr, Test.tinybundles, Test.scalatest, Test.junit)
val persistence = l ++= Seq(protobuf, Provided.levelDB, Provided.levelDBNative, Test.scalatest.value, Test.junit, Test.commonsIo, Test.scalaXml)

val docs = Seq(Test.scalatest, Test.junit, Test.junitIntf)
val persistenceTck = l ++= Seq(Test.scalatest.value.copy(configurations = Some("compile")), Test.junit.copy(configurations = Some("compile")))

val contrib = Seq(Test.junitIntf, Test.commonsIo)
}

object DependencyHelpers {

import sbt.Keys._
val kernel = l ++= Seq(Test.scalatest.value, Test.junit)

case class ScalaVersionDependentModuleID(val modules: String => Seq[ModuleID]) {
def %(config: String): ScalaVersionDependentModuleID =
ScalaVersionDependentModuleID(version => modules(version).map(_ % config))
}

object ScalaVersionDependentModuleID {
implicit def liftConstantModule(mod: ModuleID): ScalaVersionDependentModuleID =
ScalaVersionDependentModuleID(_ => Seq(mod))
val camel = l ++= Seq(camelCore, Test.scalatest.value, Test.junit, Test.mockito, Test.logback, Test.commonsIo, Test.junitIntf)

def fromPF(f: PartialFunction[String, ModuleID]): ScalaVersionDependentModuleID =
ScalaVersionDependentModuleID(version => if (f.isDefinedAt(version)) Seq(f(version)) else Nil)
val osgi = l ++= Seq(osgiCore, osgiCompendium, Test.logback, Test.commonsIo, Test.pojosr, Test.tinybundles, Test.scalatest.value, Test.junit)

}
val docs = l ++= Seq(Test.scalatest.value, Test.junit, Test.junitIntf)

/**
* Use this as a dependency setting if the dependencies contain both static and Scala-version
* dependent entries.
*/
def deps(modules: ScalaVersionDependentModuleID*) =
libraryDependencies <++= scalaVersion(version => modules.flatMap(m => m.modules(version)))
val contrib = l ++= Seq(Test.junitIntf, Test.commonsIo)
}
13 changes: 9 additions & 4 deletions project/MultiNode.scala
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,15 @@ object MultiNode {
(if (onlyTestTags.value.isEmpty) Seq.empty else Seq("-n", if (multiNodeEnabled) onlyTestTags.value.mkString("\"", " ", "\"") else onlyTestTags.value.mkString(" ")))
}

lazy val multiJvmSettings = SbtMultiJvm.multiJvmSettings ++ inConfig(MultiJvm)(SbtScalariform.configScalariformSettings) ++ Seq(
jvmOptions in MultiJvm := defaultMultiJvmOptions,
compileInputs in(MultiJvm, compile) <<= (compileInputs in(MultiJvm, compile)) dependsOn (ScalariformKeys.format in MultiJvm),
compile in MultiJvm <<= (compile in MultiJvm) triggeredBy (compile in Test)) ++
lazy val multiJvmSettings =
SbtMultiJvm.multiJvmSettings ++
inConfig(MultiJvm)(SbtScalariform.configScalariformSettings) ++
Seq(
jvmOptions in MultiJvm := defaultMultiJvmOptions,
compileInputs in(MultiJvm, compile) <<= (compileInputs in(MultiJvm, compile)) dependsOn (ScalariformKeys.format in MultiJvm),
scalacOptions in MultiJvm <<= scalacOptions in Test,
compile in MultiJvm <<= (compile in MultiJvm) triggeredBy (compile in Test)
) ++
Option(System.getProperty("akka.test.multi-node.hostsFileName")).map(x => Seq(multiNodeHostsFileName in MultiJvm := x)).getOrElse(Seq.empty) ++
Option(System.getProperty("akka.test.multi-node.java")).map(x => Seq(multiNodeJavaName in MultiJvm := x)).getOrElse(Seq.empty) ++
Option(System.getProperty("akka.test.multi-node.targetDirName")).map(x => Seq(multiNodeTargetDirName in MultiJvm := x)).getOrElse(Seq.empty) ++
Expand Down

0 comments on commit 3fad95b

Please sign in to comment.