From 005384f9af9bff42ef8869f1d062319ab7b23a43 Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 10 Sep 2013 08:30:00 -0400 Subject: [PATCH] Use sbt 0.13.0 to build the 0.13 branch. --- project/Proguard.scala | 2 +- project/Release.scala | 6 +++--- project/Sbt.scala | 13 ++++++------- project/Sxr.scala | 1 - project/Util.scala | 16 +++++++++------- project/build.properties | 2 +- project/p.sbt | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/project/Proguard.scala b/project/Proguard.scala index 4f01ce128..75c1fa842 100644 --- a/project/Proguard.scala +++ b/project/Proguard.scala @@ -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 diff --git a/project/Release.scala b/project/Release.scala index 7b3e970d6..ebd555f29 100644 --- a/project/Release.scala +++ b/project/Release.scala @@ -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) diff --git a/project/Sbt.scala b/project/Sbt.scala index 7103c84da..f4a466902 100644 --- a/project/Sbt.scala +++ b/project/Sbt.scala @@ -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") diff --git a/project/Sxr.scala b/project/Sxr.scala index 975c25c62..beba6864c 100644 --- a/project/Sxr.scala +++ b/project/Sxr.scala @@ -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 ) diff --git a/project/Util.scala b/project/Util.scala index d378b04bf..3dfb5485f 100644 --- a/project/Util.scala +++ b/project/Util.scala @@ -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 } diff --git a/project/build.properties b/project/build.properties index 5e96e9672..0974fce44 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.12.4 +sbt.version=0.13.0 diff --git a/project/p.sbt b/project/p.sbt index 516f53f93..d583c047b 100644 --- a/project/p.sbt +++ b/project/p.sbt @@ -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") \ No newline at end of file +addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.5.1") \ No newline at end of file