2014-12-18 05:38:10 +01:00
|
|
|
import Util._
|
2014-12-18 13:57:05 +01:00
|
|
|
import Dependencies._
|
2014-12-18 05:38:10 +01:00
|
|
|
import Sxr.sxr
|
2017-08-28 06:42:26 +02:00
|
|
|
import com.typesafe.tools.mima.core._, ProblemFilters._
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2015-02-06 19:48:12 +01:00
|
|
|
// ThisBuild settings take lower precedence,
|
|
|
|
|
// but can be shared across the multi projects.
|
2017-04-21 09:14:31 +02:00
|
|
|
def buildLevelSettings: Seq[Setting[_]] =
|
|
|
|
|
inThisBuild(
|
|
|
|
|
Seq(
|
|
|
|
|
organization := "org.scala-sbt",
|
2017-09-16 21:51:46 +02:00
|
|
|
version := "1.0.3-SNAPSHOT",
|
2017-04-21 09:14:31 +02:00
|
|
|
description := "sbt is an interactive build tool",
|
|
|
|
|
bintrayOrganization := Some("sbt"),
|
|
|
|
|
bintrayRepository := {
|
|
|
|
|
if (publishStatus.value == "releases") "maven-releases"
|
|
|
|
|
else "maven-snapshots"
|
|
|
|
|
},
|
|
|
|
|
bintrayPackage := "sbt",
|
|
|
|
|
bintrayReleaseOnPublish := false,
|
|
|
|
|
licenses := List("BSD New" -> url("https://github.com/sbt/sbt/blob/0.13/LICENSE")),
|
|
|
|
|
developers := List(
|
|
|
|
|
Developer("harrah", "Mark Harrah", "@harrah", url("https://github.com/harrah")),
|
|
|
|
|
Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("https://github.com/eed3si9n")),
|
|
|
|
|
Developer("jsuereth", "Josh Suereth", "@jsuereth", url("https://github.com/jsuereth")),
|
|
|
|
|
Developer("dwijnand", "Dale Wijnand", "@dwijnand", url("https://github.com/dwijnand")),
|
|
|
|
|
Developer("gkossakowski",
|
|
|
|
|
"Grzegorz Kossakowski",
|
|
|
|
|
"@gkossakowski",
|
|
|
|
|
url("https://github.com/gkossakowski")),
|
|
|
|
|
Developer("Duhemm", "Martin Duhem", "@Duhemm", url("https://github.com/Duhemm"))
|
|
|
|
|
),
|
|
|
|
|
homepage := Some(url("https://github.com/sbt/sbt")),
|
|
|
|
|
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git")),
|
2017-06-16 22:11:33 +02:00
|
|
|
resolvers += Resolver.mavenLocal,
|
2017-08-10 17:23:15 +02:00
|
|
|
scalafmtOnCompile := true,
|
2017-10-24 13:23:37 +02:00
|
|
|
scalafmtVersion := "1.3.0",
|
2017-04-21 09:14:31 +02:00
|
|
|
))
|
|
|
|
|
|
|
|
|
|
def commonSettings: Seq[Setting[_]] =
|
|
|
|
|
Seq[SettingsDefinition](
|
2017-10-04 19:01:06 +02:00
|
|
|
headerLicense := Some(HeaderLicense.Custom(
|
|
|
|
|
"""|sbt
|
|
|
|
|
|Copyright 2011 - 2017, Lightbend, Inc.
|
|
|
|
|
|Copyright 2008 - 2010, Mark Harrah
|
|
|
|
|
|Licensed under BSD-3-Clause license (see LICENSE)
|
|
|
|
|
|""".stripMargin
|
|
|
|
|
)),
|
2017-04-21 09:14:31 +02:00
|
|
|
scalaVersion := baseScalaVersion,
|
|
|
|
|
componentID := None,
|
|
|
|
|
resolvers += Resolver.typesafeIvyRepo("releases"),
|
|
|
|
|
resolvers += Resolver.sonatypeRepo("snapshots"),
|
|
|
|
|
resolvers += "bintray-sbt-maven-releases" at "https://dl.bintray.com/sbt/maven-releases/",
|
2017-10-19 02:10:01 +02:00
|
|
|
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.4" cross CrossVersion.binary),
|
2017-04-21 09:14:31 +02:00
|
|
|
concurrentRestrictions in Global += Util.testExclusiveRestriction,
|
2017-09-27 08:21:56 +02:00
|
|
|
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
|
|
|
|
|
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "2"),
|
2017-11-28 03:37:31 +01:00
|
|
|
javacOptions in compile ++= Seq("-Xlint", "-Xlint:-serial"),
|
2017-04-21 09:14:31 +02:00
|
|
|
crossScalaVersions := Seq(baseScalaVersion),
|
|
|
|
|
bintrayPackage := (bintrayPackage in ThisBuild).value,
|
|
|
|
|
bintrayRepository := (bintrayRepository in ThisBuild).value,
|
|
|
|
|
publishArtifact in Test := false,
|
2017-05-03 00:59:51 +02:00
|
|
|
fork in compile := true,
|
|
|
|
|
fork in run := true
|
2017-04-21 09:14:31 +02:00
|
|
|
) flatMap (_.settings)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
def minimalSettings: Seq[Setting[_]] =
|
2015-02-15 04:29:24 +01:00
|
|
|
commonSettings ++ customCommands ++
|
2017-04-21 09:14:31 +02:00
|
|
|
publishPomSettings ++ Release.javaVersionCheckSettings
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
def baseSettings: Seq[Setting[_]] =
|
2017-04-20 01:56:35 +02:00
|
|
|
minimalSettings ++ Seq(projectComponent) ++ baseScalacOptions ++ Licensed.settings
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
def testedBaseSettings: Seq[Setting[_]] =
|
|
|
|
|
baseSettings ++ testDependencies
|
|
|
|
|
|
2017-07-20 18:31:39 +02:00
|
|
|
val mimaSettings = Def settings (
|
2017-12-05 08:27:32 +01:00
|
|
|
mimaPreviousArtifacts := (0 to 4).map { v =>
|
|
|
|
|
organization.value % moduleName.value % s"1.0.$v" cross (if (crossPaths.value) CrossVersion.binary else CrossVersion.disabled)
|
|
|
|
|
}.toSet
|
2017-07-20 18:31:39 +02:00
|
|
|
)
|
|
|
|
|
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val sbtRoot: Project = (project in file("."))
|
2017-05-03 16:52:36 +02:00
|
|
|
.enablePlugins(ScriptedPlugin) // , SiteScaladocPlugin, GhpagesPlugin)
|
2017-07-20 04:00:42 +02:00
|
|
|
.configs(Sxr.SxrConf)
|
|
|
|
|
.aggregate(nonRoots: _*)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
buildLevelSettings,
|
|
|
|
|
minimalSettings,
|
2017-05-08 15:34:41 +02:00
|
|
|
Util.baseScalacOptions,
|
|
|
|
|
Docs.settings,
|
|
|
|
|
Sxr.settings,
|
|
|
|
|
scalacOptions += "-Ymacro-expand:none", // for both sxr and doc
|
|
|
|
|
sources in sxr := {
|
|
|
|
|
val allSources = (sources ?? Nil).all(docProjects).value
|
|
|
|
|
allSources.flatten.distinct
|
|
|
|
|
}, //sxr
|
|
|
|
|
sources in (Compile, doc) := (sources in sxr).value, // doc
|
|
|
|
|
Sxr.sourceDirectories := {
|
|
|
|
|
val allSourceDirectories = (sourceDirectories ?? Nil).all(docProjects).value
|
|
|
|
|
allSourceDirectories.flatten
|
|
|
|
|
},
|
|
|
|
|
fullClasspath in sxr := (externalDependencyClasspath in Compile in sbtProj).value,
|
|
|
|
|
dependencyClasspath in (Compile, doc) := (fullClasspath in sxr).value,
|
|
|
|
|
Util.publishPomSettings,
|
|
|
|
|
otherRootSettings,
|
|
|
|
|
Transform.conscriptSettings(bundledLauncherProj),
|
2015-02-06 20:35:32 +01:00
|
|
|
publish := {},
|
2017-05-30 08:44:13 +02:00
|
|
|
publishLocal := {},
|
2017-11-29 22:45:02 +01:00
|
|
|
skip in publish := true,
|
|
|
|
|
commands in Global += Command.single("sbtOn")((state, dir) =>
|
|
|
|
|
s"sbtProj/test:runMain sbt.RunFromSourceMain $dir" :: state),
|
2015-03-24 21:12:51 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// This is used to configure an sbt-launcher for this version of sbt.
|
|
|
|
|
lazy val bundledLauncherProj =
|
2017-04-21 09:14:31 +02:00
|
|
|
(project in file("launch"))
|
|
|
|
|
.settings(
|
|
|
|
|
minimalSettings,
|
|
|
|
|
inConfig(Compile)(Transform.configSettings),
|
|
|
|
|
Release.launcherSettings(sbtLaunchJar)
|
|
|
|
|
)
|
|
|
|
|
.enablePlugins(SbtLauncherPlugin)
|
|
|
|
|
.settings(
|
|
|
|
|
name := "sbt-launch",
|
|
|
|
|
moduleName := "sbt-launch",
|
|
|
|
|
description := "sbt application launcher",
|
|
|
|
|
autoScalaLibrary := false,
|
|
|
|
|
crossPaths := false,
|
2017-07-20 18:31:39 +02:00
|
|
|
// mimaSettings, // TODO: Configure MiMa, deal with Proguard
|
2017-04-21 09:14:31 +02:00
|
|
|
publish := Release.deployLauncher.value,
|
|
|
|
|
publishLauncher := Release.deployLauncher.value,
|
|
|
|
|
packageBin in Compile := sbtLaunchJar.value
|
|
|
|
|
)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2014-12-18 19:14:04 +01:00
|
|
|
/* ** subproject declarations ** */
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2017-06-26 12:38:37 +02:00
|
|
|
val collectionProj = (project in file("internal") / "util-collection")
|
|
|
|
|
.settings(
|
|
|
|
|
testedBaseSettings,
|
|
|
|
|
Util.keywordsSettings,
|
|
|
|
|
name := "Collections",
|
2017-07-20 18:31:39 +02:00
|
|
|
libraryDependencies ++= Seq(sjsonNewScalaJson.value),
|
|
|
|
|
mimaSettings,
|
2017-09-22 05:05:48 +02:00
|
|
|
mimaBinaryIssueFilters ++= Seq(
|
|
|
|
|
// Added private[sbt] method to capture State attributes.
|
|
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.internal.util.AttributeMap.setCond"),
|
2017-10-20 05:18:43 +02:00
|
|
|
|
2017-10-19 02:10:29 +02:00
|
|
|
// Dropped in favour of kind-projector's inline type lambda syntax
|
|
|
|
|
exclude[MissingClassProblem]("sbt.internal.util.TypeFunctions$P1of2"),
|
|
|
|
|
|
2017-10-20 00:19:16 +02:00
|
|
|
// Dropped in favour of kind-projector's polymorphic lambda literals
|
|
|
|
|
exclude[MissingClassProblem]("sbt.internal.util.Param"),
|
|
|
|
|
exclude[MissingClassProblem]("sbt.internal.util.Param$"),
|
|
|
|
|
|
2017-10-20 05:18:43 +02:00
|
|
|
// Dropped in favour of plain scala.Function, and its compose method
|
|
|
|
|
exclude[MissingClassProblem]("sbt.internal.util.Fn1"),
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.util.TypeFunctions.toFn1"),
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.util.Types.toFn1"),
|
2017-12-04 16:50:45 +01:00
|
|
|
|
|
|
|
|
// Instead of defining foldr in KList & overriding in KCons,
|
|
|
|
|
// it's now abstract in KList and defined in both KCons & KNil.
|
|
|
|
|
exclude[FinalMethodProblem]("sbt.internal.util.KNil.foldr"),
|
|
|
|
|
exclude[DirectAbstractMethodProblem]("sbt.internal.util.KList.foldr"),
|
2017-09-22 05:05:48 +02:00
|
|
|
),
|
2017-06-26 12:38:37 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtUtilPosition)
|
|
|
|
|
|
|
|
|
|
// Command line-related utilities.
|
|
|
|
|
val completeProj = (project in file("internal") / "util-complete")
|
|
|
|
|
.dependsOn(collectionProj)
|
|
|
|
|
.settings(
|
|
|
|
|
testedBaseSettings,
|
|
|
|
|
name := "Completion",
|
2017-07-20 18:31:39 +02:00
|
|
|
libraryDependencies += jline,
|
|
|
|
|
mimaSettings,
|
2017-06-26 12:38:37 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtIO, addSbtUtilControl)
|
|
|
|
|
|
|
|
|
|
// A logic with restricted negation as failure for a unique, stable model
|
|
|
|
|
val logicProj = (project in file("internal") / "util-logic")
|
|
|
|
|
.dependsOn(collectionProj)
|
|
|
|
|
.settings(
|
|
|
|
|
testedBaseSettings,
|
2017-07-20 18:31:39 +02:00
|
|
|
name := "Logic",
|
|
|
|
|
mimaSettings,
|
2017-06-26 12:38:37 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtUtilRelation)
|
|
|
|
|
|
2014-12-18 05:38:10 +01:00
|
|
|
/* **** Intermediate-level Modules **** */
|
|
|
|
|
|
|
|
|
|
// Runner for uniform test interface
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val testingProj = (project in file("testing"))
|
|
|
|
|
.enablePlugins(ContrabandPlugin, JsonCodecPlugin)
|
|
|
|
|
.dependsOn(testAgentProj)
|
|
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "Testing",
|
2017-07-01 04:08:30 +02:00
|
|
|
libraryDependencies ++= Seq(testInterface, launcherInterface, sjsonNewScalaJson.value),
|
2017-04-19 07:50:18 +02:00
|
|
|
managedSourceDirectories in Compile +=
|
|
|
|
|
baseDirectory.value / "src" / "main" / "contraband-scala",
|
2017-04-01 23:19:45 +02:00
|
|
|
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
2017-07-20 18:31:39 +02:00
|
|
|
contrabandFormatsForType in generateContrabands in Compile := ContrabandConfig.getFormats,
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtIO, addSbtCompilerClasspath, addSbtUtilLogging)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Testing agent for running tests in a separate process.
|
2017-05-24 11:15:22 +02:00
|
|
|
lazy val testAgentProj = (project in file("testing") / "agent")
|
|
|
|
|
.settings(
|
|
|
|
|
minimalSettings,
|
|
|
|
|
crossScalaVersions := Seq(baseScalaVersion),
|
|
|
|
|
crossPaths := false,
|
|
|
|
|
autoScalaLibrary := false,
|
|
|
|
|
name := "Test Agent",
|
2017-07-20 18:31:39 +02:00
|
|
|
libraryDependencies += testInterface,
|
|
|
|
|
mimaSettings,
|
2017-05-24 11:15:22 +02:00
|
|
|
)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Basic task engine
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val taskProj = (project in file("tasks"))
|
2017-06-26 12:38:37 +02:00
|
|
|
.dependsOn(collectionProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2017-07-20 18:31:39 +02:00
|
|
|
name := "Tasks",
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2017-06-26 12:38:37 +02:00
|
|
|
.configure(addSbtUtilControl)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Standard task system. This provides map, flatMap, join, and more on top of the basic task model.
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val stdTaskProj = (project in file("tasks-standard"))
|
2017-06-26 12:38:37 +02:00
|
|
|
.dependsOn(collectionProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.dependsOn(taskProj % "compile;test->test")
|
|
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "Task System",
|
2017-07-20 18:31:39 +02:00
|
|
|
testExclusive,
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2017-06-26 12:38:37 +02:00
|
|
|
.configure(addSbtIO, addSbtUtilLogging, addSbtUtilCache)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Embedded Scala code runner
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val runProj = (project in file("run"))
|
2017-06-16 22:11:33 +02:00
|
|
|
.enablePlugins(ContrabandPlugin)
|
2017-07-22 09:34:10 +02:00
|
|
|
.dependsOn(collectionProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2017-05-12 00:33:12 +02:00
|
|
|
name := "Run",
|
|
|
|
|
managedSourceDirectories in Compile +=
|
|
|
|
|
baseDirectory.value / "src" / "main" / "contraband-scala",
|
2017-07-20 18:31:39 +02:00
|
|
|
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtIO, addSbtUtilLogging, addSbtCompilerClasspath)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val scriptedSbtProj = (project in scriptedPath / "sbt")
|
|
|
|
|
.dependsOn(commandProj)
|
|
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2015-03-24 16:14:13 +01:00
|
|
|
name := "Scripted sbt",
|
2017-07-20 18:31:39 +02:00
|
|
|
libraryDependencies ++= Seq(launcherInterface % "provided"),
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2017-09-21 05:18:37 +02:00
|
|
|
.configure(addSbtIO, addSbtUtilLogging, addSbtCompilerInterface, addSbtUtilScripted, addSbtLmCore)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val scriptedPluginProj = (project in scriptedPath / "plugin")
|
|
|
|
|
.dependsOn(sbtProj)
|
|
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2017-07-20 18:31:39 +02:00
|
|
|
name := "Scripted Plugin",
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtCompilerClasspath)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Implementation and support code for defining actions.
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val actionsProj = (project in file("main-actions"))
|
2017-06-26 12:38:37 +02:00
|
|
|
.dependsOn(completeProj, runProj, stdTaskProj, taskProj, testingProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2016-11-30 14:42:51 +01:00
|
|
|
name := "Actions",
|
2017-07-20 18:31:39 +02:00
|
|
|
libraryDependencies += sjsonNewScalaJson.value,
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
.configure(
|
|
|
|
|
addSbtIO,
|
|
|
|
|
addSbtUtilLogging,
|
|
|
|
|
addSbtUtilRelation,
|
2017-07-16 00:09:40 +02:00
|
|
|
addSbtUtilTracking,
|
2017-06-26 12:38:37 +02:00
|
|
|
addSbtCompilerInterface,
|
|
|
|
|
addSbtCompilerClasspath,
|
|
|
|
|
addSbtCompilerApiInfo,
|
2017-07-16 00:09:40 +02:00
|
|
|
addSbtLmCore,
|
2017-06-26 12:38:37 +02:00
|
|
|
addSbtCompilerIvyIntegration,
|
|
|
|
|
addSbtZinc
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
lazy val protocolProj = (project in file("protocol"))
|
2017-06-16 22:11:33 +02:00
|
|
|
.enablePlugins(ContrabandPlugin, JsonCodecPlugin)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2016-12-01 09:14:07 +01:00
|
|
|
testedBaseSettings,
|
|
|
|
|
name := "Protocol",
|
2017-07-01 04:08:30 +02:00
|
|
|
libraryDependencies ++= Seq(sjsonNewScalaJson.value),
|
2017-04-19 07:50:18 +02:00
|
|
|
managedSourceDirectories in Compile +=
|
|
|
|
|
baseDirectory.value / "src" / "main" / "contraband-scala",
|
2017-03-20 17:44:57 +01:00
|
|
|
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
2017-07-20 18:31:39 +02:00
|
|
|
contrabandFormatsForType in generateContrabands in Compile := ContrabandConfig.getFormats,
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtUtilLogging)
|
2016-12-01 09:14:07 +01:00
|
|
|
|
2014-12-18 05:38:10 +01:00
|
|
|
// General command support and core commands not specific to a build system
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val commandProj = (project in file("main-command"))
|
2017-06-16 22:11:33 +02:00
|
|
|
.enablePlugins(ContrabandPlugin, JsonCodecPlugin)
|
2017-06-26 12:38:37 +02:00
|
|
|
.dependsOn(protocolProj, completeProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2015-03-24 16:14:13 +01:00
|
|
|
name := "Command",
|
2017-11-28 03:37:31 +01:00
|
|
|
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi,
|
|
|
|
|
jna, jnaPlatform),
|
2017-04-19 07:50:18 +02:00
|
|
|
managedSourceDirectories in Compile +=
|
|
|
|
|
baseDirectory.value / "src" / "main" / "contraband-scala",
|
2016-11-30 14:42:51 +01:00
|
|
|
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
2017-07-20 18:31:39 +02:00
|
|
|
contrabandFormatsForType in generateContrabands in Compile := ContrabandConfig.getFormats,
|
|
|
|
|
mimaSettings,
|
2017-09-18 01:08:45 +02:00
|
|
|
mimaBinaryIssueFilters ++= Vector(
|
|
|
|
|
// Changed the signature of Server method. nacho cheese.
|
2017-09-22 05:05:48 +02:00
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.server.Server.*"),
|
|
|
|
|
// Added method to ServerInstance. This is also internal.
|
|
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.internal.server.ServerInstance.*"),
|
2017-10-02 21:52:02 +02:00
|
|
|
// Added method to CommandChannel. internal.
|
|
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.internal.CommandChannel.*"),
|
2017-10-21 08:27:40 +02:00
|
|
|
// Added an overload to reboot. The overload is private[sbt].
|
|
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.StateOps.reboot"),
|
2017-11-28 03:37:31 +01:00
|
|
|
),
|
|
|
|
|
unmanagedSources in (Compile, headerCreate) := {
|
|
|
|
|
val old = (unmanagedSources in (Compile, headerCreate)).value
|
|
|
|
|
old filterNot { x => (x.getName startsWith "NG") || (x.getName == "ReferenceCountedFileDescriptor.java") }
|
|
|
|
|
},
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2017-06-23 18:58:00 +02:00
|
|
|
.configure(
|
|
|
|
|
addSbtIO,
|
|
|
|
|
addSbtUtilLogging,
|
2017-06-26 12:38:37 +02:00
|
|
|
addSbtCompilerInterface,
|
2017-06-23 18:58:00 +02:00
|
|
|
addSbtCompilerClasspath,
|
2017-07-16 00:09:40 +02:00
|
|
|
addSbtLmCore
|
2017-06-23 18:58:00 +02:00
|
|
|
)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2017-05-23 23:48:20 +02:00
|
|
|
// The core macro project defines the main logic of the DSL, abstracted
|
|
|
|
|
// away from several sbt implementators (tasks, settings, et cetera).
|
2017-05-23 23:53:04 +02:00
|
|
|
lazy val coreMacrosProj = (project in file("core-macros"))
|
2017-06-26 12:38:37 +02:00
|
|
|
.dependsOn(collectionProj)
|
2017-05-23 23:53:04 +02:00
|
|
|
.settings(
|
2017-05-23 23:48:20 +02:00
|
|
|
commonSettings,
|
|
|
|
|
name := "Core Macros",
|
2017-07-20 18:31:39 +02:00
|
|
|
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value,
|
|
|
|
|
mimaSettings,
|
2017-05-23 23:48:20 +02:00
|
|
|
)
|
|
|
|
|
|
2017-05-24 10:27:51 +02:00
|
|
|
/* Write all the compile-time dependencies of the spores macro to a file,
|
|
|
|
|
* in order to read it from the created Toolbox to run the neg tests. */
|
|
|
|
|
lazy val generateToolboxClasspath = Def.task {
|
|
|
|
|
val classpathAttributes = (dependencyClasspath in Compile).value
|
|
|
|
|
val dependenciesClasspath =
|
|
|
|
|
classpathAttributes.map(_.data.getAbsolutePath).mkString(":")
|
|
|
|
|
val scalaBinVersion = (scalaBinaryVersion in Compile).value
|
|
|
|
|
val targetDir = (target in Compile).value
|
|
|
|
|
val compiledClassesDir = targetDir / s"scala-$scalaBinVersion/classes"
|
|
|
|
|
val testClassesDir = targetDir / s"scala-$scalaBinVersion/test-classes"
|
|
|
|
|
val classpath = s"$compiledClassesDir:$testClassesDir:$dependenciesClasspath"
|
|
|
|
|
val resourceDir = (resourceDirectory in Compile).value
|
|
|
|
|
resourceDir.mkdir() // In case it doesn't exist
|
|
|
|
|
val toolboxTestClasspath = resourceDir / "toolbox.classpath"
|
|
|
|
|
IO.write(toolboxTestClasspath, classpath)
|
2017-05-24 11:27:04 +02:00
|
|
|
val result = List(toolboxTestClasspath.getAbsoluteFile)
|
|
|
|
|
streams.value.log.success("Wrote the classpath for the macro neg test suite.")
|
|
|
|
|
result
|
2017-05-24 10:27:51 +02:00
|
|
|
}
|
|
|
|
|
|
2014-12-18 05:38:10 +01:00
|
|
|
// Fixes scope=Scope for Setting (core defined in collectionProj) to define the settings system used in build definitions
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val mainSettingsProj = (project in file("main-settings"))
|
2017-06-26 12:38:37 +02:00
|
|
|
.dependsOn(completeProj, commandProj, stdTaskProj, coreMacrosProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2017-05-24 10:27:51 +02:00
|
|
|
name := "Main Settings",
|
2017-07-20 18:31:39 +02:00
|
|
|
resourceGenerators in Compile += generateToolboxClasspath.taskValue,
|
|
|
|
|
mimaSettings,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
.configure(
|
2017-06-26 12:38:37 +02:00
|
|
|
addSbtIO,
|
|
|
|
|
addSbtUtilLogging,
|
2017-04-21 09:14:31 +02:00
|
|
|
addSbtUtilCache,
|
|
|
|
|
addSbtUtilRelation,
|
2017-06-26 12:38:37 +02:00
|
|
|
addSbtCompilerInterface,
|
2017-04-21 09:14:31 +02:00
|
|
|
addSbtCompilerClasspath,
|
2017-07-16 00:09:40 +02:00
|
|
|
addSbtLmCore
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2016-11-23 16:17:34 +01:00
|
|
|
// The main integration project for sbt. It brings all of the projects together, configures them, and provides for overriding conventions.
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val mainProj = (project in file("main"))
|
2017-06-16 22:11:33 +02:00
|
|
|
.enablePlugins(ContrabandPlugin)
|
2017-07-22 09:34:10 +02:00
|
|
|
.dependsOn(logicProj, actionsProj, mainSettingsProj, runProj, commandProj, collectionProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "Main",
|
2017-10-20 17:26:23 +02:00
|
|
|
libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface) ++ log4jDependencies ++ Seq(scalaCacheCaffeine),
|
2017-05-13 14:01:51 +02:00
|
|
|
managedSourceDirectories in Compile +=
|
|
|
|
|
baseDirectory.value / "src" / "main" / "contraband-scala",
|
2017-07-20 18:31:39 +02:00
|
|
|
sourceManaged in (Compile, generateContrabands) := baseDirectory.value / "src" / "main" / "contraband-scala",
|
|
|
|
|
mimaSettings,
|
2017-09-22 05:05:48 +02:00
|
|
|
mimaBinaryIssueFilters ++= Vector(
|
|
|
|
|
// Changed the signature of NetworkChannel ctor. internal.
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.server.NetworkChannel.*"),
|
2017-09-27 08:21:56 +02:00
|
|
|
// ctor for ConfigIndex. internal.
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.ConfigIndex.*"),
|
|
|
|
|
// New and changed methods on KeyIndex. internal.
|
|
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"),
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.KeyIndex.*"),
|
2017-10-02 21:52:02 +02:00
|
|
|
// Removed unused val. internal.
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.RelayAppender.jsonFormat"),
|
2017-10-05 18:53:31 +02:00
|
|
|
// Removed unused def. internal.
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.Load.isProjectThis"),
|
2017-09-22 05:05:48 +02:00
|
|
|
)
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2017-06-23 18:58:00 +02:00
|
|
|
.configure(
|
|
|
|
|
addSbtIO,
|
|
|
|
|
addSbtUtilLogging,
|
2017-07-16 00:09:40 +02:00
|
|
|
addSbtLmCore,
|
|
|
|
|
addSbtLmIvy,
|
2017-06-26 12:38:37 +02:00
|
|
|
addSbtCompilerInterface,
|
2017-08-10 17:23:15 +02:00
|
|
|
addSbtZincCompile
|
|
|
|
|
)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Strictly for bringing implicits and aliases from subsystems into the top-level sbt namespace through a single package object
|
|
|
|
|
// technically, we need a dependency on all of mainProj's dependencies, but we don't do that since this is strictly an integration project
|
|
|
|
|
// with the sole purpose of providing certain identifiers without qualification (with a package object)
|
2017-04-21 09:14:31 +02:00
|
|
|
lazy val sbtProj = (project in file("sbt"))
|
|
|
|
|
.dependsOn(mainProj, scriptedSbtProj % "test->test")
|
2017-11-23 15:58:26 +01:00
|
|
|
.enablePlugins(BuildInfoPlugin)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "sbt",
|
2015-09-14 09:27:22 +02:00
|
|
|
normalizedName := "sbt",
|
2017-01-15 07:44:05 +01:00
|
|
|
crossScalaVersions := Seq(baseScalaVersion),
|
2017-07-20 18:31:39 +02:00
|
|
|
crossPaths := false,
|
2017-11-23 15:58:26 +01:00
|
|
|
javaOptions ++= Seq("-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"),
|
2017-07-20 18:31:39 +02:00
|
|
|
mimaSettings,
|
2017-08-28 06:42:26 +02:00
|
|
|
mimaBinaryIssueFilters ++= sbtIgnoredProblems,
|
2017-11-23 15:58:26 +01:00
|
|
|
addBuildInfoToConfig(Test),
|
|
|
|
|
buildInfoObject in Test := "TestBuildInfo",
|
|
|
|
|
buildInfoKeys in Test := Seq[BuildInfoKey](fullClasspath in Compile),
|
|
|
|
|
connectInput in run in Test := true,
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
|
|
|
|
.configure(addSbtCompilerBridge)
|
2017-10-20 05:18:43 +02:00
|
|
|
|
2017-08-28 06:42:26 +02:00
|
|
|
lazy val sbtIgnoredProblems = {
|
2017-11-29 22:45:02 +01:00
|
|
|
Vector(
|
2017-08-28 06:42:26 +02:00
|
|
|
// Added more items to Import trait.
|
|
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.Import.sbt$Import$_setter_$WatchSource_="),
|
2017-11-29 22:45:02 +01:00
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.Import.WatchSource"),
|
2017-10-20 00:19:16 +02:00
|
|
|
|
2017-11-29 22:45:02 +01:00
|
|
|
// Dropped in favour of kind-projector's polymorphic lambda literals
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.Import.Param"),
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.package.Param"),
|
|
|
|
|
|
|
|
|
|
// Dropped in favour of plain scala.Function, and its compose method
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.package.toFn1"),
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2017-08-28 06:42:26 +02:00
|
|
|
}
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2017-10-29 14:37:53 +01:00
|
|
|
def runNpm(command: String, base: File, log: sbt.internal.util.ManagedLogger) = {
|
|
|
|
|
val npm = if (sbt.internal.util.Util.isWindows) "npm.cmd" else "npm"
|
|
|
|
|
import scala.sys.process._
|
|
|
|
|
try {
|
|
|
|
|
val exitCode = Process(s"$npm $command", Option(base)) ! log
|
|
|
|
|
if (exitCode != 0) throw new Exception("Process returned exit code: " + exitCode)
|
|
|
|
|
} catch {
|
|
|
|
|
case e: java.io.IOException => log.warn("failed to run npm " + e.getMessage)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-02 09:33:29 +02:00
|
|
|
lazy val vscodePlugin = (project in file("vscode-sbt-scala"))
|
|
|
|
|
.settings(
|
|
|
|
|
crossPaths := false,
|
|
|
|
|
crossScalaVersions := Seq(baseScalaVersion),
|
|
|
|
|
skip in publish := true,
|
|
|
|
|
compile in Compile := {
|
|
|
|
|
val u = update.value
|
2017-10-29 14:37:53 +01:00
|
|
|
runNpm("run compile", baseDirectory.value, streams.value.log)
|
|
|
|
|
sbt.internal.inc.Analysis.empty
|
2017-10-02 09:33:29 +02:00
|
|
|
},
|
|
|
|
|
update := {
|
|
|
|
|
val old = update.value
|
|
|
|
|
val t = target.value / "updated"
|
|
|
|
|
val base = baseDirectory.value
|
2017-10-06 02:26:59 +02:00
|
|
|
val log = streams.value.log
|
2017-10-02 09:33:29 +02:00
|
|
|
if (t.exists) ()
|
|
|
|
|
else {
|
2017-10-29 14:37:53 +01:00
|
|
|
runNpm("install", base, log)
|
2017-10-02 09:33:29 +02:00
|
|
|
IO.touch(t)
|
|
|
|
|
}
|
|
|
|
|
old
|
|
|
|
|
},
|
|
|
|
|
cleanFiles ++= {
|
|
|
|
|
val base = baseDirectory.value
|
|
|
|
|
Vector(
|
|
|
|
|
target.value / "updated",
|
|
|
|
|
base / "node_modules", base / "client" / "node_modules",
|
|
|
|
|
base / "client" / "server",
|
|
|
|
|
base / "client" / "out",
|
|
|
|
|
base / "server" / "node_modules") filter { _.exists }
|
|
|
|
|
}
|
|
|
|
|
)
|
|
|
|
|
|
2015-07-10 11:53:48 +02:00
|
|
|
def scriptedTask: Def.Initialize[InputTask[Unit]] = Def.inputTask {
|
2016-03-31 05:48:20 +02:00
|
|
|
val result = scriptedSource(dir => (s: State) => Scripted.scriptedParser(dir)).parsed
|
2017-05-03 16:52:36 +02:00
|
|
|
// publishLocalBinAll.value // TODO: Restore scripted needing only binary jars.
|
|
|
|
|
publishAll.value
|
2016-04-24 20:23:48 +02:00
|
|
|
// These two projects need to be visible in a repo even if the default
|
|
|
|
|
// local repository is hidden, so we publish them to an alternate location and add
|
|
|
|
|
// that alternate repo to the running scripted test (in Scripted.scriptedpreScripted).
|
|
|
|
|
// (altLocalPublish in interfaceProj).value
|
|
|
|
|
// (altLocalPublish in compileInterfaceProj).value
|
2017-04-21 09:14:31 +02:00
|
|
|
Scripted.doScripted(
|
|
|
|
|
(sbtLaunchJar in bundledLauncherProj).value,
|
|
|
|
|
(fullClasspath in scriptedSbtProj in Test).value,
|
2016-03-31 05:48:20 +02:00
|
|
|
(scalaInstance in scriptedSbtProj).value,
|
2017-04-21 09:14:31 +02:00
|
|
|
scriptedSource.value,
|
|
|
|
|
scriptedBufferLog.value,
|
|
|
|
|
result,
|
|
|
|
|
scriptedPrescripted.value,
|
|
|
|
|
scriptedLaunchOpts.value
|
|
|
|
|
)
|
2014-12-18 05:38:10 +01:00
|
|
|
}
|
|
|
|
|
|
2015-07-10 11:53:48 +02:00
|
|
|
def scriptedUnpublishedTask: Def.Initialize[InputTask[Unit]] = Def.inputTask {
|
2016-03-31 05:48:20 +02:00
|
|
|
val result = scriptedSource(dir => (s: State) => Scripted.scriptedParser(dir)).parsed
|
2017-04-21 09:14:31 +02:00
|
|
|
Scripted.doScripted(
|
|
|
|
|
(sbtLaunchJar in bundledLauncherProj).value,
|
|
|
|
|
(fullClasspath in scriptedSbtProj in Test).value,
|
2016-03-31 05:48:20 +02:00
|
|
|
(scalaInstance in scriptedSbtProj).value,
|
2017-04-21 09:14:31 +02:00
|
|
|
scriptedSource.value,
|
|
|
|
|
scriptedBufferLog.value,
|
|
|
|
|
result,
|
|
|
|
|
scriptedPrescripted.value,
|
|
|
|
|
scriptedLaunchOpts.value
|
|
|
|
|
)
|
2014-12-18 05:38:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
lazy val publishLauncher = TaskKey[Unit]("publish-launcher")
|
|
|
|
|
|
2017-04-21 09:14:31 +02:00
|
|
|
def allProjects =
|
|
|
|
|
Seq(
|
2017-06-26 12:38:37 +02:00
|
|
|
collectionProj,
|
|
|
|
|
logicProj,
|
|
|
|
|
completeProj,
|
2017-04-21 09:14:31 +02:00
|
|
|
testingProj,
|
|
|
|
|
testAgentProj,
|
|
|
|
|
taskProj,
|
|
|
|
|
stdTaskProj,
|
|
|
|
|
runProj,
|
|
|
|
|
scriptedSbtProj,
|
|
|
|
|
scriptedPluginProj,
|
|
|
|
|
protocolProj,
|
|
|
|
|
actionsProj,
|
|
|
|
|
commandProj,
|
|
|
|
|
mainSettingsProj,
|
|
|
|
|
mainProj,
|
|
|
|
|
sbtProj,
|
2017-05-26 06:59:49 +02:00
|
|
|
bundledLauncherProj,
|
|
|
|
|
coreMacrosProj
|
2017-04-21 09:14:31 +02:00
|
|
|
)
|
2015-02-03 04:44:02 +01:00
|
|
|
|
2017-05-08 15:08:40 +02:00
|
|
|
lazy val nonRoots = allProjects.map(p => LocalProject(p.id))
|
2014-12-18 05:38:10 +01:00
|
|
|
|
2017-04-21 09:14:31 +02:00
|
|
|
def otherRootSettings =
|
|
|
|
|
Seq(
|
|
|
|
|
scripted := scriptedTask.evaluated,
|
|
|
|
|
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
|
|
|
|
|
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
|
|
|
|
|
// scriptedPrescripted := { addSbtAlternateResolver _ },
|
2017-05-03 00:59:51 +02:00
|
|
|
scriptedLaunchOpts := List("-Xmx1500M", "-Xms512M", "-server"),
|
2017-04-21 09:14:31 +02:00
|
|
|
publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
|
|
|
|
|
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
|
|
|
|
|
aggregate in bintrayRelease := false
|
|
|
|
|
) ++ inConfig(Scripted.RepoOverrideTest)(
|
|
|
|
|
Seq(
|
2017-06-23 18:58:00 +02:00
|
|
|
scriptedPrescripted := (_ => ()),
|
|
|
|
|
scriptedLaunchOpts := List(
|
|
|
|
|
"-Xmx1500M",
|
|
|
|
|
"-Xms512M",
|
|
|
|
|
"-server",
|
|
|
|
|
"-Dsbt.override.build.repos=true",
|
|
|
|
|
s"""-Dsbt.repository.config=${scriptedSource.value / "repo.config"}"""
|
|
|
|
|
),
|
2017-04-21 09:14:31 +02:00
|
|
|
scripted := scriptedTask.evaluated,
|
|
|
|
|
scriptedUnpublished := scriptedUnpublishedTask.evaluated,
|
|
|
|
|
scriptedSource := (sourceDirectory in sbtProj).value / "repo-override-test"
|
|
|
|
|
))
|
2016-04-24 20:23:48 +02:00
|
|
|
|
|
|
|
|
// def addSbtAlternateResolver(scriptedRoot: File) = {
|
|
|
|
|
// val resolver = scriptedRoot / "project" / "AddResolverPlugin.scala"
|
|
|
|
|
// if (!resolver.exists) {
|
|
|
|
|
// IO.write(resolver, s"""import sbt._
|
|
|
|
|
// |import Keys._
|
|
|
|
|
// |
|
|
|
|
|
// |object AddResolverPlugin extends AutoPlugin {
|
|
|
|
|
// | override def requires = sbt.plugins.JvmPlugin
|
|
|
|
|
// | override def trigger = allRequirements
|
|
|
|
|
// |
|
|
|
|
|
// | override lazy val projectSettings = Seq(resolvers += alternativeLocalResolver)
|
|
|
|
|
// | lazy val alternativeLocalResolver = Resolver.file("$altLocalRepoName", file("$altLocalRepoPath"))(Resolver.ivyStylePatterns)
|
|
|
|
|
// |}
|
|
|
|
|
// |""".stripMargin)
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
2014-12-18 19:14:04 +01:00
|
|
|
lazy val docProjects: ScopeFilter = ScopeFilter(
|
2016-04-29 08:39:34 +02:00
|
|
|
inAnyProject -- inProjects(sbtRoot, sbtProj, scriptedSbtProj, scriptedPluginProj),
|
2014-12-18 19:14:04 +01:00
|
|
|
inConfigurations(Compile)
|
2014-12-18 05:38:10 +01:00
|
|
|
)
|
2014-12-18 23:40:20 +01:00
|
|
|
lazy val safeUnitTests = taskKey[Unit]("Known working tests (for both 2.10 and 2.11)")
|
|
|
|
|
lazy val safeProjects: ScopeFilter = ScopeFilter(
|
2017-04-21 09:14:31 +02:00
|
|
|
inProjects(mainSettingsProj, mainProj, actionsProj, runProj, stdTaskProj),
|
2014-12-18 23:40:20 +01:00
|
|
|
inConfigurations(Test)
|
|
|
|
|
)
|
2015-06-20 20:21:16 +02:00
|
|
|
lazy val otherUnitTests = taskKey[Unit]("Unit test other projects")
|
|
|
|
|
lazy val otherProjects: ScopeFilter = ScopeFilter(
|
2017-06-23 18:58:00 +02:00
|
|
|
inProjects(
|
|
|
|
|
testingProj,
|
|
|
|
|
testAgentProj,
|
|
|
|
|
taskProj,
|
|
|
|
|
scriptedSbtProj,
|
|
|
|
|
scriptedPluginProj,
|
|
|
|
|
commandProj,
|
|
|
|
|
mainSettingsProj,
|
|
|
|
|
mainProj,
|
|
|
|
|
sbtProj
|
|
|
|
|
),
|
2015-06-20 20:21:16 +02:00
|
|
|
inConfigurations(Test)
|
|
|
|
|
)
|
2014-12-18 23:40:20 +01:00
|
|
|
|
|
|
|
|
def customCommands: Seq[Setting[_]] = Seq(
|
2017-01-15 07:44:05 +01:00
|
|
|
commands += Command.command("setupBuildScala212") { state =>
|
|
|
|
|
s"""set scalaVersion in ThisBuild := "$scala212" """ ::
|
2014-12-18 23:40:20 +01:00
|
|
|
state
|
|
|
|
|
},
|
|
|
|
|
safeUnitTests := {
|
|
|
|
|
test.all(safeProjects).value
|
|
|
|
|
},
|
2015-06-20 20:21:16 +02:00
|
|
|
otherUnitTests := {
|
2016-02-24 16:02:22 +01:00
|
|
|
test.all(otherProjects).value
|
2015-06-20 20:42:26 +02:00
|
|
|
},
|
2014-12-18 23:40:20 +01:00
|
|
|
commands += Command.command("release-sbt-local") { state =>
|
2015-02-25 18:31:21 +01:00
|
|
|
"clean" ::
|
2017-04-21 09:14:31 +02:00
|
|
|
"so compile" ::
|
|
|
|
|
"so publishLocal" ::
|
|
|
|
|
"reload" ::
|
|
|
|
|
state
|
2014-12-18 23:40:20 +01:00
|
|
|
},
|
2015-02-17 19:33:54 +01:00
|
|
|
/** There are several complications with sbt's build.
|
|
|
|
|
* First is the fact that interface project is a Java-only project
|
2015-12-14 11:26:34 +01:00
|
|
|
* that uses source generator from datatype subproject in Scala 2.10.6.
|
2015-02-17 19:33:54 +01:00
|
|
|
*
|
2015-07-16 13:53:10 +02:00
|
|
|
* Second is the fact that all subprojects are released with crossPaths
|
2015-12-14 11:26:34 +01:00
|
|
|
* turned off for the sbt's Scala version 2.10.6, but some of them are also
|
2015-02-17 19:33:54 +01:00
|
|
|
* cross published against 2.11.1 with crossPaths turned on.
|
|
|
|
|
*
|
2015-07-16 13:53:10 +02:00
|
|
|
* `so compile` handles 2.10.x/2.11.x cross building.
|
2015-02-17 19:33:54 +01:00
|
|
|
*/
|
2014-12-18 23:40:20 +01:00
|
|
|
commands += Command.command("release-sbt") { state =>
|
|
|
|
|
// TODO - Any sort of validation
|
2015-02-25 18:31:21 +01:00
|
|
|
"clean" ::
|
2017-05-30 08:44:13 +02:00
|
|
|
"conscriptConfigs" ::
|
|
|
|
|
"compile" ::
|
|
|
|
|
"publishSigned" ::
|
2015-03-24 23:32:56 +01:00
|
|
|
"bundledLauncherProj/publishLauncher" ::
|
2015-02-21 03:09:43 +01:00
|
|
|
state
|
|
|
|
|
},
|
2015-02-25 18:31:21 +01:00
|
|
|
// stamp-version doesn't work with ++ or "so".
|
2015-02-21 03:09:43 +01:00
|
|
|
commands += Command.command("release-nightly") { state =>
|
|
|
|
|
"stamp-version" ::
|
2015-02-25 18:31:21 +01:00
|
|
|
"clean" ::
|
|
|
|
|
"compile" ::
|
|
|
|
|
"publish" ::
|
2015-04-22 06:28:47 +02:00
|
|
|
"bintrayRelease" ::
|
2014-12-18 23:40:20 +01:00
|
|
|
state
|
|
|
|
|
}
|
|
|
|
|
)
|