diff --git a/project/MetaPackaging.scala b/project/MetaPackaging.scala deleted file mode 100644 index 0d54b3852..000000000 --- a/project/MetaPackaging.scala +++ /dev/null @@ -1,25 +0,0 @@ -import sbt._ -import com.typesafe.packager.Keys._ -import sbt.Keys._ -import com.typesafe.packager.PackagerPlugin._ - - -object MetaPackaging { - - def settings(pkg: Project): Seq[Setting[_]] = packagerSettings ++ Seq( - name := "sbt", - version <<= sbtVersion apply { - case "0.11.3" => "0.11.3-build0300" - case v => v - }, - // GENERAL LINUX PACKAGING STUFFS - maintainer := "Josh Suereth ", - packageSummary := "Simple Build Tool for Scala-driven builds", - packageDescription := """This meta-package provides the most up-to-date version of the SBT package.""", - debianPackageDependencies in Debian <+= (name in Debian in pkg), - // STUBBED values - wixConfig := , - rpmRelease := "1", - rpmVendor := "typesafe" - ) -} diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 000000000..1ced03cad --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.12.4-RC1 diff --git a/project/build.scala b/project/build.scala index 61adf4122..4d185d0fe 100644 --- a/project/build.scala +++ b/project/build.scala @@ -1,13 +1,11 @@ import sbt._ import Keys._ -object SbtExtras extends Build { +object SbtLauncherPackage extends Build { // This build creates a SBT plugin with handy features *and* bundles the SBT script for distribution. val root = Project("sbt-packaging", file(".")) settings(Packaging.settings:_*) settings( sbtVersion <<= sbtVersion apply { v => sys.props.getOrElse("sbt.build.version", sys.env.getOrElse("sbt.build.version", v)) } ) - - val meta = Project("metapackage", file("metapackage")) settings(MetaPackaging.settings(root):_*) } diff --git a/project/packaging.scala b/project/packaging.scala index a6604f72d..244bab655 100644 --- a/project/packaging.scala +++ b/project/packaging.scala @@ -9,15 +9,14 @@ object Packaging { val sbtLaunchJarLocation = SettingKey[File]("sbt-launch-jar-location") val sbtLaunchJar = TaskKey[File]("sbt-launch-jar", "Resolves SBT launch jar") - val jansiJarUrl = SettingKey[String]("jansi-jar-url") - val jansiJarLocation = SettingKey[File]("jansi-jar-location") - val jansiJar = TaskKey[File]("jansi-jar", "Resolves Jansi jar") - val fixedScriptDir = SettingKey[File]("fixed-script-dir") val fixedLinuxScriptDir = SettingKey[File]("fixed-linux-script-dir") val fixedUniversalScriptDir = SettingKey[File]("fixed-universal-script-dir") val linuxFixedScripts = TaskKey[File]("linux-fixed-scripts") val universalFixedScripts = TaskKey[File]("universal-fixed-scripts") + + val stagingDirectory = SettingKey[File]("staging-directory") + val stage = TaskKey[File]("stage") def localWindowsPattern = "[organisation]/[module]/[revision]/[module].[ext]" @@ -64,20 +63,6 @@ object Packaging { // TODO - GPG Trust validation. file }, - jansiJarUrl := "http://repo.fusesource.com/nexus/content/groups/public/org/fusesource/jansi/jansi/1.7/jansi-1.7.jar", - jansiJarLocation <<= target apply (_ / "jansi-1.7.jar"), - jansiJar <<= (jansiJarUrl, jansiJarLocation) map { (uri, file) => - import dispatch._ - if(!file.exists) { - // oddly, some places require us to create the file before writing... - IO.touch(file) - val writer = new java.io.BufferedOutputStream(new java.io.FileOutputStream(file)) - try Http(url(uri) >>> writer) - finally writer.close() - } - // TODO - GPG Trust validation. - file - }, // GENERAL LINUX PACKAGING STUFFS maintainer := "Josh Suereth ", packageSummary := "Simple Build Tool for Scala-driven builds", @@ -150,25 +135,16 @@ object Packaging { wixConfig <<= (sbtVersion, sourceDirectory in Windows) map makeWindowsXml, //wixFile <<= sourceDirectory in Windows map (_ / "sbt.xml"), mappings in packageMsi in Windows <+= sbtLaunchJar map { f => f -> "sbt-launch.jar" }, - mappings in packageMsi in Windows <+= jansiJar map { f => f -> "jansi.jar" }, mappings in packageMsi in Windows <++= sourceDirectory in Windows map { d => Seq( (d / "sbt.bat") -> "sbt.bat", (d / "sbt") -> "sbt", - (d / "sbtconfig.txt") -> "sbtconfig.txt", - (d / "jansi-license.txt") -> "jansi-license.txt" + (d / "sbtconfig.txt") -> "sbtconfig.txt" )}, - mappings in packageMsi in Windows <+= (compile in Compile, classDirectory in Compile) map { (c, d) => - compile; - (d / "SbtJansiLaunch.class") -> "SbtJansiLaunch.class" - }, javacOptions := Seq("-source", "1.5", "-target", "1.5"), - unmanagedJars in Compile <+= sbtLaunchJar map identity, - unmanagedJars in Compile <+= jansiJar map identity, // Universal ZIP download install. TODO - Share the above windows code, here.... name in Universal := "sbt", mappings in Universal <+= sbtLaunchJar map { _ -> "bin/sbt-launch.jar" }, - mappings in Universal <+= jansiJar map { f => f -> "bin/jansi.jar" }, mappings in Universal <++= universalFixedScripts map { d => Seq( (d / "sbt") -> "bin/sbt", @@ -177,20 +153,22 @@ object Packaging { }, mappings in Universal <++= sourceDirectory in Windows map { d => Seq( (d / "sbt.bat") -> "bin/sbt.bat", - (d / "sbt") -> "bin/win-sbt", - (d / "jansi-license.txt") -> "jansi-license.txt" + (d / "sbt") -> "bin/win-sbt" )}, - mappings in Universal <+= (compile in Compile, classDirectory in Compile) map { (c, d) => - compile; - (d / "SbtJansiLaunch.class") -> "bin/classes/SbtJansiLaunch.class" - }, // TODO - Adapt global `sbt`/`sbt-launch-lib` scripts for universal install... // Misccelaneous publishing stuff... projectID in Debian <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) }, projectID in Windows <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) }, projectID in Rpm <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) }, - projectID in Universal <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) } + projectID in Universal <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) }, + stagingDirectory <<= (target) apply { (t) => t / "stage" }, + stage <<= (stagingDirectory, mappings in Universal) map { (dir, m) => + val files = for((file, name) <- m) + yield file -> (dir / name) + IO copy files + dir + } ) def makeWindowsXml(sbtVersion: String, sourceDir: File): scala.xml.Node = { @@ -229,11 +207,6 @@ object Packaging { - - - - - @@ -249,10 +222,6 @@ object Packaging { - - - - @@ -282,8 +251,6 @@ object Packaging { - - diff --git a/src/main/java/SbtJansiLaunch.java b/src/main/java/SbtJansiLaunch.java deleted file mode 100644 index f9790ef9f..000000000 --- a/src/main/java/SbtJansiLaunch.java +++ /dev/null @@ -1,6 +0,0 @@ -class SbtJansiLaunch { - public static void main(String[] args) { - org.fusesource.jansi.AnsiConsole.systemInstall(); - xsbt.boot.Boot.main(args); - } -} diff --git a/src/windows/sbt.bat b/src/windows/sbt.bat index cd6f39a3d..6af06e415 100644 --- a/src/windows/sbt.bat +++ b/src/windows/sbt.bat @@ -40,7 +40,7 @@ if "%_JAVA_OPTS%"=="" set _JAVA_OPTS=%CFG_OPTS% :run -"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%jansi.jar;%SBT_HOME%sbt-launch.jar;%SBT_HOME%classes" SbtJansiLaunch %* +"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar;%SBT_HOME%classes" xsbt.boot.Boot %* if ERRORLEVEL 1 goto error goto end