mirror of https://github.com/sbt/sbt.git
Use sbt 0.13.0 to build the 0.13 branch.
This commit is contained in:
parent
eb884eacd1
commit
005384f9af
|
|
@ -41,7 +41,7 @@ object LaunchProguard
|
|||
artifactPath <<= (target, version) { (out,v) => out / ("sbt-launch-" + v + ".jar") },
|
||||
options <++= (dependencyClasspath in (launchSub, Compile), compile in (launchSub,Compile), streams) map { (cp, analysis, s) => mapJars(cp.files, analysis.relations.allBinaryDeps.toSeq, s.log) },
|
||||
options <+= packageBin map { f => "-injars " + mkpath(f) },
|
||||
packageBin <<= (packageBin in (launchSub, Compile)).identity,
|
||||
packageBin := (packageBin in (launchSub, Compile)).value,
|
||||
options <++= mainClass in (launchSub, Compile) map { _.toList map(s => keepMain.format(s)) },
|
||||
options <+= artifactPath map { p => "-outjars " + mkpath(p) },
|
||||
fullClasspath <<= (configuration, classpathTypes, update) map Classpaths.managedJars
|
||||
|
|
|
|||
|
|
@ -13,10 +13,10 @@ object Release extends Build
|
|||
|
||||
val PublishRepoHost = "private-repo.typesafe.com"
|
||||
|
||||
def settings(nonRoots: => Seq[ProjectReference], launcher: ScopedTask[File]): Seq[Setting[_]] =
|
||||
def settings(nonRoots: => Seq[ProjectReference], launcher: TaskKey[File]): Seq[Setting[_]] =
|
||||
if(CredentialsFile.exists) releaseSettings(nonRoots, launcher) else Nil
|
||||
|
||||
def releaseSettings(nonRoots: => Seq[ProjectReference], launcher: ScopedTask[File]): Seq[Setting[_]] = Seq(
|
||||
def releaseSettings(nonRoots: => Seq[ProjectReference], launcher: TaskKey[File]): Seq[Setting[_]] = Seq(
|
||||
publishTo in ThisBuild <<= publishResolver,
|
||||
remoteID <<= publishStatus("typesafe-ivy-" + _),
|
||||
credentials in ThisBuild += Credentials(CredentialsFile),
|
||||
|
|
@ -36,7 +36,7 @@ object Release extends Build
|
|||
// this is no longer strictly necessary, since the launcher is now published as normal
|
||||
// however, existing scripts expect the launcher to be in a certain place and normal publishing adds "jars/"
|
||||
// to the published path
|
||||
def deployLauncher(launcher: ScopedTask[File]) =
|
||||
def deployLauncher(launcher: TaskKey[File]) =
|
||||
(launcher, launcherRemotePath, credentials, remoteBase, streams) map { (launchJar, remotePath, creds, base, s) =>
|
||||
val (uname, pwd) = getCredentials(creds, s.log)
|
||||
val request = dispatch.classic.url(base) / remotePath <<< (launchJar, "binary/octet-stream") as (uname, pwd)
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ object Sbt extends Build
|
|||
/* ** Subproject declarations ** */
|
||||
|
||||
// defines the Java interfaces through which the launcher and the launched application communicate
|
||||
lazy val launchInterfaceSub = project(launchPath / "interface", "Launcher Interface") settings(javaOnly : _*)
|
||||
lazy val launchInterfaceSub = minProject(launchPath / "interface", "Launcher Interface") settings(javaOnly : _*)
|
||||
// the launcher. Retrieves, loads, and runs applications based on a configuration file.
|
||||
lazy val launchSub = testedBaseProject(launchPath, "Launcher") dependsOn(ioSub % "test->test", interfaceSub % "test", launchInterfaceSub) settings(launchSettings : _*)
|
||||
|
||||
|
|
@ -44,7 +44,7 @@ object Sbt extends Build
|
|||
// defines Java structures used across Scala versions, such as the API structures and relationships extracted by
|
||||
// the analysis compiler phases and passed back to sbt. The API structures are defined in a simple
|
||||
// format from which Java sources are generated by the datatype generator subproject
|
||||
lazy val interfaceSub = project(file("interface"), "Interface") settings(interfaceSettings : _*)
|
||||
lazy val interfaceSub = minProject(file("interface"), "Interface") settings(interfaceSettings : _*)
|
||||
|
||||
// defines operations on the API of a source, including determining whether it has changed and converting it to a string
|
||||
// and discovery of subclasses and annotations
|
||||
|
|
@ -81,7 +81,7 @@ object Sbt extends Build
|
|||
// Runner for uniform test interface
|
||||
lazy val testingSub = baseProject(file("testing"), "Testing") dependsOn(ioSub, classpathSub, logSub, launchInterfaceSub, testAgentSub) settings(testInterface)
|
||||
// Testing agent for running tests in a separate process.
|
||||
lazy val testAgentSub = project(file("testing/agent"), "Test Agent") settings(testInterface)
|
||||
lazy val testAgentSub = minProject(file("testing/agent"), "Test Agent") settings(testInterface)
|
||||
|
||||
// Basic task engine
|
||||
lazy val taskSub = testedBaseProject(tasksPath, "Tasks") dependsOn(controlSub, collectionSub)
|
||||
|
|
@ -186,8 +186,8 @@ object Sbt extends Build
|
|||
lazy val publishAll = TaskKey[Unit]("publish-all")
|
||||
lazy val publishLauncher = TaskKey[Unit]("publish-launcher")
|
||||
|
||||
def deepTasks[T](scoped: ScopedTask[Seq[T]]): Initialize[Task[Seq[T]]] = deep(scoped.task) { _.join.map(_.flatten.distinct) }
|
||||
def deep[T](scoped: ScopedSetting[T]): Initialize[Seq[T]] =
|
||||
def deepTasks[T](scoped: TaskKey[Seq[T]]): Initialize[Task[Seq[T]]] = deep(scoped.task) { _.join.map(_.flatten.distinct) }
|
||||
def deep[T](scoped: SettingKey[T]): Initialize[Seq[T]] =
|
||||
Util.inAllProjects(projects filterNot Set(root, sbtSub, scriptedBaseSub, scriptedSbtSub, scriptedPluginSub) map { p => LocalProject(p.id) }, scoped)
|
||||
|
||||
def launchSettings =
|
||||
|
|
@ -211,7 +211,7 @@ object Sbt extends Build
|
|||
sources in sxr <<= deepTasks(sources in Compile),
|
||||
Sxr.sourceDirectories <<= deep(sourceDirectories in Compile).map(_.flatten),
|
||||
fullClasspath in sxr <<= (externalDependencyClasspath in Compile in sbtSub),
|
||||
compileInputs in (Compile,sxr) <<= (sources in sxr, compileInputs in sbtSub in Compile, fullClasspath in sxr, scalacOptions) map { (srcs, in, cp, opts) =>
|
||||
compileInputs in (Compile,sxr) <<= (sources in sxr, compileInputs in (sbtSub, Compile, compile), fullClasspath in sxr, scalacOptions) map { (srcs, in, cp, opts) =>
|
||||
in.copy(config = in.config.copy(sources = srcs, classpath = cp.files))
|
||||
},
|
||||
compileInputs in (Compile,doc) <<= (compileInputs in (Compile,sxr), scalacOptions in doc) map { (ci, opts) =>
|
||||
|
|
@ -252,7 +252,6 @@ object Sbt extends Build
|
|||
target <<= (target, scalaVersion) { (base, sv) => base / ("precompiled_" + sv) },
|
||||
scalacOptions := Nil,
|
||||
ivyScala ~= { _.map(_.copy(checkExplicit = false, overrideScalaVersion = false)) },
|
||||
conflictWarning ~= { _.copy(filter = const(false)) },
|
||||
exportedProducts in Compile := Nil,
|
||||
exportedProducts in Test := Nil,
|
||||
libraryDependencies <+= scalaVersion( "org.scala-lang" % "scala-compiler" % _ % "provided")
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ object Sxr
|
|||
scalacOptions <+= sourceDirectories map { "-P:sxr:base-directory:" + _.absString },
|
||||
scalacOptions <+= managedClasspath map { "-Xplugin:" + _.files.absString },
|
||||
scalacOptions in doc += "-Ymacro-no-expand",
|
||||
scaladocOptions <<= scalacOptions,
|
||||
target <<= target in taskGlobal apply { _ / "browse" },
|
||||
sxr in taskGlobal <<= sxrTask
|
||||
)
|
||||
|
|
|
|||
|
|
@ -11,18 +11,20 @@ object Util
|
|||
lazy val nightly211 = SettingKey[Boolean]("nightly-211")
|
||||
lazy val includeTestDependencies = SettingKey[Boolean]("includeTestDependencies", "Doesn't declare test dependencies.")
|
||||
|
||||
def inAll(projects: => Seq[ProjectReference], key: ScopedSetting[Task[Unit]]): Project.Initialize[Task[Unit]] =
|
||||
def inAll(projects: => Seq[ProjectReference], key: SettingKey[Task[Unit]]): Project.Initialize[Task[Unit]] =
|
||||
inAllProjects(projects, key) { deps => nop dependsOn( deps : _*) }
|
||||
|
||||
def inAllProjects[T](projects: => Seq[ProjectReference], key: ScopedSetting[T]): Project.Initialize[Seq[T]] =
|
||||
Project.bind( (loadedBuild, thisProjectRef).identity ) { case (lb, pr) =>
|
||||
def inAllProjects[T](projects: => Seq[ProjectReference], key: SettingKey[T]): Project.Initialize[Seq[T]] =
|
||||
Def.settingDyn {
|
||||
val lb = loadedBuild.value
|
||||
val pr = thisProjectRef.value
|
||||
def resolve(ref: ProjectReference): ProjectRef = Scope.resolveProjectRef(pr.build, Load.getRootProject(lb.units), ref)
|
||||
val refs = projects flatMap { base => Defaults.transitiveDependencies(resolve(base.project), lb, includeRoot=true, classpath=true, aggregate=true) }
|
||||
refs map ( ref => (key in ref).? ) joinWith(_ flatMap { x => x})
|
||||
}
|
||||
|
||||
def noPublish(p: Project) = p.copy(settings = noRemotePublish(p.settings))
|
||||
def noRemotePublish(in: Seq[Setting[_]]) = in filterNot { s => s.key == deliver || s.key == publish }
|
||||
def noRemotePublish(in: Seq[Setting[_]]) = in filterNot { _.key.key == publish.key }
|
||||
|
||||
def nightlySettings = Seq(
|
||||
nightly211 <<= scalaVersion(_.startsWith("2.11.")),
|
||||
|
|
@ -32,8 +34,8 @@ object Util
|
|||
crossVersion in update <<= (crossVersion,nightly211) { (cv, n) => if(n) CrossVersion.full else cv },
|
||||
name := nameString
|
||||
)
|
||||
def project(path: File, nameString: String) = Project(normalize(nameString), path) settings( commonSettings(nameString) ++ publishPomSettings : _* )
|
||||
def baseProject(path: File, nameString: String) = project(path, nameString) settings( base : _*)
|
||||
def minProject(path: File, nameString: String) = Project(normalize(nameString), path) settings( commonSettings(nameString) ++ publishPomSettings : _* )
|
||||
def baseProject(path: File, nameString: String) = minProject(path, nameString) settings( base : _*)
|
||||
def testedBaseProject(path: File, nameString: String) = baseProject(path, nameString) settings(testDependencies)
|
||||
|
||||
lazy val javaOnly = Seq[Setting[_]](/*crossPaths := false, */compileOrder := CompileOrder.JavaThenScala, unmanagedSourceDirectories in Compile <<= Seq(javaSource in Compile).join)
|
||||
|
|
@ -55,7 +57,7 @@ object Util
|
|||
else Seq()
|
||||
}
|
||||
|
||||
lazy val minimalSettings: Seq[Setting[_]] = Defaults.paths ++ Seq[Setting[_]](crossTarget <<= target.identity, name <<= thisProject(_.id))
|
||||
lazy val minimalSettings: Seq[Setting[_]] = Defaults.paths ++ Seq[Setting[_]](crossTarget := target.value, name <<= thisProject(_.id))
|
||||
|
||||
def projectComponent = projectID <<= (projectID, componentID) { (pid, cid) =>
|
||||
cid match { case Some(id) => pid extra("e:component" -> id); case None => pid }
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
sbt.version=0.12.4
|
||||
sbt.version=0.13.0
|
||||
|
|
|
|||
|
|
@ -7,4 +7,4 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "0.7.1")
|
|||
|
||||
resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven"
|
||||
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.0")
|
||||
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.1")
|
||||
Loading…
Reference in New Issue