diff --git a/project/packaging.scala b/project/packaging.scala index 95c3d007e..852d534e0 100644 --- a/project/packaging.scala +++ b/project/packaging.scala @@ -23,7 +23,7 @@ object Packaging { case _ => "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/"+v+"/sbt-launch.jar" } - val settings: Seq[Setting[_]] = packagerSettings ++ deploymentSettings ++ mapGenericFilesToLinux ++ Seq( + val settings: Seq[Setting[_]] = packagerSettings ++ deploymentSettings ++ mapGenericFilesToLinux ++ mapGenericFilesToWinows ++ Seq( sbtLaunchJarUrl <<= sbtVersion apply downloadUrlForVersion, sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"), sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) => @@ -76,27 +76,30 @@ object Packaging { // WINDOWS SPECIFIC name in Windows := "sbt", - candleOptions ++= Seq("-ext", "WixUtilExtension"), - lightOptions ++= Seq("-ext", "WixUIExtension", - "-ext", "WixUtilExtension", - "-cultures:en-us"), + version in Windows <<= (sbtVersion) apply { sv => + (sv split "[^\\d]" filterNot (_.isEmpty)) match { + case Array(major,minor,bugfix, _*) => Seq(major,minor,bugfix, "1") mkString "." + case Array(major,minor) => Seq(major,minor,"0","1") mkString "." + case Array(major) => Seq(major,"0","0","1") mkString "." + } + }, + maintainer in Windows := "Typesafe, Inc.", + packageSummary in Windows := "Simple Build Tool", + packageDescription in Windows := "THE reactive build tool.", + wixProductId := "ce07be71-510d-414a-92d4-dff47631848a", + wixProductUpgradeId := "4552fb0e-e257-4dbd-9ecb-dba9dbacf424", javacOptions := Seq("-source", "1.5", "-target", "1.5"), - // Universal ZIP download install. TODO - Share the above windows code, here.... + // Universal ZIP download install. name in Universal := "sbt", mappings in Universal <+= sbtLaunchJar map { _ -> "bin/sbt-launch.jar" }, - mappings in Universal <+= sourceDirectory in Windows map { d => - (d / "sbt.bat") -> "bin/sbt.bat" + // TODO - move these into universal directory. + mappings in Universal <++= sourceDirectory in Windows map { d => + Seq( + (d / "sbt.bat") -> "bin/sbt.bat", + (d / "sbtconfig.txt") -> "conf/sbtconfig.txt" + ) }, - // TODO - Adapt global `sbt`/`sbt-launch-lib` scripts for universal install... - - // Windows customizations - mappings in Windows <++= mappings in Universal, - mappings in Windows <++= sourceDirectory in Windows map { d => Seq( - (d / "sbtconfig.txt") -> "conf/sbtconfig.txt" - )}, - wixConfig <<= (sbtVersion, sourceDirectory in Windows) map makeWindowsXml, - wixConfig in Windows <<= wixConfig, // Misccelaneous publishing stuff... projectID in Debian <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) }, @@ -111,124 +114,4 @@ object Packaging { dir } ) - - def makeWindowsXml(sbtVersion: String, sourceDir: File): scala.xml.Node = { - val version = (sbtVersion split "[^\\d]" filterNot (_.isEmpty)) match { - case Array(major,minor,bugfix, _*) => Seq(major,minor,bugfix, "1") mkString "." - case Array(major,minor) => Seq(major,minor,"0","1") mkString "." - case Array(major) => Seq(major,"0","0","1") mkString "." - } - ( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ) - } } diff --git a/project/project/plugins.scala b/project/project/plugins.scala index 50b787b71..73f5ef970 100644 --- a/project/project/plugins.scala +++ b/project/project/plugins.scala @@ -6,10 +6,10 @@ object PluginBuild extends Build { val root = Project("root", file(".")) settings( resolvers += Resolver.url("scalasbt", new URL("http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases"))(Resolver.ivyStylePatterns), - addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.0-symlink-2"), + addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.0-symlink-3"), libraryDependencies += "net.databinder" % "dispatch-http_2.9.1" % "0.8.6" - ) /*dependsOn(nativePackager)*/ + ) //dependsOn(nativePackager) - /*lazy val nativePackager = uri("file:///home/jsuereth/projects/sbt/sbt-native-packager")*/ + //lazy val nativePackager = uri("file:///C:/projects/sbt-native-packager") } diff --git a/src/universal/bin/sbt b/src/universal/bin/sbt index 24bf2f6cd..24c9799a2 100755 --- a/src/universal/bin/sbt +++ b/src/universal/bin/sbt @@ -51,7 +51,11 @@ cygwinpath() { fi } -. $(dirname "$(realpath "$0")")/sbt-launch-lib.bash +if [[ "$CYGWIN_FLAG" == "true" ]]; then + . $(dirname "$(cygpath "$(realpath "$0")")")/sbt-launch-lib.bash +else + . $(dirname "$(realpath "$0")")/sbt-launch-lib.bash +fi declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy" @@ -129,14 +133,6 @@ loadConfigFile() { cat "$1" | sed '/^\#/d' } - -#If we're in cygwin, we should use the windows config, and terminal hacks -if [[ "$CYGWIN_FLAG" == "true" ]]; then - stty -icanon min 1 -echo > /dev/null 2>&1 - addJava "-Djline.terminal=jline.UnixTerminal" - addJava "-Dsbt.cygwin=true" -fi - # TODO - Pull in config based on operating system... (MSYS + cygwin should pull in txt file). # Here we pull in the global settings configuration. [[ -f "$etc_sbt_opts_file" ]] && set -- $(loadConfigFile "$etc_sbt_opts_file") "$@" @@ -149,11 +145,4 @@ fi run "$@" -exit_code=$? - -# Clean up the terminal from cygwin hacks. -if [[ "$IS_CYGWIN" == "true" ]] then - stty icanon echo > /dev/null 2>&1 -fi -exit $exit_code diff --git a/src/universal/bin/sbt-launch-lib.bash b/src/universal/bin/sbt-launch-lib.bash index 0e159e759..37bf2ee2d 100755 --- a/src/universal/bin/sbt-launch-lib.bash +++ b/src/universal/bin/sbt-launch-lib.bash @@ -172,6 +172,13 @@ run() { # TODO - java check should be configurable... checkJava "1.6" + #If we're in cygwin, we should use the windows config, and terminal hacks + if [[ "$CYGWIN_FLAG" == "true" ]]; then + stty -icanon min 1 -echo > /dev/null 2>&1 + addJava "-Djline.terminal=jline.UnixTerminal" + addJava "-Dsbt.cygwin=true" + fi + # run sbt execRunner "$java_cmd" \ ${SBT_OPTS:-$default_sbt_opts} \ @@ -181,6 +188,14 @@ run() { -jar "$sbt_jar" \ "${sbt_commands[@]}" \ "${residual_args[@]}" + + exit_code=$? + + # Clean up the terminal from cygwin hacks. + if [[ "$IS_CYGWIN" == "true" ]]; then + stty icanon echo > /dev/null 2>&1 + fi + exit $exit_code } runAlternateBoot() { diff --git a/src/windows/sbt.bat b/src/windows/sbt.bat index 854a4a85c..2ffeb3774 100644 --- a/src/windows/sbt.bat +++ b/src/windows/sbt.bat @@ -14,7 +14,7 @@ set SBT_HOME=%~dp0 set ERROR_CODE=0 rem FIRST we load the config file of extra options. -set FN=%SBT_HOME%sbtconfig.txt +set FN=%SBT_HOME%\..\conf\sbtconfig.txt set CFG_OPTS= FOR /F "tokens=* eol=# usebackq delims=" %%i IN ("%FN%") DO ( set DO_NOT_REUSE_ME=%%i