pekko/project/AkkaBuild.scala

505 lines
18 KiB
Scala
Raw Normal View History

/**
2017-01-04 17:37:10 +01:00
* Copyright (C) 2009-2017 Lightbend Inc. <http://www.lightbend.com>
*/
2011-09-23 10:21:03 +02:00
package akka
import java.io.FileInputStream
import java.io.InputStreamReader
import java.util.Properties
import akka.TestExtras.JUnitFileReporting
import com.typesafe.sbt.S3Plugin.S3
import com.typesafe.sbt.S3Plugin.s3Settings
import com.typesafe.sbt.pgp.PgpKeys.publishSigned
import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
import com.typesafe.tools.mima.plugin.MimaPlugin
import sbt.Keys._
import sbt._
import sbtunidoc.Plugin.ScalaUnidoc
2016-01-13 12:00:46 +01:00
import sbtunidoc.Plugin.JavaUnidoc
import sbtunidoc.Plugin.UnidocKeys._
2011-07-04 19:16:43 +12:00
object AkkaBuild extends Build {
System.setProperty("akka.mode", "test") // Is there better place for this?
// Load system properties from a file to make configuration from Jenkins easier
loadSystemProperties("project/akka-build.properties")
override def buildLoaders = BuildLoader.transform(Sample.buildTransformer) :: Nil
val enableMiMa = true
2016-05-10 10:49:33 +02:00
val parallelExecutionByDefault = false // TODO: enable this once we're sure it does not break things
2015-05-21 21:07:37 +02:00
lazy val buildSettings = Dependencies.Versions ++ Seq(
organization := "com.typesafe.akka",
version := "2.5-SNAPSHOT"
2011-07-08 18:01:19 +12:00
)
2011-07-04 19:16:43 +12:00
lazy val rootSettings = parentSettings ++ Release.settings ++
SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++
UnidocRoot.akkaSettings ++
Protobuf.settings ++ Seq(
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean,
S3.host in S3.upload := "downloads.typesafe.com.s3.amazonaws.com",
S3.progress in S3.upload := true,
mappings in S3.upload <<= (Release.releaseDirectory, version) map { (d, v) =>
val downloads = d / "downloads"
val archivesPathFinder = downloads * s"*$v.zip"
2016-05-10 10:49:33 +02:00
archivesPathFinder.get.map(file => file -> ("akka/" + file.getName))
}
)
2016-05-10 10:49:33 +02:00
lazy val aggregatedProjects: Seq[ProjectReference] = Seq(
actor,
actorTests,
agent,
benchJmh,
camel,
cluster,
clusterMetrics,
clusterSharding,
clusterTools,
contrib,
distributedData,
docs,
kernel,
multiNodeTestkit,
osgi,
persistence,
persistenceQuery,
persistenceShared,
persistenceTck,
protobuf,
remote,
remoteTests,
slf4j,
stream,
streamTestkit,
streamTests,
streamTestsTck,
testkit,
typed
)
lazy val root = Project(
id = "akka",
base = file("."),
2016-05-10 10:49:33 +02:00
aggregate = aggregatedProjects
).settings(rootSettings: _*)
2011-07-04 19:16:43 +12:00
2016-09-29 11:29:38 +02:00
lazy val akkaScalaNightly = Project(
id = "akka-scala-nightly",
base = file("akka-scala-nightly"),
// remove dependencies that we have to build ourselves (Scala STM)
// samples don't work with dbuild right now
aggregate = aggregatedProjects diff List[ProjectReference](agent, docs)
2016-09-29 11:29:38 +02:00
).disablePlugins(ValidatePullRequest, MimaPlugin)
2011-07-04 19:16:43 +12:00
lazy val actor = Project(
id = "akka-actor",
base = file("akka-actor")
2016-09-29 11:29:38 +02:00
)
2011-07-04 19:16:43 +12:00
lazy val testkit = Project(
id = "akka-testkit",
base = file("akka-testkit"),
dependencies = Seq(actor)
2016-09-29 11:29:38 +02:00
)
2011-07-04 19:16:43 +12:00
lazy val typed = Project(
id = "akka-typed-experimental",
base = file("akka-typed"),
dependencies = Seq(testkit % "compile;test->test")
2016-09-29 11:29:38 +02:00
)
2011-07-04 19:16:43 +12:00
lazy val actorTests = Project(
id = "akka-actor-tests",
base = file("akka-actor-tests"),
dependencies = Seq(testkit % "compile;test->test")
2016-09-29 11:29:38 +02:00
)
2011-07-04 19:16:43 +12:00
lazy val benchJmh = Project(
id = "akka-bench-jmh",
base = file("akka-bench-jmh"),
2016-01-13 01:54:09 +01:00
dependencies = Seq(
actor,
stream, streamTests,
2016-09-29 11:29:38 +02:00
persistence, distributedData,
2016-01-13 01:54:09 +01:00
testkit
).map(_ % "compile;compile->test;provided->provided")
).disablePlugins(ValidatePullRequest)
lazy val protobuf = Project(
id = "akka-protobuf",
base = file("akka-protobuf")
2016-09-29 11:29:38 +02:00
)
lazy val remote = Project(
id = "akka-remote",
base = file("akka-remote"),
2016-05-17 13:31:32 +02:00
dependencies = Seq(actor, stream, actorTests % "test->test", testkit % "test->test", streamTestkit % "test", protobuf)
)
lazy val multiNodeTestkit = Project(
id = "akka-multi-node-testkit",
base = file("akka-multi-node-testkit"),
dependencies = Seq(remote, testkit)
2016-09-29 11:29:38 +02:00
)
lazy val remoteTests = Project(
id = "akka-remote-tests",
base = file("akka-remote-tests"),
2016-09-29 11:29:38 +02:00
dependencies = Seq(actorTests % "test->test", remote % "test->test", streamTestkit % "test", multiNodeTestkit)
2016-05-10 10:49:33 +02:00
).configs(MultiJvm)
lazy val cluster = Project(
id = "akka-cluster",
base = file("akka-cluster"),
dependencies = Seq(remote, remoteTests % "test->test" , testkit % "test->test")
2016-09-29 11:29:38 +02:00
).configs(MultiJvm)
lazy val clusterMetrics = Project(
id = "akka-cluster-metrics",
base = file("akka-cluster-metrics"),
dependencies = Seq(cluster % "compile->compile;test->test;multi-jvm->multi-jvm", slf4j % "test->compile")
2016-09-29 11:29:38 +02:00
).configs(MultiJvm)
lazy val clusterTools = Project(
id = "akka-cluster-tools",
base = file("akka-cluster-tools"),
dependencies = Seq(cluster % "compile->compile;test->test;multi-jvm->multi-jvm")
2016-09-29 11:29:38 +02:00
).configs(MultiJvm)
2015-04-27 14:48:28 +02:00
lazy val clusterSharding = Project(
id = "akka-cluster-sharding",
base = file("akka-cluster-sharding"),
// TODO akka-distributed-data dependency should be provided in pom.xml artifact.
// If I only use "provided" here it works, but then we can't run tests.
// Scope "test" is alright in the pom.xml, but would have been nicer with
// provided.
dependencies = Seq(cluster % "compile->compile;test->test;multi-jvm->multi-jvm",
persistence % "compile;test->provided", distributedData % "provided;test", clusterTools)
2016-09-29 11:29:38 +02:00
).configs(MultiJvm)
lazy val distributedData = Project(
id = "akka-distributed-data-experimental",
base = file("akka-distributed-data"),
dependencies = Seq(cluster % "compile->compile;test->test;multi-jvm->multi-jvm")
2016-09-29 11:29:38 +02:00
).configs(MultiJvm)
2011-07-04 19:16:43 +12:00
lazy val slf4j = Project(
id = "akka-slf4j",
base = file("akka-slf4j"),
dependencies = Seq(actor, testkit % "test->test")
2016-09-29 11:29:38 +02:00
)
2011-07-04 19:16:43 +12:00
2011-12-19 15:46:06 +13:00
lazy val agent = Project(
id = "akka-agent",
base = file("akka-agent"),
dependencies = Seq(actor, testkit % "test->test")
2016-09-29 11:29:38 +02:00
)
2011-12-19 15:46:06 +13:00
akka-persistence prototype The most prominent changes compared to eventsourced are: - No central processor and channel registry any more - Auto-recovery of processors on start and restart (can be disabled) - Recovery of processor networks doesn't require coordination - Explicit channel activation not needed any more - Message sequence numbers generated per processor (no gaps) - Sender references are journaled along with messages - Processors can determine their recovery status - No custom API on extension object, only messages - Journal created by extension from config, not by application - Applications only interact with processors and channels via messages - Internal design prepared for having processor-specific journal actors (for later optimization possibilities) Further additions and changes during review: - Allow processor implementation classes to use inherited stash - Channel support to resolve (potentially invalid) sender references - Logical intead of physical deletion of messages - Pinned dispatcher for LevelDB journal - Processor can handle failures during recovery - Message renamed to Persistent This prototype has the following limitations: - Serialization of persistent messages and their payload via JavaSerializer only (will be configurable later) - The LevelDB journal implementation based on a LevelDB Java port, not the native LevelDB (will be configurable later) The following features will be added later using separate tickets: - Snapshot-based recovery - Reliable channels - Journal plugin API - Optimizations - ...
2013-09-14 14:19:18 +02:00
lazy val persistence = Project(
id = "akka-persistence",
akka-persistence prototype The most prominent changes compared to eventsourced are: - No central processor and channel registry any more - Auto-recovery of processors on start and restart (can be disabled) - Recovery of processor networks doesn't require coordination - Explicit channel activation not needed any more - Message sequence numbers generated per processor (no gaps) - Sender references are journaled along with messages - Processors can determine their recovery status - No custom API on extension object, only messages - Journal created by extension from config, not by application - Applications only interact with processors and channels via messages - Internal design prepared for having processor-specific journal actors (for later optimization possibilities) Further additions and changes during review: - Allow processor implementation classes to use inherited stash - Channel support to resolve (potentially invalid) sender references - Logical intead of physical deletion of messages - Pinned dispatcher for LevelDB journal - Processor can handle failures during recovery - Message renamed to Persistent This prototype has the following limitations: - Serialization of persistent messages and their payload via JavaSerializer only (will be configurable later) - The LevelDB journal implementation based on a LevelDB Java port, not the native LevelDB (will be configurable later) The following features will be added later using separate tickets: - Snapshot-based recovery - Reliable channels - Journal plugin API - Optimizations - ...
2013-09-14 14:19:18 +02:00
base = file("akka-persistence"),
dependencies = Seq(actor, testkit % "test->test", protobuf)
2016-09-29 11:29:38 +02:00
)
akka-persistence prototype The most prominent changes compared to eventsourced are: - No central processor and channel registry any more - Auto-recovery of processors on start and restart (can be disabled) - Recovery of processor networks doesn't require coordination - Explicit channel activation not needed any more - Message sequence numbers generated per processor (no gaps) - Sender references are journaled along with messages - Processors can determine their recovery status - No custom API on extension object, only messages - Journal created by extension from config, not by application - Applications only interact with processors and channels via messages - Internal design prepared for having processor-specific journal actors (for later optimization possibilities) Further additions and changes during review: - Allow processor implementation classes to use inherited stash - Channel support to resolve (potentially invalid) sender references - Logical intead of physical deletion of messages - Pinned dispatcher for LevelDB journal - Processor can handle failures during recovery - Message renamed to Persistent This prototype has the following limitations: - Serialization of persistent messages and their payload via JavaSerializer only (will be configurable later) - The LevelDB journal implementation based on a LevelDB Java port, not the native LevelDB (will be configurable later) The following features will be added later using separate tickets: - Snapshot-based recovery - Reliable channels - Journal plugin API - Optimizations - ...
2013-09-14 14:19:18 +02:00
lazy val persistenceQuery = Project(
2016-12-14 14:09:11 +01:00
id = "akka-persistence-query",
base = file("akka-persistence-query"),
dependencies = Seq(
stream,
persistence % "compile;provided->provided;test->test",
testkit % "compile;test->test",
streamTestkit % "compile;test->test")
2016-09-29 11:29:38 +02:00
)
lazy val persistenceTck = Project(
id = "akka-persistence-tck",
base = file("akka-persistence-tck"),
dependencies = Seq(persistence % "compile;provided->provided;test->test", testkit % "compile;test->test")
2016-09-29 11:29:38 +02:00
)
lazy val persistenceShared = Project(
id = "akka-persistence-shared",
base = file("akka-persistence-shared"),
dependencies = Seq(persistence % "test->test", testkit % "test->test", remote % "test", protobuf)
2016-09-29 11:29:38 +02:00
)
lazy val stream = Project(
id = "akka-stream",
base = file("akka-stream"),
dependencies = Seq(actor)
2016-09-29 11:29:38 +02:00
)
lazy val streamTestkit = Project(
id = "akka-stream-testkit",
base = file("akka-stream-testkit"),
dependencies = Seq(stream, testkit % "compile;test->test")
2016-09-29 11:29:38 +02:00
)
lazy val streamTests = Project(
id = "akka-stream-tests",
base = file("akka-stream-tests"),
dependencies = Seq(streamTestkit % "test->test", stream)
2016-09-29 11:29:38 +02:00
)
lazy val streamTestsTck = Project(
id = "akka-stream-tests-tck",
2016-01-13 15:06:14 +01:00
base = file("akka-stream-tests-tck"),
dependencies = Seq(streamTestkit % "test->test", stream)
2016-09-29 11:29:38 +02:00
)
lazy val kernel = Project(
id = "akka-kernel",
base = file("akka-kernel"),
dependencies = Seq(actor, testkit % "test->test")
2016-09-29 11:29:38 +02:00
)
lazy val camel = Project(
id = "akka-camel",
base = file("akka-camel"),
dependencies = Seq(actor, slf4j, testkit % "test->test")
2016-09-29 11:29:38 +02:00
)
2011-07-04 19:16:43 +12:00
lazy val osgi = Project(
id = "akka-osgi",
base = file("akka-osgi"),
dependencies = Seq(actor)
2016-09-29 11:29:38 +02:00
)
lazy val docs = Project(
id = "akka-docs",
base = file("akka-docs"),
dependencies = Seq(
actor,
testkit % "compile;test->test",
remote % "compile;test->test", cluster, clusterMetrics, slf4j, agent, camel, osgi,
persistence % "compile;provided->provided;test->test", persistenceTck, persistenceQuery,
typed % "compile;test->test", distributedData,
stream, streamTestkit % "compile;test->test"
)
)
lazy val contrib = Project(
id = "akka-contrib",
base = file("akka-contrib"),
dependencies = Seq(remote, remoteTests % "test->test", cluster, clusterTools, persistence % "compile;test->provided")
2016-09-29 11:29:38 +02:00
).configs(MultiJvm)
lazy val samplesSettings = parentSettings ++ ActivatorDist.settings
2016-09-29 11:29:38 +02:00
lazy val samples = Project(
id = "akka-samples",
base = file("akka-samples"),
// FIXME osgiDiningHakkersSampleMavenTest temporarily removed from aggregate due to #16703
aggregate = if (!Sample.CliOptions.aggregateSamples) Nil else
Seq(sampleCamelJava, sampleCamelScala, sampleClusterJava, sampleClusterScala, sampleFsmScala, sampleFsmJavaLambda,
sampleMainJava, sampleMainScala, sampleMainJavaLambda, sampleMultiNodeScala,
samplePersistenceJava, samplePersistenceScala, samplePersistenceJavaLambda,
sampleRemoteJava, sampleRemoteScala, sampleSupervisionJavaLambda,
sampleDistributedDataScala, sampleDistributedDataJava)
)
.settings(samplesSettings: _*)
.disablePlugins(MimaPlugin)
lazy val sampleCamelJava = Sample.project("akka-sample-camel-java")
lazy val sampleCamelScala = Sample.project("akka-sample-camel-scala")
lazy val sampleClusterJava = Sample.project("akka-sample-cluster-java")
lazy val sampleClusterScala = Sample.project("akka-sample-cluster-scala")
lazy val sampleFsmScala = Sample.project("akka-sample-fsm-scala")
lazy val sampleFsmJavaLambda = Sample.project("akka-sample-fsm-java-lambda")
lazy val sampleMainJava = Sample.project("akka-sample-main-java")
lazy val sampleMainScala = Sample.project("akka-sample-main-scala")
lazy val sampleMainJavaLambda = Sample.project("akka-sample-main-java-lambda")
lazy val sampleMultiNodeScala = Sample.project("akka-sample-multi-node-scala")
lazy val samplePersistenceJava = Sample.project("akka-sample-persistence-java")
lazy val samplePersistenceScala = Sample.project("akka-sample-persistence-scala")
lazy val samplePersistenceJavaLambda = Sample.project("akka-sample-persistence-java-lambda")
lazy val sampleRemoteJava = Sample.project("akka-sample-remote-java")
lazy val sampleRemoteScala = Sample.project("akka-sample-remote-scala")
lazy val sampleSupervisionJavaLambda = Sample.project("akka-sample-supervision-java-lambda")
lazy val sampleDistributedDataScala = Sample.project("akka-sample-distributed-data-scala")
lazy val sampleDistributedDataJava = Sample.project("akka-sample-distributed-data-java")
lazy val osgiDiningHakkersSampleMavenTest = Project(
id = "akka-sample-osgi-dining-hakkers-maven-test",
base = file("akka-samples/akka-sample-osgi-dining-hakkers-maven-test")
)
.settings(
publishArtifact := false,
// force publication of artifacts to local maven repo, so latest versions can be used when running maven tests
compile in Compile <<=
(publishM2 in actor, publishM2 in testkit, publishM2 in remote, publishM2 in cluster, publishM2 in osgi,
publishM2 in slf4j, publishM2 in persistence, publishM2 in stream, publishM2 in protobuf, compile in Compile) map
((_, _, _, _, _, _, _, _, _, c) => c),
2016-09-29 11:29:38 +02:00
test in Test ~= { x => {
def executeMvnCommands(failureMessage: String, commands: String*) = {
if ({List("sh", "-c", commands.mkString("cd akka-samples/akka-sample-osgi-dining-hakkers; mvn ", " ", "")) !} != 0)
throw new Exception(failureMessage)
}
executeMvnCommands("Osgi sample Dining hakkers test failed", "clean", "install")
}}
)
.settings(dontPublishSettings: _*)
val dontPublishSettings = Seq(
publishSigned := (),
publish := (),
publishArtifact in Compile := false,
Dist.includeInDist := false
)
val dontPublishDocsSettings = Seq(
sources in doc in Compile := List()
)
override lazy val settings =
super.settings ++
buildSettings ++
Seq(
shellPrompt := { s => Project.extract(s).currentProject.id + " > " }
) ++
resolverSettings
2011-07-08 18:01:19 +12:00
lazy val parentSettings = Seq(
publishArtifact := false
) ++ dontPublishSettings
2011-07-04 19:16:43 +12:00
lazy val experimentalSettings = Seq(
description := """|This module of Akka is marked as
|experimental, which means that it is in early
|access mode, which also means that it is not covered
|by commercial support. An experimental module doesn't
|have to obey the rule of staying binary compatible
|between minor releases. Breaking API changes may be
|introduced in minor releases without notice as we
|refine and simplify based on your feedback. An
|experimental module may be dropped in major releases
|without prior deprecation.
|""".stripMargin
)
val (mavenLocalResolver, mavenLocalResolverSettings) =
System.getProperty("akka.build.M2Dir") match {
case null => (Resolver.mavenLocal, Seq.empty)
case path =>
// Maven resolver settings
val resolver = Resolver.file("user-publish-m2-local", new File(path))
(resolver, Seq(
otherResolvers := resolver:: publishTo.value.toList,
publishM2Configuration := Classpaths.publishConfig(packagedArtifacts.value, None, resolverName = resolver.name, checksums = checksums.in(publishM2).value, logging = ivyLoggingLevel.value)
))
}
lazy val resolverSettings = {
// should we be allowed to use artifacts published to the local maven repository
if(System.getProperty("akka.build.useLocalMavenResolver", "false").toBoolean)
Seq(resolvers += mavenLocalResolver)
else Seq.empty
} ++ {
// should we be allowed to use artifacts from sonatype snapshots
if(System.getProperty("akka.build.useSnapshotSonatypeResolver", "false").toBoolean)
Seq(resolvers += Resolver.sonatypeRepo("snapshots"))
else Seq.empty
} ++ Seq(
pomIncludeRepository := (_ => false) // do not leak internal repositories during staging
)
private def allWarnings: Boolean = System.getProperty("akka.allwarnings", "false").toBoolean
2015-01-30 11:33:33 +01:00
2016-01-13 12:00:46 +01:00
lazy val defaultSettings = resolverSettings ++
TestExtras.Filter.settings ++
Protobuf.settings ++ Seq(
2011-07-04 19:16:43 +12:00
// compile options
scalacOptions in Compile ++= Seq("-encoding", "UTF-8", "-target:jvm-1.8", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint"),
scalacOptions in Compile ++= (if (allWarnings) Seq("-deprecation") else Nil),
2015-05-20 09:00:21 +02:00
scalacOptions in Test := (scalacOptions in Test).value.filterNot(opt =>
opt == "-Xlog-reflective-calls" || opt.contains("genjavadoc")),
2015-01-30 16:05:36 +01:00
// -XDignore.symbol.file suppresses sun.misc.Unsafe warnings
javacOptions in compile ++= Seq("-encoding", "UTF-8", "-source", "1.8", "-target", "1.8", "-Xlint:unchecked", "-XDignore.symbol.file"),
javacOptions in compile ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
2016-01-13 12:00:46 +01:00
javacOptions in doc ++= Seq(),
incOptions := incOptions.value.withNameHashing(true),
2011-07-04 19:16:43 +12:00
crossVersion := CrossVersion.binary,
ivyLoggingLevel in ThisBuild := UpdateLogging.Quiet,
licenses := Seq(("Apache License, Version 2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))),
homepage := Some(url("http://akka.io/")),
apiURL := Some(url(s"http://doc.akka.io/api/akka/${version.value}")),
initialCommands :=
"""|import language.postfixOps
|import akka.actor._
|import ActorDSL._
|import scala.concurrent._
|import com.typesafe.config.ConfigFactory
|import scala.concurrent.duration._
|import akka.util.Timeout
|var config = ConfigFactory.parseString("akka.stdout-loglevel=INFO,akka.loglevel=DEBUG,pinned{type=PinnedDispatcher,executor=thread-pool-executor,throughput=1000}")
2016-09-29 15:01:05 +02:00
|var remoteConfig = ConfigFactory.parseString("akka.remote.netty{port=0,use-dispatcher-for-io=akka.actor.default-dispatcher,execution-pool-size=0},akka.actor.provider=remote").withFallback(config)
|var system: ActorSystem = null
|implicit def _system = system
|def startSystem(remoting: Boolean = false) { system = ActorSystem("repl", if(remoting) remoteConfig else config); println("dont forget to system.terminate()!") }
|implicit def ec = system.dispatcher
|implicit val timeout = Timeout(5 seconds)
|""".stripMargin,
/**
* Test settings
*/
parallelExecution in Test := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean,
logBuffered in Test := System.getProperty("akka.logBufferedTests", "false").toBoolean,
2011-07-14 14:10:37 +12:00
// show full stack traces and test case durations
testOptions in Test += Tests.Argument("-oDF"),
2013-10-18 14:13:23 +02:00
// don't save test output to a file
testListeners in (Test, test) := Seq(TestLogger(streams.value.log, {_ => streams.value.log }, logBuffered.value)),
2014-04-25 16:32:43 +02:00
// -v Log "test run started" / "test started" / "test run finished" events on log level "info" instead of "debug".
// -a Show stack traces and exception class name for AssertionErrors.
2016-05-31 12:52:30 +02:00
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a"),
Dist.includeInDist := true
) ++
mavenLocalResolverSettings ++
2016-01-13 12:00:46 +01:00
JUnitFileReporting.settings ++
docLintingSettings
lazy val docLintingSettings = Seq(
javacOptions in compile ++= Seq("-Xdoclint:none"),
javacOptions in test ++= Seq("-Xdoclint:none"),
javacOptions in doc ++= Seq("-Xdoclint:none")
)
2011-07-08 12:53:36 +12:00
def loadSystemProperties(fileName: String): Unit = {
import scala.collection.JavaConverters._
val file = new File(fileName)
if (file.exists()) {
println("Loading system properties from file `" + fileName + "`")
val in = new InputStreamReader(new FileInputStream(file), "UTF-8")
val props = new Properties
props.load(in)
in.close()
sys.props ++ props.asScala
}
}
2011-07-04 19:16:43 +12:00
}