From 4c76201be849b658e29004cd5749f18198547b5d Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Tue, 6 Dec 2011 13:13:02 -0500 Subject: Fixed publish issue. * Cleaned up layered build settings definition * Removed scalaVersion specification from build (not NEEDED). * Fixed a migration from build.sbt to project/Build.scala where publish settings were only being used on the root project and not also used for sub-projects which are published. --- project/Build.scala | 12 ++-------- project/Layers.scala | 67 ++++++++++++++++++++++++++-------------------------- 2 files changed, 35 insertions(+), 44 deletions(-) diff --git a/project/Build.scala b/project/Build.scala index 6ffdffa005..0f48b3b742 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -32,7 +32,6 @@ object ScalaBuild extends Build with Layers { ), organization := "org.scala-lang", version := "2.10.0-SNAPSHOT", - scalaVersion := "2.10.0-SNAPSHOT", pomExtra := 2002 @@ -99,8 +98,7 @@ object ScalaBuild extends Build with Layers { ) - // maven/ivy settings I pulled from build.sbt to keep it lean and mean - // XXX not sure where they go though, please advise or fix + // Settings used to make sure publishing goes smoothly. def publishSettings: Seq[Setting[_]] = Seq( ivyScala ~= ((is: Option[IvyScala]) => is.map(_.copy(checkExplicit = false))), pomIncludeRepository := (_ => false), @@ -152,13 +150,7 @@ object ScalaBuild extends Build with Layers { ) // These are setting overrides for most artifacts in the Scala build file. - // TODO - what can we move into build.sbt... - // @PP: Ha, and here I'm moving stuff out of it. Clearly I need to - // be educated on the merits of having more stuff in build.sbt. I think - // of it as a good place for items I am frequently changing (logLevel, - // compiler options, etc.) and not so good for anything else. But you - // use this stuff a lot more than I do. - def settingOverrides: Seq[Setting[_]] = Seq( + def settingOverrides: Seq[Setting[_]] = publishSettings ++ Seq( crossPaths := false, publishArtifact in packageDoc := false, publishArtifact in packageSrc := false, diff --git a/project/Layers.scala b/project/Layers.scala index 84c926f072..50037f8f9f 100644 --- a/project/Layers.scala +++ b/project/Layers.scala @@ -48,42 +48,41 @@ trait Layers extends Build { * Note: The library and compiler are not *complete* in the sense that they are missing things like "actors" and "fjbg". */ def makeLayer(layer: String, referenceScala: Setting[Task[ScalaInstance]]) : (Project, Project) = { - val library = Project(layer + "-library", file(".")) settings( (settingOverrides ++ - Seq(version := layer, - // TODO - use depends on. - unmanagedClasspath in Compile <<= (exportedProducts in forkjoin in Compile).identity, - managedClasspath in Compile := Seq(), - scalaSource in Compile <<= (baseDirectory) apply (_ / "src" / "library"), - resourceDirectory in Compile <<= baseDirectory apply (_ / "src" / "library"), - defaultExcludes in unmanagedResources := ("*.scala" | "*.java" | "*.disabled"), - // TODO - Allow other scalac option settings. - scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-sourcepath", src.getAbsolutePath)), - classpathOptions := ClasspathOptions.manual, - resourceGenerators in Compile <+= (baseDirectory, version, resourceManaged, gitRunner) map Release.generatePropertiesFile("library.properties"), - referenceScala - )) :_*) + val library = Project(layer + "-library", file(".")) settings(settingOverrides: _*) settings( + version := layer, + // TODO - use depends on. + unmanagedClasspath in Compile <<= (exportedProducts in forkjoin in Compile).identity, + managedClasspath in Compile := Seq(), + scalaSource in Compile <<= (baseDirectory) apply (_ / "src" / "library"), + resourceDirectory in Compile <<= baseDirectory apply (_ / "src" / "library"), + defaultExcludes in unmanagedResources := ("*.scala" | "*.java" | "*.disabled"), + // TODO - Allow other scalac option settings. + scalacOptions in Compile <++= (scalaSource in Compile) map (src => Seq("-sourcepath", src.getAbsolutePath)), + classpathOptions := ClasspathOptions.manual, + resourceGenerators in Compile <+= (baseDirectory, version, resourceManaged, gitRunner) map Release.generatePropertiesFile("library.properties"), + referenceScala + ) // Define the compiler - val compiler = Project(layer + "-compiler", file(".")) settings((settingOverrides ++ - Seq(version := layer, - scalaSource in Compile <<= (baseDirectory) apply (_ / "src" / "compiler"), - resourceDirectory in Compile <<= baseDirectory apply (_ / "src" / "compiler"), - defaultExcludes in unmanagedResources := "*.scala", - resourceGenerators in Compile <+= (baseDirectory, version, resourceManaged, gitRunner) map Release.generatePropertiesFile("compiler.properties"), - // Note, we might be able to use the default task, but for some reason ant was filtering files out. Not sure what's up, but we'll - // stick with that for now. - unmanagedResources in Compile <<= (baseDirectory) map { - (bd) => - val dirs = Seq(bd / "src" / "compiler") - dirs.descendentsExcept( ("*.xml" | "*.html" | "*.gif" | "*.png" | "*.js" | "*.css" | "*.tmpl" | "*.swf" | "*.properties" | "*.txt"),"*.scala").get - }, - // TODO - Use depends on *and* SBT's magic dependency mechanisms... - unmanagedClasspath in Compile <<= Seq(forkjoin, library, fjbg, jline, msil).map(exportedProducts in Compile in _).join.map(_.flatten), - classpathOptions := ClasspathOptions.manual, - externalDeps, - referenceScala - ) - ):_*) + val compiler = Project(layer + "-compiler", file(".")) settings(settingOverrides:_*) settings( + version := layer, + scalaSource in Compile <<= (baseDirectory) apply (_ / "src" / "compiler"), + resourceDirectory in Compile <<= baseDirectory apply (_ / "src" / "compiler"), + defaultExcludes in unmanagedResources := "*.scala", + resourceGenerators in Compile <+= (baseDirectory, version, resourceManaged, gitRunner) map Release.generatePropertiesFile("compiler.properties"), + // Note, we might be able to use the default task, but for some reason ant was filtering files out. Not sure what's up, but we'll + // stick with that for now. + unmanagedResources in Compile <<= (baseDirectory) map { + (bd) => + val dirs = Seq(bd / "src" / "compiler") + dirs.descendentsExcept( ("*.xml" | "*.html" | "*.gif" | "*.png" | "*.js" | "*.css" | "*.tmpl" | "*.swf" | "*.properties" | "*.txt"),"*.scala").get + }, + // TODO - Use depends on *and* SBT's magic dependency mechanisms... + unmanagedClasspath in Compile <<= Seq(forkjoin, library, fjbg, jline, msil).map(exportedProducts in Compile in _).join.map(_.flatten), + classpathOptions := ClasspathOptions.manual, + externalDeps, + referenceScala + ) // Return the generated projects. (library, compiler) -- cgit v1.2.3