summaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorStefan Zeiger <szeiger@novocode.com>2016-07-19 15:14:34 +0200
committerStefan Zeiger <szeiger@novocode.com>2016-07-21 14:57:15 +0200
commitfaa4110fc7d8b92cac1e50a6952cdf3bc85d1cdf (patch)
tree91cba1a24f8657c214b3d581e8fb928f40bd5047 /build.sbt
parent2f75e051a181d4f8618746953ec07226b556fdb3 (diff)
downloadscala-faa4110fc7d8b92cac1e50a6952cdf3bc85d1cdf.tar.gz
scala-faa4110fc7d8b92cac1e50a6952cdf3bc85d1cdf.tar.bz2
scala-faa4110fc7d8b92cac1e50a6952cdf3bc85d1cdf.zip
Switch Windows CI build to sbt (w/ some sbt build improvements)
- Use sbt in `integrate/windows`: This essentially combines the Unix CI jobs `validate/publish-core` and `validate/test`, first publishing a local release built with STARR and then building a new version with that and running all tests on it. - Unify repository handling across build scripts: A new function `generateRepositoriesConfig` in `common`, based on the existing code in `integrate/bootstrap`, writes the `repositories` file for sbt, either with or without an extra bootstrap repository for resolving a previously built version. It is used in all CI scripts to ensure that artifacts are only resolved through the sanctioned proxies and upstream repositories. - The repository URL arguments in `setupPublishCore` and `setupValidateTest` are now optional as well. These commands are used without a URL from `integrate/windows`, which publishes to `local` instead of a temporary remote repository. - `testAll` is now a task instead of a command. It runs the same sequence of sub-tasks as before but does not propagate failures immediately. It always runs all subtasks and reports errors at the end. - The `generateBuildCharacterPropertiesFile` task now includes all properties from `versions.properties` (whose values have potentially been overwritten with `-D` options) in `buildcharacter.properties`.
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt27
1 files changed, 27 insertions, 0 deletions
diff --git a/build.sbt b/build.sbt
index 1d4e208da2..c789849af6 100644
--- a/build.sbt
+++ b/build.sbt
@@ -769,6 +769,32 @@ lazy val root: Project = (project in file("."))
GenerateAnyVals.run(dir.getAbsoluteFile)
state
},
+ testAll := {
+ val results = ScriptCommands.sequence[Result[Unit]](List(
+ (Keys.test in Test in junit).result,
+ (testOnly in IntegrationTest in testP).toTask(" -- run pos neg jvm").result,
+ (testOnly in IntegrationTest in testP).toTask(" -- res scalap specialized scalacheck").result,
+ (testOnly in IntegrationTest in testP).toTask(" -- instrumented presentation").result,
+ (testOnly in IntegrationTest in testP).toTask(" -- --srcpath scaladoc").result,
+ (Keys.test in Test in osgiTestFelix).result,
+ (Keys.test in Test in osgiTestEclipse).result,
+ (MiMa.mima in library).result,
+ (MiMa.mima in reflect).result,
+ Def.task(()).dependsOn( // Run these in parallel:
+ doc in Compile in library,
+ doc in Compile in reflect,
+ doc in Compile in compiler,
+ doc in Compile in scalap
+ ).result
+ )).value
+ val failed = results.map(_.toEither).collect { case Left(i) => i }
+ if(failed.nonEmpty) {
+ val log = streams.value.log
+ log.error(s"${failed.size} of ${results.length} test tasks failed:")
+ failed.foreach(i => log.error(s" - $i"))
+ throw new RuntimeException
+ }
+ },
antStyle := false,
incOptions := incOptions.value.withNameHashing(!antStyle.value).withAntStyle(antStyle.value)
)
@@ -838,6 +864,7 @@ lazy val buildDirectory = settingKey[File]("The directory where all build produc
lazy val mkBin = taskKey[Seq[File]]("Generate shell script (bash or Windows batch).")
lazy val mkQuick = taskKey[File]("Generate a full build, including scripts, in build/quick")
lazy val mkPack = taskKey[File]("Generate a full build, including scripts, in build/pack")
+lazy val testAll = taskKey[Unit]("Run all test tasks sequentially")
// Defining these settings is somewhat redundant as we also redefine settings that depend on them.
// However, IntelliJ's project import works better when these are set correctly.