mirror of https://github.com/sbt/sbt.git
Revert "Switch to varargs inThisBuild (+friends)"
This reverts commit ccf938c786.
This commit is contained in:
parent
7c2ea0f374
commit
eac7eef947
|
|
@ -135,7 +135,9 @@ object Defaults extends BuildCommon {
|
||||||
def buildCore: Seq[Setting[_]] = thisBuildCore ++ globalCore
|
def buildCore: Seq[Setting[_]] = thisBuildCore ++ globalCore
|
||||||
def thisBuildCore: Seq[Setting[_]] =
|
def thisBuildCore: Seq[Setting[_]] =
|
||||||
inScope(GlobalScope.copy(project = Select(ThisBuild)))(
|
inScope(GlobalScope.copy(project = Select(ThisBuild)))(
|
||||||
managedDirectory := baseDirectory.value / "lib_managed"
|
Seq(
|
||||||
|
managedDirectory := baseDirectory.value / "lib_managed"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
private[sbt] lazy val globalCore: Seq[Setting[_]] = globalDefaults(
|
private[sbt] lazy val globalCore: Seq[Setting[_]] = globalDefaults(
|
||||||
defaultTestTasks(test) ++ defaultTestTasks(testOnly) ++ defaultTestTasks(testQuick) ++ Seq(
|
defaultTestTasks(test) ++ defaultTestTasks(testOnly) ++ defaultTestTasks(testQuick) ++ Seq(
|
||||||
|
|
@ -303,8 +305,10 @@ object Defaults extends BuildCommon {
|
||||||
|
|
||||||
def defaultTestTasks(key: Scoped): Seq[Setting[_]] =
|
def defaultTestTasks(key: Scoped): Seq[Setting[_]] =
|
||||||
inTask(key)(
|
inTask(key)(
|
||||||
tags := Seq(Tags.Test -> 1),
|
Seq(
|
||||||
logBuffered := true
|
tags := Seq(Tags.Test -> 1),
|
||||||
|
logBuffered := true
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: This should be on the new default settings for a project.
|
// TODO: This should be on the new default settings for a project.
|
||||||
|
|
@ -761,22 +765,26 @@ object Defaults extends BuildCommon {
|
||||||
lazy val ConfigGlobal: Scope = ConfigZero
|
lazy val ConfigGlobal: Scope = ConfigZero
|
||||||
def testTaskOptions(key: Scoped): Seq[Setting[_]] =
|
def testTaskOptions(key: Scoped): Seq[Setting[_]] =
|
||||||
inTask(key)(
|
inTask(key)(
|
||||||
testListeners := {
|
Seq(
|
||||||
TestLogger.make(
|
testListeners := {
|
||||||
streams.value.log,
|
TestLogger.make(
|
||||||
closeableTestLogger(
|
streams.value.log,
|
||||||
streamsManager.value,
|
closeableTestLogger(
|
||||||
test in resolvedScoped.value.scope,
|
streamsManager.value,
|
||||||
logBuffered.value
|
test in resolvedScoped.value.scope,
|
||||||
)
|
logBuffered.value
|
||||||
) +:
|
)
|
||||||
new TestStatusReporter(succeededFile(streams.in(test).value.cacheDirectory)) +:
|
) +:
|
||||||
testListeners.in(TaskZero).value
|
new TestStatusReporter(succeededFile(streams.in(test).value.cacheDirectory)) +:
|
||||||
},
|
testListeners.in(TaskZero).value
|
||||||
testOptions := Tests.Listeners(testListeners.value) +: (testOptions in TaskZero).value,
|
},
|
||||||
testExecution := testExecutionTask(key).value
|
testOptions := Tests.Listeners(testListeners.value) +: (testOptions in TaskZero).value,
|
||||||
|
testExecution := testExecutionTask(key).value
|
||||||
|
)
|
||||||
) ++ inScope(GlobalScope)(
|
) ++ inScope(GlobalScope)(
|
||||||
derive(testGrouping := singleTestGroupDefault.value)
|
Seq(
|
||||||
|
derive(testGrouping := singleTestGroupDefault.value)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
private[this] def closeableTestLogger(manager: Streams, baseKey: Scoped, buffered: Boolean)(
|
private[this] def closeableTestLogger(manager: Streams, baseKey: Scoped, buffered: Boolean)(
|
||||||
|
|
@ -1049,24 +1057,28 @@ object Defaults extends BuildCommon {
|
||||||
|
|
||||||
lazy val packageConfig: Seq[Setting[_]] =
|
lazy val packageConfig: Seq[Setting[_]] =
|
||||||
inTask(packageBin)(
|
inTask(packageBin)(
|
||||||
packageOptions := {
|
Seq(
|
||||||
val n = name.value
|
packageOptions := {
|
||||||
val ver = version.value
|
val n = name.value
|
||||||
val org = organization.value
|
val ver = version.value
|
||||||
val orgName = organizationName.value
|
val org = organization.value
|
||||||
val main = mainClass.value
|
val orgName = organizationName.value
|
||||||
val old = packageOptions.value
|
val main = mainClass.value
|
||||||
Package.addSpecManifestAttributes(n, ver, orgName) +:
|
val old = packageOptions.value
|
||||||
Package.addImplManifestAttributes(n, ver, homepage.value, org, orgName) +:
|
Package.addSpecManifestAttributes(n, ver, orgName) +:
|
||||||
main.map(Package.MainClass.apply) ++: old
|
Package.addImplManifestAttributes(n, ver, homepage.value, org, orgName) +:
|
||||||
}
|
main.map(Package.MainClass.apply) ++: old
|
||||||
|
}
|
||||||
|
)
|
||||||
) ++
|
) ++
|
||||||
inTask(packageSrc)(
|
inTask(packageSrc)(
|
||||||
packageOptions := Package.addSpecManifestAttributes(
|
Seq(
|
||||||
name.value,
|
packageOptions := Package.addSpecManifestAttributes(
|
||||||
version.value,
|
name.value,
|
||||||
organizationName.value
|
version.value,
|
||||||
) +: packageOptions.value
|
organizationName.value
|
||||||
|
) +: packageOptions.value
|
||||||
|
)
|
||||||
) ++
|
) ++
|
||||||
packageTaskSettings(packageBin, packageBinMappings) ++
|
packageTaskSettings(packageBin, packageBinMappings) ++
|
||||||
packageTaskSettings(packageSrc, packageSrcMappings) ++
|
packageTaskSettings(packageSrc, packageSrcMappings) ++
|
||||||
|
|
@ -1154,12 +1166,14 @@ object Defaults extends BuildCommon {
|
||||||
|
|
||||||
def packageTaskSettings(key: TaskKey[File], mappingsTask: Initialize[Task[Seq[(File, String)]]]) =
|
def packageTaskSettings(key: TaskKey[File], mappingsTask: Initialize[Task[Seq[(File, String)]]]) =
|
||||||
inTask(key)(
|
inTask(key)(
|
||||||
key in TaskZero := packageTask.value,
|
Seq(
|
||||||
packageConfiguration := packageConfigurationTask.value,
|
key in TaskZero := packageTask.value,
|
||||||
mappings := mappingsTask.value,
|
packageConfiguration := packageConfigurationTask.value,
|
||||||
packagedArtifact := (artifact.value -> key.value),
|
mappings := mappingsTask.value,
|
||||||
artifact := artifactSetting.value,
|
packagedArtifact := (artifact.value -> key.value),
|
||||||
artifactPath := artifactPathSetting(artifact).value
|
artifact := artifactSetting.value,
|
||||||
|
artifactPath := artifactPathSetting(artifact).value
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def packageTask: Initialize[Task[File]] =
|
def packageTask: Initialize[Task[File]] =
|
||||||
|
|
@ -1367,49 +1381,51 @@ object Defaults extends BuildCommon {
|
||||||
|
|
||||||
def docTaskSettings(key: TaskKey[File] = doc): Seq[Setting[_]] =
|
def docTaskSettings(key: TaskKey[File] = doc): Seq[Setting[_]] =
|
||||||
inTask(key)(
|
inTask(key)(
|
||||||
apiMappings ++= {
|
Seq(
|
||||||
val dependencyCp = dependencyClasspath.value
|
apiMappings ++= {
|
||||||
val log = streams.value.log
|
val dependencyCp = dependencyClasspath.value
|
||||||
if (autoAPIMappings.value) APIMappings.extract(dependencyCp, log).toMap
|
val log = streams.value.log
|
||||||
else Map.empty[File, URL]
|
if (autoAPIMappings.value) APIMappings.extract(dependencyCp, log).toMap
|
||||||
},
|
else Map.empty[File, URL]
|
||||||
fileInputOptions := Seq("-doc-root-content", "-diagrams-dot-path"),
|
},
|
||||||
key in TaskZero := {
|
fileInputOptions := Seq("-doc-root-content", "-diagrams-dot-path"),
|
||||||
val s = streams.value
|
key in TaskZero := {
|
||||||
val cs: Compilers = compilers.value
|
val s = streams.value
|
||||||
val srcs = sources.value
|
val cs: Compilers = compilers.value
|
||||||
val out = target.value
|
val srcs = sources.value
|
||||||
val sOpts = scalacOptions.value
|
val out = target.value
|
||||||
val xapis = apiMappings.value
|
val sOpts = scalacOptions.value
|
||||||
val hasScala = srcs.exists(_.name.endsWith(".scala"))
|
val xapis = apiMappings.value
|
||||||
val hasJava = srcs.exists(_.name.endsWith(".java"))
|
val hasScala = srcs.exists(_.name.endsWith(".scala"))
|
||||||
val cp = data(dependencyClasspath.value).toList
|
val hasJava = srcs.exists(_.name.endsWith(".java"))
|
||||||
val label = nameForSrc(configuration.value.name)
|
val cp = data(dependencyClasspath.value).toList
|
||||||
val fiOpts = fileInputOptions.value
|
val label = nameForSrc(configuration.value.name)
|
||||||
val reporter = (compilerReporter in compile).value
|
val fiOpts = fileInputOptions.value
|
||||||
(hasScala, hasJava) match {
|
val reporter = (compilerReporter in compile).value
|
||||||
case (true, _) =>
|
(hasScala, hasJava) match {
|
||||||
val options = sOpts ++ Opts.doc.externalAPI(xapis)
|
case (true, _) =>
|
||||||
val runDoc = Doc.scaladoc(label, s.cacheStoreFactory sub "scala", cs.scalac match {
|
val options = sOpts ++ Opts.doc.externalAPI(xapis)
|
||||||
case ac: AnalyzingCompiler => ac.onArgs(exported(s, "scaladoc"))
|
val runDoc = Doc.scaladoc(label, s.cacheStoreFactory sub "scala", cs.scalac match {
|
||||||
}, fiOpts)
|
case ac: AnalyzingCompiler => ac.onArgs(exported(s, "scaladoc"))
|
||||||
runDoc(srcs, cp, out, options, maxErrors.value, s.log)
|
}, fiOpts)
|
||||||
case (_, true) =>
|
runDoc(srcs, cp, out, options, maxErrors.value, s.log)
|
||||||
val javadoc =
|
case (_, true) =>
|
||||||
sbt.inc.Doc.cachedJavadoc(label, s.cacheStoreFactory sub "java", cs.javaTools)
|
val javadoc =
|
||||||
javadoc.run(
|
sbt.inc.Doc.cachedJavadoc(label, s.cacheStoreFactory sub "java", cs.javaTools)
|
||||||
srcs.toList,
|
javadoc.run(
|
||||||
cp,
|
srcs.toList,
|
||||||
out,
|
cp,
|
||||||
javacOptions.value.toList,
|
out,
|
||||||
IncToolOptionsUtil.defaultIncToolOptions(),
|
javacOptions.value.toList,
|
||||||
s.log,
|
IncToolOptionsUtil.defaultIncToolOptions(),
|
||||||
reporter
|
s.log,
|
||||||
)
|
reporter
|
||||||
case _ => () // do nothing
|
)
|
||||||
|
case _ => () // do nothing
|
||||||
|
}
|
||||||
|
out
|
||||||
}
|
}
|
||||||
out
|
)
|
||||||
}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
def mainBgRunTask = mainBgRunTaskForConfig(Select(Runtime))
|
def mainBgRunTask = mainBgRunTaskForConfig(Select(Runtime))
|
||||||
|
|
@ -1710,13 +1726,15 @@ object Defaults extends BuildCommon {
|
||||||
// build.sbt is treated a Scala source of metabuild, so to enable deprecation flag on build.sbt we set the option here.
|
// build.sbt is treated a Scala source of metabuild, so to enable deprecation flag on build.sbt we set the option here.
|
||||||
lazy val deprecationSettings: Seq[Setting[_]] =
|
lazy val deprecationSettings: Seq[Setting[_]] =
|
||||||
inConfig(Compile)(
|
inConfig(Compile)(
|
||||||
scalacOptions := {
|
Seq(
|
||||||
val old = scalacOptions.value
|
scalacOptions := {
|
||||||
val existing = old.toSet
|
val old = scalacOptions.value
|
||||||
val d = "-deprecation"
|
val existing = old.toSet
|
||||||
if (sbtPlugin.value && !existing(d)) d :: old.toList
|
val d = "-deprecation"
|
||||||
else old
|
if (sbtPlugin.value && !existing(d)) d :: old.toList
|
||||||
}
|
else old
|
||||||
|
}
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
object Classpaths {
|
object Classpaths {
|
||||||
|
|
@ -2258,82 +2276,84 @@ object Classpaths {
|
||||||
def sbtClassifiersTasks =
|
def sbtClassifiersTasks =
|
||||||
sbtClassifiersGlobalDefaults ++
|
sbtClassifiersGlobalDefaults ++
|
||||||
inTask(updateSbtClassifiers)(
|
inTask(updateSbtClassifiers)(
|
||||||
externalResolvers := {
|
Seq(
|
||||||
val explicit = buildStructure.value
|
externalResolvers := {
|
||||||
.units(thisProjectRef.value.build)
|
val explicit = buildStructure.value
|
||||||
.unit
|
.units(thisProjectRef.value.build)
|
||||||
.plugins
|
.unit
|
||||||
.pluginData
|
.plugins
|
||||||
.resolvers
|
.pluginData
|
||||||
explicit orElse bootRepositories(appConfiguration.value) getOrElse externalResolvers.value
|
.resolvers
|
||||||
},
|
explicit orElse bootRepositories(appConfiguration.value) getOrElse externalResolvers.value
|
||||||
ivyConfiguration := InlineIvyConfiguration(
|
},
|
||||||
paths = ivyPaths.value,
|
ivyConfiguration := InlineIvyConfiguration(
|
||||||
resolvers = externalResolvers.value.toVector,
|
paths = ivyPaths.value,
|
||||||
otherResolvers = Vector.empty,
|
resolvers = externalResolvers.value.toVector,
|
||||||
moduleConfigurations = Vector.empty,
|
otherResolvers = Vector.empty,
|
||||||
lock = Option(lock(appConfiguration.value)),
|
moduleConfigurations = Vector.empty,
|
||||||
checksums = checksums.value.toVector,
|
lock = Option(lock(appConfiguration.value)),
|
||||||
managedChecksums = false,
|
checksums = checksums.value.toVector,
|
||||||
resolutionCacheDir = Some(crossTarget.value / "resolution-cache"),
|
managedChecksums = false,
|
||||||
updateOptions = UpdateOptions(),
|
resolutionCacheDir = Some(crossTarget.value / "resolution-cache"),
|
||||||
log = streams.value.log
|
updateOptions = UpdateOptions(),
|
||||||
),
|
log = streams.value.log
|
||||||
ivySbt := ivySbt0.value,
|
),
|
||||||
classifiersModule := classifiersModuleTask.value,
|
ivySbt := ivySbt0.value,
|
||||||
// Redefine scalaVersion and scalaBinaryVersion specifically for the dependency graph used for updateSbtClassifiers task.
|
classifiersModule := classifiersModuleTask.value,
|
||||||
// to fix https://github.com/sbt/sbt/issues/2686
|
// Redefine scalaVersion and scalaBinaryVersion specifically for the dependency graph used for updateSbtClassifiers task.
|
||||||
scalaVersion := appConfiguration.value.provider.scalaProvider.version,
|
// to fix https://github.com/sbt/sbt/issues/2686
|
||||||
scalaBinaryVersion := binaryScalaVersion(scalaVersion.value),
|
scalaVersion := appConfiguration.value.provider.scalaProvider.version,
|
||||||
scalaModuleInfo := {
|
scalaBinaryVersion := binaryScalaVersion(scalaVersion.value),
|
||||||
Some(
|
scalaModuleInfo := {
|
||||||
ScalaModuleInfo(
|
Some(
|
||||||
scalaVersion.value,
|
ScalaModuleInfo(
|
||||||
scalaBinaryVersion.value,
|
scalaVersion.value,
|
||||||
Vector(),
|
scalaBinaryVersion.value,
|
||||||
checkExplicit = false,
|
Vector(),
|
||||||
filterImplicit = false,
|
checkExplicit = false,
|
||||||
overrideScalaVersion = true
|
filterImplicit = false,
|
||||||
).withScalaOrganization(scalaOrganization.value)
|
overrideScalaVersion = true
|
||||||
)
|
).withScalaOrganization(scalaOrganization.value)
|
||||||
},
|
)
|
||||||
dependencyResolution := IvyDependencyResolution(ivyConfiguration.value),
|
},
|
||||||
updateSbtClassifiers in TaskGlobal := (Def.task {
|
dependencyResolution := IvyDependencyResolution(ivyConfiguration.value),
|
||||||
val lm = dependencyResolution.value
|
updateSbtClassifiers in TaskGlobal := (Def.task {
|
||||||
val s = streams.value
|
val lm = dependencyResolution.value
|
||||||
val is = ivySbt.value
|
val s = streams.value
|
||||||
val mod = classifiersModule.value
|
val is = ivySbt.value
|
||||||
val c = updateConfiguration.value
|
val mod = classifiersModule.value
|
||||||
val app = appConfiguration.value
|
val c = updateConfiguration.value
|
||||||
val srcTypes = sourceArtifactTypes.value
|
val app = appConfiguration.value
|
||||||
val docTypes = docArtifactTypes.value
|
val srcTypes = sourceArtifactTypes.value
|
||||||
val log = s.log
|
val docTypes = docArtifactTypes.value
|
||||||
val out = is.withIvy(log)(_.getSettings.getDefaultIvyUserDir)
|
val log = s.log
|
||||||
val uwConfig = (unresolvedWarningConfiguration in update).value
|
val out = is.withIvy(log)(_.getSettings.getDefaultIvyUserDir)
|
||||||
val depDir = dependencyCacheDirectory.value
|
val uwConfig = (unresolvedWarningConfiguration in update).value
|
||||||
val ivy = scalaModuleInfo.value
|
val depDir = dependencyCacheDirectory.value
|
||||||
val st = state.value
|
val ivy = scalaModuleInfo.value
|
||||||
withExcludes(out, mod.classifiers, lock(app)) {
|
val st = state.value
|
||||||
excludes =>
|
withExcludes(out, mod.classifiers, lock(app)) {
|
||||||
// val noExplicitCheck = ivy.map(_.withCheckExplicit(false))
|
excludes =>
|
||||||
LibraryManagement.transitiveScratch(
|
// val noExplicitCheck = ivy.map(_.withCheckExplicit(false))
|
||||||
lm,
|
LibraryManagement.transitiveScratch(
|
||||||
"sbt",
|
lm,
|
||||||
GetClassifiersConfiguration(
|
"sbt",
|
||||||
mod,
|
GetClassifiersConfiguration(
|
||||||
excludes.toVector,
|
mod,
|
||||||
c.withArtifactFilter(c.artifactFilter.map(af => af.withInverted(!af.inverted))),
|
excludes.toVector,
|
||||||
srcTypes.toVector,
|
c.withArtifactFilter(c.artifactFilter.map(af => af.withInverted(!af.inverted))),
|
||||||
docTypes.toVector
|
srcTypes.toVector,
|
||||||
),
|
docTypes.toVector
|
||||||
uwConfig,
|
),
|
||||||
log
|
uwConfig,
|
||||||
) match {
|
log
|
||||||
case Left(_) => ???
|
) match {
|
||||||
case Right(ur) => ur
|
case Left(_) => ???
|
||||||
}
|
case Right(ur) => ur
|
||||||
}
|
}
|
||||||
} tag (Tags.Update, Tags.Network)).value
|
}
|
||||||
|
} tag (Tags.Update, Tags.Network)).value
|
||||||
|
)
|
||||||
) ++ Seq(bootIvyConfiguration := (ivyConfiguration in updateSbtClassifiers).value)
|
) ++ Seq(bootIvyConfiguration := (ivyConfiguration in updateSbtClassifiers).value)
|
||||||
|
|
||||||
def classifiersModuleTask: Initialize[Task[GetClassifiersModule]] =
|
def classifiersModuleTask: Initialize[Task[GetClassifiersModule]] =
|
||||||
|
|
@ -3457,7 +3477,7 @@ trait BuildExtra extends BuildCommon with DefExtra {
|
||||||
* This is useful for reducing test:compile time when not running test.
|
* This is useful for reducing test:compile time when not running test.
|
||||||
*/
|
*/
|
||||||
def noTestCompletion(config: Configuration = Test): Setting[_] =
|
def noTestCompletion(config: Configuration = Test): Setting[_] =
|
||||||
inConfig(config)(definedTests := detectTests.value).head
|
inConfig(config)(Seq(definedTests := detectTests.value)).head
|
||||||
|
|
||||||
def filterKeys(ss: Seq[Setting[_]], transitive: Boolean = false)(
|
def filterKeys(ss: Seq[Setting[_]], transitive: Boolean = false)(
|
||||||
f: ScopedKey[_] => Boolean
|
f: ScopedKey[_] => Boolean
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ private[sbt] object PluginCross {
|
||||||
val add = List(sbtVersion in GlobalScope in pluginCrossBuild :== version) ++
|
val add = List(sbtVersion in GlobalScope in pluginCrossBuild :== version) ++
|
||||||
List(scalaVersion := scalaVersionSetting.value) ++
|
List(scalaVersion := scalaVersionSetting.value) ++
|
||||||
inScope(GlobalScope.copy(project = Select(currentRef)))(
|
inScope(GlobalScope.copy(project = Select(currentRef)))(
|
||||||
scalaVersion := scalaVersionSetting.value
|
Seq(scalaVersion := scalaVersionSetting.value)
|
||||||
)
|
)
|
||||||
val cleared = session.mergeSettings.filterNot(crossExclude)
|
val cleared = session.mergeSettings.filterNot(crossExclude)
|
||||||
val newStructure = Load.reapply(cleared ++ add, structure, state.log)
|
val newStructure = Load.reapply(cleared ++ add, structure, state.log)
|
||||||
|
|
|
||||||
|
|
@ -106,11 +106,13 @@ object GlobalPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
val globalPluginSettings = Project.inScope(Scope.GlobalScope in LocalRootProject)(
|
val globalPluginSettings = Project.inScope(Scope.GlobalScope in LocalRootProject)(
|
||||||
organization := SbtArtifacts.Organization,
|
Seq(
|
||||||
onLoadMessage := Keys.baseDirectory("Loading global plugins from " + _).value,
|
organization := SbtArtifacts.Organization,
|
||||||
name := "global-plugin",
|
onLoadMessage := Keys.baseDirectory("Loading global plugins from " + _).value,
|
||||||
sbtPlugin := true,
|
name := "global-plugin",
|
||||||
version := "0.0"
|
sbtPlugin := true,
|
||||||
|
version := "0.0"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
final case class GlobalPluginData(
|
final case class GlobalPluginData(
|
||||||
|
|
|
||||||
|
|
@ -1189,20 +1189,22 @@ private[sbt] object Load {
|
||||||
|
|
||||||
/** These are the settings defined when loading a project "meta" build. */
|
/** These are the settings defined when loading a project "meta" build. */
|
||||||
val autoPluginSettings: Seq[Setting[_]] = inScope(GlobalScope in LocalRootProject)(
|
val autoPluginSettings: Seq[Setting[_]] = inScope(GlobalScope in LocalRootProject)(
|
||||||
sbtPlugin :== true,
|
Seq(
|
||||||
pluginData := {
|
sbtPlugin :== true,
|
||||||
val prod = (exportedProducts in Configurations.Runtime).value
|
pluginData := {
|
||||||
val cp = (fullClasspath in Configurations.Runtime).value
|
val prod = (exportedProducts in Configurations.Runtime).value
|
||||||
val opts = (scalacOptions in Configurations.Compile).value
|
val cp = (fullClasspath in Configurations.Runtime).value
|
||||||
PluginData(
|
val opts = (scalacOptions in Configurations.Compile).value
|
||||||
removeEntries(cp, prod),
|
PluginData(
|
||||||
prod,
|
removeEntries(cp, prod),
|
||||||
Some(fullResolvers.value.toVector),
|
prod,
|
||||||
Some(update.value),
|
Some(fullResolvers.value.toVector),
|
||||||
opts
|
Some(update.value),
|
||||||
)
|
opts
|
||||||
},
|
)
|
||||||
onLoadMessage := ("Loading project definition from " + baseDirectory.value)
|
},
|
||||||
|
onLoadMessage := ("Loading project definition from " + baseDirectory.value)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
private[this] def removeEntries(
|
private[this] def removeEntries(
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
inThisBuild(
|
inThisBuild(List(
|
||||||
crossScalaVersions := Seq("2.12.1", "2.11.8")
|
crossScalaVersions := Seq("2.12.1", "2.11.8")
|
||||||
)
|
))
|
||||||
|
|
||||||
lazy val rootProj = (project in file("."))
|
lazy val rootProj = (project in file("."))
|
||||||
.aggregate(libProj, fooPlugin)
|
.aggregate(libProj, fooPlugin)
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ x in subA in Compile := {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inConfig(Compile)(
|
inConfig(Compile)(Seq(
|
||||||
y in subB := {
|
y in subB := {
|
||||||
// verify that the referenced key gets delegated
|
// verify that the referenced key gets delegated
|
||||||
val xty = (x in Test in y).previous getOrElse 0 // 13
|
val xty = (x in Test in y).previous getOrElse 0 // 13
|
||||||
|
|
@ -31,7 +31,7 @@ inConfig(Compile)(
|
||||||
println(s"xcy=$xcy, xty=$xty")
|
println(s"xcy=$xcy, xty=$xty")
|
||||||
xty * xcy
|
xty * xcy
|
||||||
}
|
}
|
||||||
)
|
))
|
||||||
|
|
||||||
def parser = {
|
def parser = {
|
||||||
import complete.DefaultParsers._
|
import complete.DefaultParsers._
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ dependencyOverrides in ThisBuild += "com.github.nscala-time" %% "nscala-time" %
|
||||||
lazy val root = (project in file("."))
|
lazy val root = (project in file("."))
|
||||||
.dependsOn(p1 % Compile)
|
.dependsOn(p1 % Compile)
|
||||||
.settings(
|
.settings(
|
||||||
inThisBuild(
|
inThisBuild(List(
|
||||||
organizationName := "eed3si9n",
|
organizationName := "eed3si9n",
|
||||||
organizationHomepage := Some(url("http://example.com/")),
|
organizationHomepage := Some(url("http://example.com/")),
|
||||||
homepage := Some(url("https://github.com/example/example")),
|
homepage := Some(url("https://github.com/example/example")),
|
||||||
|
|
@ -20,7 +20,7 @@ lazy val root = (project in file("."))
|
||||||
version := "0.3.1-SNAPSHOT",
|
version := "0.3.1-SNAPSHOT",
|
||||||
description := "An HTTP client for Scala with Async Http Client underneath.",
|
description := "An HTTP client for Scala with Async Http Client underneath.",
|
||||||
licenses := Seq("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")),
|
licenses := Seq("Apache 2" -> new URL("http://www.apache.org/licenses/LICENSE-2.0.txt")),
|
||||||
),
|
)),
|
||||||
ivyPaths := IvyPaths(
|
ivyPaths := IvyPaths(
|
||||||
(baseDirectory in ThisBuild).value,
|
(baseDirectory in ThisBuild).value,
|
||||||
Some((baseDirectory in LocalRootProject).value / "ivy-cache")
|
Some((baseDirectory in LocalRootProject).value / "ivy-cache")
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ lazy val c = project.
|
||||||
|
|
||||||
lazy val root = (project in file(".")).
|
lazy val root = (project in file(".")).
|
||||||
settings(commonSettings).
|
settings(commonSettings).
|
||||||
settings(inThisBuild(
|
settings(inThisBuild(Seq(
|
||||||
organization := "org.example",
|
organization := "org.example",
|
||||||
version := "1.0-SNAPSHOT",
|
version := "1.0-SNAPSHOT",
|
||||||
updateOptions := updateOptions.value.withCachedResolution(true)
|
updateOptions := updateOptions.value.withCachedResolution(true)
|
||||||
))
|
)))
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
// https://github.com/sbt/sbt/issues/1710
|
// https://github.com/sbt/sbt/issues/1710
|
||||||
// https://github.com/sbt/sbt/issues/1760
|
// https://github.com/sbt/sbt/issues/1760
|
||||||
|
|
||||||
inThisBuild(
|
inThisBuild(Seq(
|
||||||
organization := "com.example",
|
organization := "com.example",
|
||||||
version := "0.1.0",
|
version := "0.1.0",
|
||||||
scalaVersion := "2.10.4",
|
scalaVersion := "2.10.4",
|
||||||
updateOptions := updateOptions.value.withCachedResolution(true)
|
updateOptions := updateOptions.value.withCachedResolution(true)
|
||||||
)
|
))
|
||||||
|
|
||||||
def commonSettings: Seq[Def.Setting[_]] = Seq(
|
def commonSettings: Seq[Def.Setting[_]] = Seq(
|
||||||
ivyPaths := IvyPaths((baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")),
|
ivyPaths := IvyPaths((baseDirectory in ThisBuild).value, Some((baseDirectory in LocalRootProject).value / "ivy-cache")),
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ lazy val b = project.
|
||||||
|
|
||||||
lazy val root = (project in file(".")).
|
lazy val root = (project in file(".")).
|
||||||
aggregate(a, b).
|
aggregate(a, b).
|
||||||
settings(inThisBuild(
|
settings(inThisBuild(Seq(
|
||||||
organization := "org.example",
|
organization := "org.example",
|
||||||
version := "1.0",
|
version := "1.0",
|
||||||
updateOptions := updateOptions.value.withCachedResolution(true),
|
updateOptions := updateOptions.value.withCachedResolution(true),
|
||||||
|
|
@ -45,4 +45,4 @@ lazy val root = (project in file(".")).
|
||||||
sys.error("commons-io NOT found when it should NOT be excluded")
|
sys.error("commons-io NOT found when it should NOT be excluded")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
))
|
)))
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ lazy val a = project.
|
||||||
|
|
||||||
lazy val root = (project in file(".")).
|
lazy val root = (project in file(".")).
|
||||||
aggregate(a).
|
aggregate(a).
|
||||||
settings(inThisBuild(
|
settings(inThisBuild(Seq(
|
||||||
organization := "org.example",
|
organization := "org.example",
|
||||||
version := "1.0",
|
version := "1.0",
|
||||||
updateOptions := updateOptions.value.withCachedResolution(true),
|
updateOptions := updateOptions.value.withCachedResolution(true),
|
||||||
|
|
@ -49,4 +49,4 @@ lazy val root = (project in file(".")).
|
||||||
sys.error("junit NOT found when it should be included: " + atestcp.toString)
|
sys.error("junit NOT found when it should be included: " + atestcp.toString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
))
|
)))
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,12 @@ lazy val p1 = (project in file("p1")).
|
||||||
settings(
|
settings(
|
||||||
checkTask(expectedMongo),
|
checkTask(expectedMongo),
|
||||||
libraryDependencies += "org.mongodb" %% "casbah" % "2.4.1" pomOnly(),
|
libraryDependencies += "org.mongodb" %% "casbah" % "2.4.1" pomOnly(),
|
||||||
inThisBuild(
|
inThisBuild(List(
|
||||||
organization := "org.example",
|
organization := "org.example",
|
||||||
version := "1.0",
|
version := "1.0",
|
||||||
scalaVersion := "2.9.2",
|
scalaVersion := "2.9.2",
|
||||||
autoScalaLibrary := false
|
autoScalaLibrary := false
|
||||||
)
|
))
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val p2 = (project in file("p2")).
|
lazy val p2 = (project in file("p2")).
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,12 @@
|
||||||
lazy val root = (project in file(".")).
|
lazy val root = (project in file(".")).
|
||||||
dependsOn(sub).
|
dependsOn(sub).
|
||||||
aggregate(sub).
|
aggregate(sub).
|
||||||
settings(inThisBuild(
|
settings(inThisBuild(List(
|
||||||
organization := "A",
|
organization := "A",
|
||||||
version := "1.0",
|
version := "1.0",
|
||||||
ivyPaths := baseDirectory( dir => IvyPaths(dir, Some(dir / "ivy" / "cache")) ).value,
|
ivyPaths := baseDirectory( dir => IvyPaths(dir, Some(dir / "ivy" / "cache")) ).value,
|
||||||
externalResolvers := (baseDirectory map { base => Resolver.file("local", base / "ivy" / "local" asFile)(Resolver.ivyStylePatterns) :: Nil }).value
|
externalResolvers := (baseDirectory map { base => Resolver.file("local", base / "ivy" / "local" asFile)(Resolver.ivyStylePatterns) :: Nil }).value
|
||||||
),
|
)),
|
||||||
mavenStyle,
|
mavenStyle,
|
||||||
interProject,
|
interProject,
|
||||||
name := "Publish Test"
|
name := "Publish Test"
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
lazy val root = (project in file(".")).
|
lazy val root = (project in file(".")).
|
||||||
settings(inThisBuild(
|
settings(inThisBuild(List(
|
||||||
organization := "A",
|
organization := "A",
|
||||||
version := "1.0",
|
version := "1.0",
|
||||||
ivyPaths := baseDirectory( dir => IvyPaths(dir, Some(dir / "ivy" / "cache")) ).value,
|
ivyPaths := baseDirectory( dir => IvyPaths(dir, Some(dir / "ivy" / "cache")) ).value,
|
||||||
externalResolvers := (baseDirectory map { base => Resolver.file("local", base / "ivy" / "local" asFile)(Resolver.ivyStylePatterns) :: Nil }).value
|
externalResolvers := (baseDirectory map { base => Resolver.file("local", base / "ivy" / "local" asFile)(Resolver.ivyStylePatterns) :: Nil }).value
|
||||||
),
|
)),
|
||||||
mavenStyle,
|
mavenStyle,
|
||||||
name := "Retrieve Test",
|
name := "Retrieve Test",
|
||||||
libraryDependencies := (publishMavenStyle { style => if(style) mavenStyleDependencies else ivyStyleDependencies }).value
|
libraryDependencies := (publishMavenStyle { style => if(style) mavenStyleDependencies else ivyStyleDependencies }).value
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ globalDepE in Global := "globalE"
|
||||||
// ---------------- Derived settings
|
// ---------------- Derived settings
|
||||||
|
|
||||||
// verify that deriving is transitive
|
// verify that deriving is transitive
|
||||||
inScope(GlobalScope)(
|
inScope(GlobalScope)(Seq(
|
||||||
Def.derive(customA := customB.value + "-a"),
|
Def.derive(customA := customB.value + "-a"),
|
||||||
Def.derive(customB := thisProject.value.id + "-b"),
|
Def.derive(customB := thisProject.value.id + "-b"),
|
||||||
// verify that a setting with multiple triggers still only gets added once
|
// verify that a setting with multiple triggers still only gets added once
|
||||||
|
|
@ -36,7 +36,7 @@ inScope(GlobalScope)(
|
||||||
// if customE were added in Global because of name, there would be an error
|
// if customE were added in Global because of name, there would be an error
|
||||||
// because description wouldn't be found
|
// because description wouldn't be found
|
||||||
Def.derive(customE := globalDepE.value + "-" + projectDepE.value)
|
Def.derive(customE := globalDepE.value + "-" + projectDepE.value)
|
||||||
)
|
))
|
||||||
|
|
||||||
// ---------------- Projects
|
// ---------------- Projects
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
scalaVersion in ThisBuild := "2.11.8"
|
scalaVersion in ThisBuild := "2.11.8"
|
||||||
concurrentRestrictions in Global := Seq(Tags.limitAll(4))
|
concurrentRestrictions in Global := Seq(Tags.limitAll(4))
|
||||||
libraryDependencies += "org.specs2" %% "specs2-core" % "3.8.4" % Test
|
libraryDependencies += "org.specs2" %% "specs2-core" % "3.8.4" % Test
|
||||||
inConfig(Test)(
|
inConfig(Test)(Seq(
|
||||||
testGrouping := {
|
testGrouping := {
|
||||||
val home = javaHome.value
|
val home = javaHome.value
|
||||||
val strategy = outputStrategy.value
|
val strategy = outputStrategy.value
|
||||||
|
|
@ -22,4 +22,4 @@ inConfig(Test)(
|
||||||
))}
|
))}
|
||||||
},
|
},
|
||||||
TaskKey[Unit]("test-failure") := test.failure.value
|
TaskKey[Unit]("test-failure") := test.failure.value
|
||||||
)
|
))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue