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",
|
2018-02-14 15:38:25 +01:00
|
|
|
version := "1.2.0-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")),
|
2018-01-26 15:19:14 +01:00
|
|
|
Developer(
|
|
|
|
|
"gkossakowski",
|
|
|
|
|
"Grzegorz Kossakowski",
|
|
|
|
|
"@gkossakowski",
|
|
|
|
|
url("https://github.com/gkossakowski")
|
|
|
|
|
),
|
2017-04-21 09:14:31 +02:00
|
|
|
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-12-19 06:17:46 +01:00
|
|
|
scalafmtOnCompile in Sbt := false,
|
2017-10-24 13:23:37 +02:00
|
|
|
scalafmtVersion := "1.3.0",
|
2017-04-21 09:14:31 +02:00
|
|
|
))
|
|
|
|
|
|
2018-03-06 20:20:31 +01:00
|
|
|
def commonSettings: Seq[Setting[_]] = Def.settings(
|
2018-02-01 15:53:05 +01: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
|
|
|
|
|
)),
|
|
|
|
|
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/",
|
|
|
|
|
addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.4" cross CrossVersion.binary),
|
|
|
|
|
concurrentRestrictions in Global += Util.testExclusiveRestriction,
|
|
|
|
|
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
|
|
|
|
|
testOptions in Test += Tests.Argument(TestFrameworks.ScalaCheck, "-verbosity", "2"),
|
|
|
|
|
javacOptions in compile ++= Seq("-Xlint", "-Xlint:-serial"),
|
|
|
|
|
crossScalaVersions := Seq(baseScalaVersion),
|
|
|
|
|
bintrayPackage := (bintrayPackage in ThisBuild).value,
|
|
|
|
|
bintrayRepository := (bintrayRepository in ThisBuild).value,
|
|
|
|
|
publishArtifact in Test := false,
|
|
|
|
|
fork in compile := true,
|
|
|
|
|
fork in run := true
|
|
|
|
|
)
|
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 (
|
2018-01-10 04:48:07 +01:00
|
|
|
mimaPreviousArtifacts := {
|
2018-02-14 11:53:37 +01:00
|
|
|
Seq(
|
|
|
|
|
"1.0.0", "1.0.1", "1.0.2", "1.0.3", "1.0.4",
|
|
|
|
|
"1.1.0", "1.1.1",
|
|
|
|
|
).map { v =>
|
2018-01-10 04:48:07 +01:00
|
|
|
organization.value % moduleName.value % 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-12-04 17:18:08 +01:00
|
|
|
mimaBinaryIssueFilters ++= Seq(
|
|
|
|
|
// Changed signature or removed something in the internal pacakge
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.*"),
|
|
|
|
|
exclude[IncompatibleResultTypeProblem]("sbt.internal.*"),
|
|
|
|
|
),
|
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,
|
2018-03-07 21:31:24 +01:00
|
|
|
mimaBinaryIssueFilters ++= Seq(
|
|
|
|
|
// private[sbt]
|
|
|
|
|
ProblemFilters.exclude[IncompatibleMethTypeProblem]("sbt.TestStatus.write"),
|
|
|
|
|
ProblemFilters.exclude[IncompatibleResultTypeProblem]("sbt.TestStatus.read"),
|
|
|
|
|
),
|
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
|
|
|
|
2018-02-01 15:53:11 +01:00
|
|
|
val sbtProjDepsCompileScopeFilter =
|
|
|
|
|
ScopeFilter(inDependencies(LocalProject("sbtProj"), includeRoot = false), inConfigurations(Compile))
|
|
|
|
|
|
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"),
|
2018-02-01 15:53:11 +01:00
|
|
|
resourceGenerators in Compile += Def task {
|
|
|
|
|
val mainClassDir = (classDirectory in Compile in LocalProject("sbtProj")).value
|
|
|
|
|
val testClassDir = (classDirectory in Test in LocalProject("sbtProj")).value
|
|
|
|
|
val classDirs = (classDirectory all sbtProjDepsCompileScopeFilter).value
|
|
|
|
|
val extDepsCp = (externalDependencyClasspath in Compile in LocalProject("sbtProj")).value
|
|
|
|
|
|
|
|
|
|
val cpStrings = (mainClassDir +: testClassDir +: classDirs) ++ extDepsCp.files map (_.toString)
|
|
|
|
|
|
|
|
|
|
val file = (resourceManaged in Compile).value / "RunFromSource.classpath"
|
|
|
|
|
IO.writeLines(file, cpStrings)
|
|
|
|
|
List(file)
|
|
|
|
|
},
|
2017-07-20 18:31:39 +02:00
|
|
|
mimaSettings,
|
2018-01-13 23:08:48 +01:00
|
|
|
mimaBinaryIssueFilters ++= Seq(
|
|
|
|
|
// sbt.test package is renamed to sbt.scriptedtest.
|
|
|
|
|
exclude[MissingClassProblem]("sbt.test.*"),
|
|
|
|
|
),
|
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")
|
2018-01-13 20:28:06 +01:00
|
|
|
.dependsOn(mainProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2017-07-20 18:31:39 +02:00
|
|
|
name := "Scripted Plugin",
|
|
|
|
|
mimaSettings,
|
2018-01-13 20:28:06 +01:00
|
|
|
mimaBinaryIssueFilters ++= Seq(
|
2018-01-13 23:08:48 +01:00
|
|
|
// scripted plugin has moved into sbt mothership.
|
|
|
|
|
exclude[MissingClassProblem]("sbt.ScriptedPlugin*")
|
2018-01-13 20:28:06 +01:00
|
|
|
),
|
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-12-05 17:16:26 +01:00
|
|
|
mimaBinaryIssueFilters ++= Seq(
|
|
|
|
|
// Removed unused private[sbt] nested class
|
|
|
|
|
exclude[MissingClassProblem]("sbt.Doc$Scaladoc"),
|
|
|
|
|
// Removed no longer used private[sbt] method
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.Doc.generate"),
|
|
|
|
|
),
|
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)
|
2018-01-24 09:56:42 +01:00
|
|
|
.dependsOn(collectionProj)
|
2017-04-21 09:14:31 +02:00
|
|
|
.settings(
|
2016-12-01 09:14:07 +01:00
|
|
|
testedBaseSettings,
|
2017-12-04 17:07:40 +01:00
|
|
|
scalacOptions -= "-Ywarn-unused",
|
|
|
|
|
scalacOptions += "-Xlint:-unused",
|
2016-12-01 09:14:07 +01:00
|
|
|
name := "Protocol",
|
2018-01-30 06:43:30 +01:00
|
|
|
libraryDependencies ++= Seq(sjsonNewScalaJson.value, ipcSocket),
|
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-12-19 06:44:31 +01:00
|
|
|
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson.value, templateResolverApi),
|
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(
|
2018-01-10 04:48:07 +01:00
|
|
|
exclude[DirectMissingMethodProblem]("sbt.BasicCommands.rebootOptionParser"),
|
2017-09-18 01:08:45 +02:00
|
|
|
// 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"),
|
2018-01-30 06:43:30 +01:00
|
|
|
// Replace nailgun socket stuff
|
|
|
|
|
exclude[MissingClassProblem]("sbt.internal.NG*"),
|
|
|
|
|
exclude[MissingClassProblem]("sbt.internal.ReferenceCountedFileDescriptor"),
|
2018-03-12 18:13:17 +01:00
|
|
|
// made private[sbt] method private[this]
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.State.handleException"),
|
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-12-04 16:56:07 +01:00
|
|
|
baseSettings,
|
2017-05-23 23:48:20 +02:00
|
|
|
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
|
|
|
)
|
|
|
|
|
|
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",
|
2018-01-26 17:02:30 +01:00
|
|
|
BuildInfoPlugin.buildInfoDefaultSettings,
|
|
|
|
|
addBuildInfoToConfig(Test),
|
|
|
|
|
buildInfoObject in Test := "TestBuildInfo",
|
|
|
|
|
buildInfoKeys in Test := Seq[BuildInfoKey](
|
|
|
|
|
classDirectory in Compile,
|
|
|
|
|
classDirectory in Test,
|
|
|
|
|
// WORKAROUND https://github.com/sbt/sbt-buildinfo/issues/117
|
|
|
|
|
BuildInfoKey.map((dependencyClasspath in Compile).taskValue) { case (ident, cp) => ident -> cp.files },
|
|
|
|
|
),
|
2017-07-20 18:31:39 +02:00
|
|
|
mimaSettings,
|
2018-01-10 04:48:07 +01:00
|
|
|
mimaBinaryIssueFilters ++= Seq(
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.Scope.display012StyleMasked"),
|
|
|
|
|
),
|
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)
|
2018-01-13 20:28:06 +01:00
|
|
|
.dependsOn(logicProj, actionsProj, mainSettingsProj, runProj, commandProj, collectionProj, scriptedSbtProj)
|
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(
|
2018-03-12 18:49:43 +01:00
|
|
|
// Changed signature or removed something in the internal package
|
2017-12-14 14:41:40 +01:00
|
|
|
exclude[DirectMissingMethodProblem]("sbt.internal.*"),
|
|
|
|
|
|
2018-03-12 18:49:43 +01:00
|
|
|
// Made something final in the internal package
|
|
|
|
|
exclude[FinalClassProblem]("sbt.internal.*"),
|
|
|
|
|
|
2017-09-27 08:21:56 +02:00
|
|
|
// New and changed methods on KeyIndex. internal.
|
|
|
|
|
exclude[ReversedMissingMethodProblem]("sbt.internal.KeyIndex.*"),
|
2017-12-14 14:41:40 +01:00
|
|
|
|
|
|
|
|
// Changed signature or removed private[sbt] methods
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.Classpaths.unmanagedLibs0"),
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.Defaults.allTestGroupsTask"),
|
|
|
|
|
exclude[DirectMissingMethodProblem]("sbt.Plugins.topologicalSort"),
|
|
|
|
|
exclude[IncompatibleMethTypeProblem]("sbt.Defaults.allTestGroupsTask"),
|
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")
|
|
|
|
|
.settings(
|
2018-01-24 09:56:42 +01:00
|
|
|
testedBaseSettings,
|
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-12-26 08:32:29 +01:00
|
|
|
BuildInfoPlugin.buildInfoDefaultSettings,
|
2017-11-23 15:58:26 +01:00
|
|
|
addBuildInfoToConfig(Test),
|
2017-12-26 08:32:29 +01:00
|
|
|
BuildInfoPlugin.buildInfoDefaultSettings,
|
2017-11-23 15:58:26 +01:00
|
|
|
buildInfoObject in Test := "TestBuildInfo",
|
2018-02-01 14:38:00 +01:00
|
|
|
buildInfoKeys in Test := Seq[BuildInfoKey](
|
2018-02-22 17:48:09 +01:00
|
|
|
// WORKAROUND https://github.com/sbt/sbt-buildinfo/issues/117
|
|
|
|
|
BuildInfoKey.map((fullClasspath in Compile).taskValue) { case (ident, cp) => ident -> cp.files },
|
2018-02-01 14:38:00 +01:00
|
|
|
),
|
2017-11-23 15:58:26 +01:00
|
|
|
connectInput in run in Test := true,
|
2018-01-16 15:38:09 +01:00
|
|
|
outputStrategy in run in Test := Some(StdoutOutput),
|
2018-01-24 09:56:42 +01:00
|
|
|
fork in Test := true,
|
2018-02-28 11:39:06 +01:00
|
|
|
parallelExecution in Test := false,
|
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(
|
2018-01-10 04:48:07 +01:00
|
|
|
exclude[MissingClassProblem]("buildinfo.BuildInfo"),
|
|
|
|
|
exclude[MissingClassProblem]("buildinfo.BuildInfo$"),
|
|
|
|
|
|
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) = {
|
|
|
|
|
import scala.sys.process._
|
|
|
|
|
try {
|
2017-12-19 06:17:46 +01:00
|
|
|
val exitCode = Process(s"npm $command", Option(base)) ! log
|
2017-10-29 14:37:53 +01:00
|
|
|
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 {
|
2017-05-03 16:52:36 +02:00
|
|
|
// publishLocalBinAll.value // TODO: Restore scripted needing only binary jars.
|
|
|
|
|
publishAll.value
|
2018-02-01 15:53:11 +01:00
|
|
|
(sbtProj / Test / compile).value // make sure sbt.RunFromSourceMain is compiled
|
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,
|
2018-01-24 14:42:18 +01:00
|
|
|
Def.setting(Scripted.scriptedParser(scriptedSource.value)).parsed,
|
2017-04-21 09:14:31 +02:00
|
|
|
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 {
|
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,
|
2018-01-24 14:42:18 +01:00
|
|
|
Def.setting(Scripted.scriptedParser(scriptedSource.value)).parsed,
|
2017-04-21 09:14:31 +02:00
|
|
|
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",
|
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
|
|
|
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
|
|
|
|
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
|
|
|
},
|
2018-02-21 08:28:33 +01:00
|
|
|
commands += Command.command("publishLocalAllModule") { state =>
|
|
|
|
|
val extracted = Project.extract(state)
|
|
|
|
|
import extracted._
|
|
|
|
|
val sv = get(scalaVersion)
|
|
|
|
|
val projs = structure.allProjectRefs
|
|
|
|
|
val ioOpt = projs find { case ProjectRef(_, id) => id == "ioRoot"; case _ => false }
|
|
|
|
|
val utilOpt = projs find { case ProjectRef(_, id) => id == "utilRoot"; case _ => false }
|
|
|
|
|
val lmOpt = projs find { case ProjectRef(_, id) => id == "lmRoot"; case _ => false }
|
|
|
|
|
val zincOpt = projs find { case ProjectRef(_, id) => id == "zincRoot"; case _ => false }
|
|
|
|
|
(ioOpt map { case ProjectRef(build, _) => "{" + build.toString + "}/publishLocal" }).toList :::
|
|
|
|
|
(utilOpt map { case ProjectRef(build, _) => "{" + build.toString + "}/publishLocal" }).toList :::
|
|
|
|
|
(lmOpt map { case ProjectRef(build, _) => "{" + build.toString + "}/publishLocal" }).toList :::
|
|
|
|
|
(zincOpt map { case ProjectRef(build, _) =>
|
|
|
|
|
val zincSv = get(scalaVersion in ProjectRef(build, "zinc"))
|
|
|
|
|
val csv = get(crossScalaVersions in ProjectRef(build, "compilerBridge")).toList
|
|
|
|
|
(csv flatMap { bridgeSv =>
|
|
|
|
|
s"++$bridgeSv" :: ("{" + build.toString + "}compilerBridge/publishLocal") :: Nil
|
|
|
|
|
}) :::
|
|
|
|
|
List(s"++$zincSv", "{" + build.toString + "}/publishLocal")
|
|
|
|
|
}).getOrElse(Nil) :::
|
|
|
|
|
List(s"++$sv", "publishLocal") :::
|
|
|
|
|
state
|
|
|
|
|
},
|
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
|
|
|
|
|
}
|
|
|
|
|
)
|
2018-01-11 15:13:21 +01:00
|
|
|
|
|
|
|
|
inThisBuild(Seq(
|
|
|
|
|
whitesourceProduct := "Lightbend Reactive Platform",
|
|
|
|
|
whitesourceAggregateProjectName := "sbt-master",
|
|
|
|
|
whitesourceAggregateProjectToken := "e7a1e55518c0489a98e9c7430c8b2ccd53d9f97c12ed46148b592ebe4c8bf128",
|
|
|
|
|
whitesourceIgnoredScopes ++= Seq("plugin", "scalafmt", "sxr"),
|
|
|
|
|
whitesourceFailOnError := sys.env.contains("WHITESOURCE_PASSWORD"), // fail if pwd is present
|
|
|
|
|
whitesourceForceCheckAllDependencies := true,
|
|
|
|
|
))
|