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
|
|
|
|
|
|
2015-06-22 15:52:38 +02:00
|
|
|
import com.typesafe.tools.mima.core._, ProblemFilters._
|
|
|
|
|
import com.typesafe.tools.mima.plugin.MimaKeys.{ binaryIssueFilters, previousArtifact}
|
|
|
|
|
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
|
|
|
|
|
|
2015-02-06 19:48:12 +01:00
|
|
|
// ThisBuild settings take lower precedence,
|
|
|
|
|
// but can be shared across the multi projects.
|
2015-08-19 13:12:14 +02:00
|
|
|
def buildLevelSettings: Seq[Setting[_]] = inThisBuild(Seq(
|
|
|
|
|
organization := "org.scala-sbt",
|
2015-09-16 00:19:05 +02:00
|
|
|
version := "1.0.0-SNAPSHOT",
|
2016-05-09 03:35:46 +02:00
|
|
|
description := "sbt is an interactive build tool",
|
2016-05-05 20:38:24 +02:00
|
|
|
bintrayOrganization := Some("sbt"),
|
|
|
|
|
bintrayRepository := {
|
2016-05-08 21:29:28 +02:00
|
|
|
if (!isSnapshot.value) "maven-releases"
|
2016-05-05 20:38:24 +02:00
|
|
|
else "maven-snapshots"
|
|
|
|
|
},
|
2015-08-19 13:12:14 +02:00
|
|
|
bintrayPackage := "sbt",
|
2015-09-11 11:00:34 +02:00
|
|
|
bintrayReleaseOnPublish := false,
|
2016-05-09 03:35:46 +02:00
|
|
|
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")),
|
2015-09-11 11:00:34 +02:00
|
|
|
resolvers += Resolver.mavenLocal
|
2015-08-19 13:12:14 +02:00
|
|
|
))
|
2015-02-06 19:48:12 +01:00
|
|
|
|
2015-06-22 15:52:38 +02:00
|
|
|
def commonSettings: Seq[Setting[_]] = Seq[SettingsDefinition](
|
2016-04-29 08:39:34 +02:00
|
|
|
scalaVersion := scala211,
|
2014-12-18 05:38:10 +01:00
|
|
|
componentID := None,
|
|
|
|
|
resolvers += Resolver.typesafeIvyRepo("releases"),
|
2015-03-24 21:16:55 +01:00
|
|
|
resolvers += Resolver.sonatypeRepo("snapshots"),
|
2016-10-07 20:37:25 +02:00
|
|
|
resolvers += "bintray-sbt-maven-releases" at "https://dl.bintray.com/sbt/maven-releases/",
|
2014-12-18 05:38:10 +01:00
|
|
|
concurrentRestrictions in Global += Util.testExclusiveRestriction,
|
|
|
|
|
testOptions += Tests.Argument(TestFrameworks.ScalaCheck, "-w", "1"),
|
|
|
|
|
javacOptions in compile ++= Seq("-target", "6", "-source", "6", "-Xlint", "-Xlint:-serial"),
|
2015-02-03 04:44:02 +01:00
|
|
|
incOptions := incOptions.value.withNameHashing(true),
|
2016-09-13 07:15:57 +02:00
|
|
|
crossScalaVersions := Seq(scala211),
|
2015-04-20 07:20:23 +02:00
|
|
|
bintrayPackage := (bintrayPackage in ThisBuild).value,
|
2015-06-22 15:52:38 +02:00
|
|
|
bintrayRepository := (bintrayRepository in ThisBuild).value,
|
|
|
|
|
mimaDefaultSettings,
|
2016-05-11 22:06:44 +02:00
|
|
|
publishArtifact in Test := false,
|
2015-06-22 15:52:38 +02:00
|
|
|
previousArtifact := None, // Some(organization.value % moduleName.value % "1.0.0"),
|
|
|
|
|
binaryIssueFilters ++= Seq(
|
|
|
|
|
)
|
|
|
|
|
) flatMap (_.settings)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
def minimalSettings: Seq[Setting[_]] =
|
2015-02-15 04:29:24 +01:00
|
|
|
commonSettings ++ customCommands ++
|
2014-12-18 23:40:20 +01:00
|
|
|
publishPomSettings ++ Release.javaVersionCheckSettings
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
def baseSettings: Seq[Setting[_]] =
|
|
|
|
|
minimalSettings ++ Seq(projectComponent) ++ baseScalacOptions ++ Licensed.settings ++ Formatting.settings
|
|
|
|
|
|
|
|
|
|
def testedBaseSettings: Seq[Setting[_]] =
|
|
|
|
|
baseSettings ++ testDependencies
|
|
|
|
|
|
2015-03-27 02:35:36 +01:00
|
|
|
lazy val sbtRoot: Project = (project in file(".")).
|
2016-03-31 05:48:20 +02:00
|
|
|
enablePlugins(ScriptedPlugin).
|
2015-02-06 20:35:32 +01:00
|
|
|
configs(Sxr.sxrConf).
|
2014-12-18 05:38:10 +01:00
|
|
|
aggregate(nonRoots: _*).
|
2015-02-06 20:35:32 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
buildLevelSettings,
|
|
|
|
|
minimalSettings,
|
|
|
|
|
rootSettings,
|
2015-02-06 20:35:32 +01:00
|
|
|
publish := {},
|
2015-03-24 21:12:51 +01:00
|
|
|
publishLocal := {}
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// This is used to configure an sbt-launcher for this version of sbt.
|
|
|
|
|
lazy val bundledLauncherProj =
|
|
|
|
|
(project in file("launch")).
|
2015-03-27 00:22:24 +01:00
|
|
|
settings(
|
|
|
|
|
minimalSettings,
|
|
|
|
|
inConfig(Compile)(Transform.configSettings),
|
|
|
|
|
Release.launcherSettings(sbtLaunchJar)
|
|
|
|
|
).
|
2015-03-24 21:12:51 +01:00
|
|
|
enablePlugins(SbtLauncherPlugin).
|
|
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
name := "sbt-launch",
|
|
|
|
|
moduleName := "sbt-launch",
|
|
|
|
|
description := "sbt application launcher",
|
|
|
|
|
autoScalaLibrary := false,
|
2016-04-29 08:39:34 +02:00
|
|
|
crossPaths := false,
|
2015-03-27 00:22:24 +01:00
|
|
|
publish := Release.deployLauncher.value,
|
|
|
|
|
publishLauncher := Release.deployLauncher.value,
|
|
|
|
|
packageBin in Compile := sbtLaunchJar.value
|
2015-02-06 20:35:32 +01:00
|
|
|
)
|
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
|
|
|
|
|
|
|
|
/* **** Intermediate-level Modules **** */
|
|
|
|
|
|
|
|
|
|
// Runner for uniform test interface
|
|
|
|
|
lazy val testingProj = (project in file("testing")).
|
2015-09-14 09:27:22 +02:00
|
|
|
dependsOn(testAgentProj).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "Testing",
|
2016-11-23 17:19:22 +01:00
|
|
|
libraryDependencies ++= Seq(testInterface,launcherInterface)
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtIO, addSbtCompilerClasspath, addSbtUtilLogging)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Testing agent for running tests in a separate process.
|
|
|
|
|
lazy val testAgentProj = (project in file("testing") / "agent").
|
|
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
minimalSettings,
|
2016-05-05 20:38:24 +02:00
|
|
|
crossScalaVersions := Seq(scala211),
|
|
|
|
|
crossPaths := false,
|
|
|
|
|
autoScalaLibrary := false,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "Test Agent",
|
2014-12-18 13:57:05 +01:00
|
|
|
libraryDependencies += testInterface
|
2014-12-18 05:38:10 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// Basic task engine
|
2016-05-06 22:01:49 +02:00
|
|
|
lazy val taskProj = (project in file("tasks")).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2016-11-23 17:19:22 +01:00
|
|
|
name := "Tasks"
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtUtilControl, addSbtUtilCollection)
|
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.
|
2016-05-06 22:01:49 +02:00
|
|
|
lazy val stdTaskProj = (project in file("tasks-standard")).
|
2015-09-14 09:27:22 +02:00
|
|
|
dependsOn (taskProj % "compile;test->test").
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "Task System",
|
2016-11-23 17:19:22 +01:00
|
|
|
testExclusive
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtUtilCollection, addSbtUtilLogging, addSbtIO)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Embedded Scala code runner
|
|
|
|
|
lazy val runProj = (project in file("run")).
|
|
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2016-11-23 17:19:22 +01:00
|
|
|
name := "Run"
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtIO, addSbtUtilLogging, addSbtCompilerClasspath)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
lazy val scriptedSbtProj = (project in scriptedPath / "sbt").
|
2016-01-26 14:51:14 +01:00
|
|
|
dependsOn(commandProj).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2015-03-24 16:14:13 +01:00
|
|
|
name := "Scripted sbt",
|
2016-11-23 17:19:22 +01:00
|
|
|
libraryDependencies ++= Seq(launcherInterface % "provided")
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtIO, addSbtUtilLogging, addSbtCompilerInterface, addSbtUtilScripted)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
lazy val scriptedPluginProj = (project in scriptedPath / "plugin").
|
2015-09-14 09:27:22 +02:00
|
|
|
dependsOn(sbtProj).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
baseSettings,
|
2016-11-23 17:19:22 +01:00
|
|
|
name := "Scripted Plugin"
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtCompilerClasspath)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// Implementation and support code for defining actions.
|
2016-05-06 22:01:49 +02:00
|
|
|
lazy val actionsProj = (project in file("main-actions")).
|
2015-09-14 09:27:22 +02:00
|
|
|
dependsOn(runProj, stdTaskProj, taskProj, testingProj).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2016-11-23 17:19:22 +01:00
|
|
|
name := "Actions"
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtCompilerClasspath, addSbtUtilCompletion, addSbtCompilerApiInfo,
|
|
|
|
|
addSbtZinc, addSbtCompilerIvyIntegration, addSbtCompilerInterface,
|
|
|
|
|
addSbtIO, addSbtUtilLogging, addSbtUtilRelation, addSbtLm, addSbtUtilTracking)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
|
|
|
|
// General command support and core commands not specific to a build system
|
2016-05-06 22:01:49 +02:00
|
|
|
lazy val commandProj = (project in file("main-command")).
|
2016-10-27 15:27:41 +02:00
|
|
|
enablePlugins(DatatypePlugin, JsonCodecPlugin).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2015-03-24 16:14:13 +01:00
|
|
|
name := "Command",
|
2016-11-23 17:19:22 +01:00
|
|
|
libraryDependencies ++= Seq(launcherInterface, sjsonNewScalaJson),
|
2016-10-27 15:27:41 +02:00
|
|
|
sourceManaged in (Compile, generateDatatypes) := baseDirectory.value / "src" / "main" / "datatype-scala"
|
2016-11-23 17:19:22 +01:00
|
|
|
).
|
|
|
|
|
configure(addSbtCompilerInterface, addSbtIO, addSbtUtilLogging, addSbtUtilCompletion, addSbtCompilerClasspath)
|
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
|
2016-05-06 22:01:49 +02:00
|
|
|
lazy val mainSettingsProj = (project in file("main-settings")).
|
2015-09-14 09:27:22 +02:00
|
|
|
dependsOn(commandProj, stdTaskProj).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2016-11-23 17:19:22 +01:00
|
|
|
name := "Main Settings"
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtUtilCache, addSbtUtilApplyMacro, addSbtCompilerInterface, addSbtUtilRelation,
|
|
|
|
|
addSbtUtilLogging, addSbtIO, addSbtUtilCompletion, addSbtCompilerClasspath, addSbtLm)
|
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.
|
2016-05-06 22:01:49 +02:00
|
|
|
lazy val mainProj = (project in file("main")).
|
2016-03-02 11:49:17 +01:00
|
|
|
dependsOn(actionsProj, mainSettingsProj, runProj, commandProj).
|
2014-12-18 05:38:10 +01:00
|
|
|
settings(
|
2015-03-27 00:22:24 +01:00
|
|
|
testedBaseSettings,
|
2014-12-18 05:38:10 +01:00
|
|
|
name := "Main",
|
2016-11-23 17:19:22 +01:00
|
|
|
libraryDependencies ++= scalaXml.value ++ Seq(launcherInterface)
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtCompilerInterface,
|
|
|
|
|
addSbtIO, addSbtUtilLogging, addSbtUtilLogic, addSbtLm, 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)
|
2016-05-06 22:01:49 +02:00
|
|
|
lazy val sbtProj = (project in file("sbt")).
|
2015-09-14 09:27:22 +02:00
|
|
|
dependsOn(mainProj, scriptedSbtProj % "test->test").
|
2014-12-18 05:38:10 +01: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",
|
2016-05-08 21:01:00 +02:00
|
|
|
crossScalaVersions := Seq(scala211),
|
2016-11-23 17:19:22 +01:00
|
|
|
crossPaths := false
|
|
|
|
|
).
|
|
|
|
|
configure(addSbtCompilerBridge)
|
2014-12-18 05:38:10 +01:00
|
|
|
|
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
|
2016-09-01 02:14:14 +02:00
|
|
|
publishLocalBinAll.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
|
2016-03-31 05:48:20 +02:00
|
|
|
Scripted.doScripted((sbtLaunchJar in bundledLauncherProj).value, (fullClasspath in scriptedSbtProj in Test).value,
|
|
|
|
|
(scalaInstance in scriptedSbtProj).value,
|
2016-04-24 20:23:48 +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
|
|
|
|
|
Scripted.doScripted((sbtLaunchJar in bundledLauncherProj).value, (fullClasspath in scriptedSbtProj in Test).value,
|
|
|
|
|
(scalaInstance in scriptedSbtProj).value,
|
2016-04-24 20:23:48 +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")
|
|
|
|
|
|
|
|
|
|
lazy val myProvided = config("provided") intransitive
|
|
|
|
|
|
2015-09-14 09:27:22 +02:00
|
|
|
def allProjects = Seq(
|
|
|
|
|
testingProj, testAgentProj, taskProj, stdTaskProj, runProj,
|
2016-01-26 14:51:14 +01:00
|
|
|
scriptedSbtProj, scriptedPluginProj,
|
2016-03-02 11:49:17 +01:00
|
|
|
actionsProj, commandProj, mainSettingsProj, mainProj, sbtProj, bundledLauncherProj)
|
2015-02-03 04:44:02 +01:00
|
|
|
|
2014-12-18 05:38:10 +01:00
|
|
|
def projectsWithMyProvided = allProjects.map(p => p.copy(configurations = (p.configurations.filter(_ != Provided)) :+ myProvided))
|
|
|
|
|
lazy val nonRoots = projectsWithMyProvided.map(p => LocalProject(p.id))
|
|
|
|
|
|
2015-04-20 07:20:23 +02:00
|
|
|
def rootSettings = fullDocSettings ++
|
2015-06-09 17:20:03 +02:00
|
|
|
Util.publishPomSettings ++ otherRootSettings ++ Formatting.sbtFilesSettings ++
|
|
|
|
|
Transform.conscriptSettings(bundledLauncherProj)
|
2014-12-18 05:38:10 +01:00
|
|
|
def otherRootSettings = Seq(
|
2016-03-31 05:48:20 +02:00
|
|
|
scripted <<= scriptedTask,
|
|
|
|
|
scriptedUnpublished <<= scriptedUnpublishedTask,
|
|
|
|
|
scriptedSource := (sourceDirectory in sbtProj).value / "sbt-test",
|
2016-04-24 20:23:48 +02:00
|
|
|
// scriptedPrescripted := { addSbtAlternateResolver _ },
|
|
|
|
|
scriptedLaunchOpts := List("-XX:MaxPermSize=256M", "-Xmx1G"),
|
2016-09-01 02:14:14 +02:00
|
|
|
publishAll := { val _ = (publishLocal).all(ScopeFilter(inAnyProject)).value },
|
|
|
|
|
publishLocalBinAll := { val _ = (publishLocalBin).all(ScopeFilter(inAnyProject)).value },
|
2015-06-24 22:56:45 +02:00
|
|
|
aggregate in bintrayRelease := false
|
2016-04-24 20:23:48 +02:00
|
|
|
) ++ inConfig(Scripted.RepoOverrideTest)(Seq(
|
|
|
|
|
scriptedPrescripted := { _ => () },
|
|
|
|
|
scriptedLaunchOpts := {
|
|
|
|
|
List("-XX:MaxPermSize=256M", "-Xmx1G", "-Dsbt.override.build.repos=true",
|
|
|
|
|
s"""-Dsbt.repository.config=${ scriptedSource.value / "repo.config" }""")
|
|
|
|
|
},
|
|
|
|
|
scripted <<= scriptedTask,
|
|
|
|
|
scriptedUnpublished <<= scriptedUnpublishedTask,
|
|
|
|
|
scriptedSource := (sourceDirectory in sbtProj).value / "repo-override-test"
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
)
|
|
|
|
|
def fullDocSettings = Util.baseScalacOptions ++ Docs.settings ++ Sxr.settings ++ Seq(
|
|
|
|
|
scalacOptions += "-Ymacro-no-expand", // for both sxr and doc
|
2014-12-18 19:14:04 +01:00
|
|
|
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
|
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(
|
2015-09-14 09:27:22 +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(
|
2015-09-14 09:27:22 +02:00
|
|
|
inProjects(
|
|
|
|
|
testingProj, testAgentProj, taskProj,
|
2016-01-26 14:51:14 +01:00
|
|
|
scriptedSbtProj, scriptedPluginProj,
|
2015-06-20 20:21:16 +02:00
|
|
|
commandProj, mainSettingsProj, mainProj,
|
2016-04-29 08:39:34 +02:00
|
|
|
sbtProj),
|
2015-06-20 20:21:16 +02:00
|
|
|
inConfigurations(Test)
|
|
|
|
|
)
|
2014-12-18 23:40:20 +01:00
|
|
|
|
|
|
|
|
def customCommands: Seq[Setting[_]] = Seq(
|
|
|
|
|
commands += Command.command("setupBuildScala211") { state =>
|
|
|
|
|
s"""set scalaVersion in ThisBuild := "$scala211" """ ::
|
|
|
|
|
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" ::
|
|
|
|
|
"so compile" ::
|
2014-12-18 23:40:20 +01:00
|
|
|
"so publishLocal" ::
|
|
|
|
|
"reload" ::
|
|
|
|
|
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" ::
|
|
|
|
|
"conscript-configs" ::
|
2014-12-18 23:40:20 +01:00
|
|
|
"so compile" ::
|
|
|
|
|
"so 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
|
|
|
|
|
}
|
|
|
|
|
)
|