Skip to content
This repository has been archived by the owner on Jun 1, 2021. It is now read-only.

Commit

Permalink
Multi-module project
Browse files Browse the repository at this point in the history
- closes #169
  • Loading branch information
krasserm committed Mar 11, 2016
1 parent c95ed9c commit 2e97ed2
Show file tree
Hide file tree
Showing 253 changed files with 1,729 additions and 4,353 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ before_script:
- pip install --user sphinx
- pip install --user sphinx_rtd_theme
script:
- .travis/test.sh ++$TRAVIS_SCALA_VERSION
- .travis/test-it.sh ++$TRAVIS_SCALA_VERSION
- .travis/test-multi.sh ++$TRAVIS_SCALA_VERSION
- .travis/test-core.sh ++$TRAVIS_SCALA_VERSION
- .travis/test-leveldb.sh ++$TRAVIS_SCALA_VERSION
- .travis/test-crdt.sh ++$TRAVIS_SCALA_VERSION
- find $HOME/.sbt -name "*.lock" | xargs rm
- find $HOME/.ivy2 -name "ivydata-*.properties" | xargs rm
after_success:
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ]; then sbt ++$TRAVIS_SCALA_VERSION publish ghpagesPushSite; fi
scala:
- 2.11.4
- 2.11.7
jdk:
- oraclejdk8
3 changes: 3 additions & 0 deletions .travis/test-core.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

sbt $1 "core/test"
3 changes: 3 additions & 0 deletions .travis/test-crdt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

sbt $1 "crdt/test"
7 changes: 0 additions & 7 deletions .travis/test-it.sh

This file was deleted.

3 changes: 3 additions & 0 deletions .travis/test-leveldb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

sbt $1 "logLeveldb/test"
9 changes: 0 additions & 9 deletions .travis/test-multi.sh

This file was deleted.

3 changes: 0 additions & 3 deletions .travis/test.sh

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/RBMHTechnology/eventuate?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Build Status](https://travis-ci.org/RBMHTechnology/eventuate.svg?branch=master)](https://travis-ci.org/RBMHTechnology/eventuate)
[![Stories in Ready](https://badge.waffle.io/rbmhtechnology/eventuate.svg?label=ready&title=Ready)](http://waffle.io/rbmhtechnology/eventuate)

Expand Down
217 changes: 1 addition & 216 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,216 +1 @@
import Keys.{compile => comp, _}

val akkaVersion = "2.4.1"

val protobufVersion = "2.5.0"

organization := "com.rbmhtechnology"

name := "eventuate"

version := "0.6-SNAPSHOT"

scalaVersion := "2.11.7"

scalacOptions in (Compile, doc) := List("-skip-packages", "akka")

scalacOptions ++= Seq("-feature", "-unchecked", "-deprecation", "-Xlint")

fork in Test := true

parallelExecution in Test := false

connectInput in run := true

resolvers += "krasserm at bintray" at "http://dl.bintray.com/krasserm/maven"

libraryDependencies ++= Seq(
"com.datastax.cassandra" % "cassandra-driver-core" % "2.1.5",
"com.google.guava" % "guava" % "16.0",
"com.google.protobuf" % "protobuf-java" % protobufVersion,
"com.javaslang" % "javaslang" % "2.0.0-RC3" % "test,it",
"com.novocode" % "junit-interface" % "0.11" % "test->default",
"com.typesafe.akka" %% "akka-remote" % akkaVersion,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % "test,it",
"com.typesafe.akka" %% "akka-multi-node-testkit" % akkaVersion % "test",
"commons-io" % "commons-io" % "2.4",
"org.cassandraunit" % "cassandra-unit" % "2.0.2.2" % "test,it" excludeAll ExclusionRule(organization = "ch.qos.logback"),
"org.fusesource.leveldbjni" % "leveldbjni-all" % "1.8",
"org.scalatest" %% "scalatest" % "2.1.4" % "test,it",
"org.scalaz" %% "scalaz-core" % "7.1.0",
"org.scala-lang.modules" % "scala-java8-compat_2.11" % "0.7.0"
)

// ----------------------------------------------------------------------
// Database replication POC (example)
// ----------------------------------------------------------------------

val springVersion = "4.2.4.RELEASE"

libraryDependencies ++= Seq(
"org.aspectj" % "aspectjrt" % "1.8.8",
"org.aspectj" % "aspectjweaver" % "1.8.8",
"org.springframework" % "spring-context" % springVersion,
"org.springframework" % "spring-jdbc" % springVersion,
"org.springframework" % "spring-tx" % springVersion,
"org.hsqldb" % "hsqldb" % "2.3.3"
)

// ----------------------------------------------------------------------
// Documentation
// ----------------------------------------------------------------------

site.settings

site.sphinxSupport()

site.includeScaladoc()

ghpages.settings

git.remoteRepo := "[email protected]:RBMHTechnology/eventuate.git"

unmanagedSourceDirectories in Test += baseDirectory.value / "src" / "sphinx"/ "code"

// ----------------------------------------------------------------------
// Publishing
// ----------------------------------------------------------------------

credentials += Credentials(
"Artifactory Realm",
"oss.jfrog.org",
sys.env.getOrElse("OSS_JFROG_USER", ""),
sys.env.getOrElse("OSS_JFROG_PASS", "")
)

publishTo := {
val jfrog = "https://oss.jfrog.org/artifactory/"
if (isSnapshot.value)
Some("OJO Snapshots" at jfrog + "oss-snapshot-local")
else
Some("OJO Releases" at jfrog + "oss-release-local")
}

publishMavenStyle := true

// ----------------------------------------------------------------------
// Protobuf compilation
// ----------------------------------------------------------------------

protobufSettings

version in protobufConfig := "2.5.0"
runProtoc in protobufConfig := (args =>
com.github.os72.protocjar.Protoc.runProtoc("-v250" +: args.toArray)
)

// ----------------------------------------------------------------------
// Integration and Multi-JVM testing
// ----------------------------------------------------------------------

import com.typesafe.sbt.SbtMultiJvm
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm

lazy val IntegrTest = config("it") extend(Test)

evictionWarningOptions in update := EvictionWarningOptions.default
.withWarnTransitiveEvictions(false)
.withWarnDirectEvictions(false)
.withWarnScalaVersionEviction(false)

lazy val root = (project in file("."))
.configs(IntegrTest)
.settings(itSettings: _*)
.configs(MultiJvm)
.settings(multiJvmSettings: _*)

lazy val itSettings = Defaults.itSettings ++ Seq(
comp in IntegrTest <<= (comp in IntegrTest) triggeredBy (comp in Test),
test in IntegrTest <<= (test in IntegrTest) triggeredBy (test in Test),
parallelExecution in IntegrTest := false,
fork in IntegrTest := true
)

lazy val multiJvmSettings = SbtMultiJvm.multiJvmSettings ++ Seq(
comp in MultiJvm <<= (comp in MultiJvm) triggeredBy (comp in Test),
parallelExecution in Test := false,
executeTests in Test <<=
((executeTests in Test), (executeTests in MultiJvm)) map {
case ((testResults), (multiJvmResults)) =>
val overall =
if (testResults.overall.id < multiJvmResults.overall.id) multiJvmResults.overall
else testResults.overall
Tests.Output(overall,
testResults.events ++ multiJvmResults.events,
testResults.summaries ++ multiJvmResults.summaries)
}
)

// ----------------------------------------------------------------------
// Example classpath generation
// ----------------------------------------------------------------------

lazy val exampleClasspath = taskKey[Unit]("generate example classpath script")

exampleClasspath <<= exampleClasspath.dependsOn(comp in Test)

exampleClasspath := {
import java.nio.file.{Paths, Files, StandardOpenOption}
val cpaths = (fullClasspath in Test value) map (_.data) mkString(":")
val output =
s"""|#!/bin/sh
|
|# this file is automatically generated by the sbt 'exampleClasspath' command
|
|export EXAMPLE_CLASSPATH="$cpaths"
|""".stripMargin

val fileName = "example/.example-classpath"
val file = Paths.get(fileName)

Files.write(file, output.getBytes, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING)
file.toFile.setExecutable(true)
}

// ----------------------------------------------------------------------
// Source code formatting
// ----------------------------------------------------------------------

com.rbmhtechnology.eventuate.Formatting.formatSettings

// ----------------------------------------------------------------------
// File headers
// ----------------------------------------------------------------------

val header = (HeaderPattern.cStyleBlockComment,
"""|/*
| * Copyright (C) 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - all rights reserved.
| *
| * 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.
| */
|
|""".stripMargin)

headers := Map(
"scala" -> header,
"java" -> header)

inConfig(IntegrTest)(SbtHeader.toBeScopedSettings)
inConfig(MultiJvm)(SbtHeader.toBeScopedSettings)

val createHeaderDep = compileInputs.in(comp) <<= compileInputs.in(comp).dependsOn(createHeaders.in(comp))

inConfig(Compile)(createHeaderDep)
inConfig(Test)(createHeaderDep)
inConfig(IntegrTest)(createHeaderDep)
inConfig(MultiJvm)(createHeaderDep)
import sbt._import sbt.Keys._import sbtunidoc.Plugin.UnidocKeys._import MultiJvmKeys._import ProjectSettings._import ProjectDependencies._version in ThisBuild := "0.7-SNAPSHOT"organization in ThisBuild := "com.rbmhtechnology"scalaVersion in ThisBuild := "2.11.7"lazy val root = (project in file(".")) .aggregate(core, crdt, logCassandra, logLeveldb, examples) .dependsOn(core, logCassandra, logLeveldb) .settings(name := "eventuate") .settings(commonSettings: _*) .settings(documentationSettings: _*) .settings(unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject -- inProjects(examples)) .settings(libraryDependencies ++= Seq(AkkaRemote)) .enablePlugins(HeaderPlugin, AutomateHeaderPlugin)lazy val core = (project in file("eventuate-core")) .settings(name := "eventuate-core") .settings(commonSettings: _*) .settings(protocSettings: _*) .settings(integrationTestSettings: _*) .settings(libraryDependencies ++= Seq(AkkaRemote, CommonsIo, Java8Compat, Scalaz)) .settings(libraryDependencies ++= Seq(AkkaTestkit % "test,it", AkkaTestkitMultiNode % "test", Javaslang % "test", JunitInterface % "test", Scalatest % "test,it")) .configs(IntegrationTest, MultiJvm) .enablePlugins(HeaderPlugin, AutomateHeaderPlugin)lazy val logCassandra = (project in file("eventuate-log-cassandra")) .dependsOn(core % "compile->compile;it->it;multi-jvm->multi-jvm") .settings(name := "eventuate-log-cassandra") .settings(commonSettings: _*) .settings(integrationTestSettings: _*) .settings(libraryDependencies ++= Seq(AkkaRemote, CassandraDriver)) .settings(libraryDependencies ++= Seq(AkkaTestkit % "test,it", AkkaTestkitMultiNode % "test", Scalatest % "test,it")) .settings(libraryDependencies ++= Seq(CassandraUnit % "test,it" excludeAll ExclusionRule(organization = "ch.qos.logback"))) .settings(jvmOptions in MultiJvm += "-Dmultinode.server-port=4712") .configs(IntegrationTest, MultiJvm) .enablePlugins(HeaderPlugin, AutomateHeaderPlugin)lazy val logLeveldb = (project in file("eventuate-log-leveldb")) .dependsOn(core % "compile->compile;it->it;multi-jvm->multi-jvm") .settings(name := "eventuate-log-leveldb") .settings(commonSettings: _*) .settings(integrationTestSettings: _*) .settings(libraryDependencies ++= Seq(AkkaRemote, Leveldb)) .settings(libraryDependencies ++= Seq(AkkaTestkit % "test,it", AkkaTestkitMultiNode % "test", Scalatest % "test,it")) .settings(jvmOptions in MultiJvm += "-Dmultinode.server-port=4713") .configs(IntegrationTest, MultiJvm) .enablePlugins(HeaderPlugin, AutomateHeaderPlugin)lazy val crdt = (project in file("eventuate-crdt")) .dependsOn(core % "compile->compile;it->it;multi-jvm->multi-jvm") .dependsOn(logLeveldb % "test;it->it;multi-jvm->multi-jvm") .settings(name := "eventuate-crdt") .settings(commonSettings: _*) .settings(protocSettings: _*) .settings(integrationTestSettings: _*) .settings(libraryDependencies ++= Seq(AkkaRemote)) .settings(libraryDependencies ++= Seq(AkkaTestkit % "test,it", AkkaTestkitMultiNode % "test", Scalatest % "test,it")) .settings(jvmOptions in MultiJvm += "-Dmultinode.server-port=4714") .configs(IntegrationTest, MultiJvm) .enablePlugins(HeaderPlugin, AutomateHeaderPlugin)lazy val examples = (project in file("eventuate-examples")) .dependsOn(core, logLeveldb) .settings(name := "eventuate-examples") .settings(commonSettings: _*) .settings(exampleSettings: _*) .settings(libraryDependencies ++= Seq(AkkaRemote, CassandraDriver, Javaslang)) .enablePlugins(HeaderPlugin, AutomateHeaderPlugin)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright (C) 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - all rights reserved.
* Copyright 2015 - 2016 Red Bull Media House GmbH <http://www.redbullmediahouse.com> - all rights reserved.
*
* 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
* 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,
Expand Down Expand Up @@ -40,7 +40,7 @@ object EventsourcedActorCausalitySpec {
}
}

abstract class EventsourcedActorCausalitySpec extends WordSpec with Matchers with MultiLocationSpec {
trait EventsourcedActorCausalitySpec extends WordSpec with Matchers with MultiLocationSpec {
import ReplicationIntegrationSpec.replicationConnection
import EventsourcedActorCausalitySpec._

Expand Down Expand Up @@ -149,11 +149,3 @@ abstract class EventsourcedActorCausalitySpec extends WordSpec with Matchers wit
}
}
}

class EventsourcedActorCausalitySpecLeveldb extends EventsourcedActorCausalitySpec with MultiLocationSpecLeveldb {
override val logFactory: String => Props = id => SingleLocationSpecLeveldb.TestEventLog.props(id, batching = true)
}

class EventsourcedActorCausalitySpecCassandra extends EventsourcedActorCausalitySpec with MultiLocationSpecCassandra {
override val logFactory: String => Props = id => SingleLocationSpecCassandra.TestEventLog.props(id, batching = true)
}
Loading

0 comments on commit 2e97ed2

Please sign in to comment.