From bec43f0a55013558fbcb4a81e83ddc04e2f421a7 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 17 Jun 2013 12:16:10 -0400 Subject: [PATCH 1/8] Cleanup of launcher package to remove special casing of JANSI. This, hopefully, will lead to better compatibility between the many console-enrichment projects, like: JLINE-scala, JLINE-1.0, JLINE-2.0 and Jansi itself. Testing to ensue shortly between 0.12.x + 0.13.x --- project/MetaPackaging.scala | 25 ------------- project/build.properties | 1 + project/build.scala | 4 +-- project/packaging.scala | 59 +++++++------------------------ src/main/java/SbtJansiLaunch.java | 6 ---- src/windows/sbt.bat | 2 +- 6 files changed, 16 insertions(+), 81 deletions(-) delete mode 100644 project/MetaPackaging.scala create mode 100644 project/build.properties delete mode 100644 src/main/java/SbtJansiLaunch.java 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 From 3b9519b793751a583c88a4a796bca157cbf3a1a7 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Mon, 17 Jun 2013 12:56:18 -0400 Subject: [PATCH 2/8] Fixes to scripts for working in both cygwin and cmd.exe. THis basically moves from jline.UnixTerminal to just unix. --- src/windows/sbt | 7 +++++-- src/windows/sbt.bat | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/windows/sbt b/src/windows/sbt index 7037324cd..c96095635 100644 --- a/src/windows/sbt +++ b/src/windows/sbt @@ -24,12 +24,15 @@ if [ -z "$JAVA_OPTS" ]; then JAVA_OPTS=$(cat "$WDIR/sbtconfig.txt" | sed -e 's/\r//g' -e 's/^#.*$//g' | sed ':a;N;$!ba;s/\n/ /g') fi +# TODO - this check should detect cygwin terminal, not just xterm. if [ "_$TERM" = "_xterm" ]; then # Let the terminal handle ANSI sequences stty -icanon min 1 -echo > /dev/null 2>&1 - "$JAVA_CMD" $JAVA_OPTS -Djline.terminal=jline.UnixTerminal $SBT_OPTS -jar "$WDIR/sbt-launch.jar" "$@" + "$JAVA_CMD" $JAVA_OPTS -Djline.terminal=unix $SBT_OPTS -jar "$WDIR/sbt-launch.jar" "$@" + SCALA_STATUS=$? stty icanon echo > /dev/null 2>&1 + exit $SCALA_STATUS else # Use Jansi to intercept ANSI sequences - "$JAVA_CMD" -Dsbt.log.format=true $JAVA_OPTS $SBT_OPTS -cp "$WDIR/jansi.jar;$WDIR/sbt-launch.jar;$WDIR/classes" SbtJansiLaunch "$@" + "$JAVA_CMD" -Dsbt.log.format=true $JAVA_OPTS $SBT_OPTS -cp "$WDIR/sbt-launch.jar" xsbt.boot.Boot "$@" fi diff --git a/src/windows/sbt.bat b/src/windows/sbt.bat index 6af06e415..854a4a85c 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%sbt-launch.jar;%SBT_HOME%classes" xsbt.boot.Boot %* +"%_JAVACMD%" %_JAVA_OPTS% %SBT_OPTS% -cp "%SBT_HOME%sbt-launch.jar" xsbt.boot.Boot %* if ERRORLEVEL 1 goto error goto end From 360428a2eb4aecf6a6e549c0ed5f208fcc9913ee Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 27 Jun 2013 10:28:01 -0400 Subject: [PATCH 3/8] Modify script for new 0.13 behavior. --- src/windows/sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/windows/sbt b/src/windows/sbt index c96095635..ce24abbdd 100644 --- a/src/windows/sbt +++ b/src/windows/sbt @@ -28,7 +28,7 @@ fi if [ "_$TERM" = "_xterm" ]; then # Let the terminal handle ANSI sequences stty -icanon min 1 -echo > /dev/null 2>&1 - "$JAVA_CMD" $JAVA_OPTS -Djline.terminal=unix $SBT_OPTS -jar "$WDIR/sbt-launch.jar" "$@" + "$JAVA_CMD" $JAVA_OPTS -Djline.terminal=jline.UnixTerminal -Dsbt.cygwin=true $SBT_OPTS -jar "$WDIR/sbt-launch.jar" "$@" SCALA_STATUS=$? stty icanon echo > /dev/null 2>&1 exit $SCALA_STATUS From a99f6fffbf2729624c5ef6195052b4884c8554dc Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 27 Jun 2013 16:43:31 -0400 Subject: [PATCH 4/8] Upgrade to in-progress sbt-native-packager plugin, including new support for universal->debian/rpm packages. --- project/packaging.scala | 84 +++---------------- project/project/plugins.scala | 7 +- src/linux/etc/sbt/sbtopts | 49 ----------- src/{scripts => universal/bin}/sbt | 75 ++++++++++++++--- .../bin}/sbt-launch-lib.bash | 33 +++++++- src/universal/conf/sbtopts | 0 6 files changed, 114 insertions(+), 134 deletions(-) delete mode 100644 src/linux/etc/sbt/sbtopts rename src/{scripts => universal/bin}/sbt (64%) rename src/{scripts => universal/bin}/sbt-launch-lib.bash (78%) mode change 100644 => 100755 create mode 100644 src/universal/conf/sbtopts diff --git a/project/packaging.scala b/project/packaging.scala index 244bab655..8b40e4a6f 100644 --- a/project/packaging.scala +++ b/project/packaging.scala @@ -1,7 +1,7 @@ import sbt._ -import com.typesafe.packager.Keys._ +import com.typesafe.sbt.packager.Keys._ import sbt.Keys._ -import com.typesafe.packager.PackagerPlugin._ +import com.typesafe.sbt.SbtNativePackager._ object Packaging { @@ -9,12 +9,6 @@ object Packaging { val sbtLaunchJarLocation = SettingKey[File]("sbt-launch-jar-location") val sbtLaunchJar = TaskKey[File]("sbt-launch-jar", "Resolves SBT launch 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") @@ -29,26 +23,7 @@ object Packaging { case _ => "http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt-launch/"+v+"/sbt-launch.jar" } - def fixScripts(launchJar: String, bashLib: String)(scriptDir: File, target: File): File = { - if(!target.exists) target.mkdirs() - for(file <- (scriptDir.*** --- scriptDir).get) { - val tfile = target / file.getName - // TODO - Speedier version - val lines = - for { - line <- IO.readLines(file).view - } yield line.replaceAll("@@BASH-LIB-LOCATION@@", bashLib).replaceAll("@@LAUNCH-JAR-LOCATION@@", launchJar) - IO.writeLines(tfile, lines) - } - target - } - - val settings: Seq[Setting[_]] = packagerSettings ++ deploymentSettings ++ Seq( - fixedScriptDir <<= sourceDirectory / "scripts", - fixedLinuxScriptDir <<= target / "linux-scripts", - fixedUniversalScriptDir <<= target / "universal-scripts", - linuxFixedScripts <<= (fixedScriptDir, fixedLinuxScriptDir) map fixScripts("/usr/lib/sbt/sbt-launch.jar", "/usr/share/sbt/sbt-launch-lib.bash"), - universalFixedScripts <<= (fixedScriptDir, fixedUniversalScriptDir) map fixScripts("\\$(dirname \\$(realpath \\$0))/sbt-launch.jar", "\\$(dirname \\$(realpath \\$0))/sbt-launch-lib.bash"), + val settings: Seq[Setting[_]] = packagerSettings ++ deploymentSettings ++ mapGenericFilesToLinux ++ Seq( sbtLaunchJarUrl <<= sbtVersion apply downloadUrlForVersion, sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"), sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) => @@ -68,40 +43,13 @@ object Packaging { packageSummary := "Simple Build Tool for Scala-driven builds", packageDescription := """This script provides a native way to run the Simple Build Tool, a build tool for Scala software, also called SBT.""", - linuxPackageMappings <+= (linuxFixedScripts) map { bd => - (packageMapping((bd / "sbt") -> "/usr/bin/sbt", - bd -> "/usr/share/sbt", - (bd / "sbt-launch-lib.bash") -> "/usr/share/sbt/sbt-launch-lib.bash") - withUser "root" withGroup "root" withPerms "0755") - }, - linuxPackageMappings <+= (sourceDirectory) map { bd => - (packageMapping( - (bd / "linux" / "usr/share/man/man1/sbt.1") -> "/usr/share/man/man1/sbt.1.gz" - ) withPerms "0644" gzipped) asDocs() - }, - linuxPackageMappings <+= (sourceDirectory in Linux) map { bd => - packageMapping( - (bd / "usr/share/doc/sbt/copyright") -> "/usr/share/doc/sbt/copyright" - ) withPerms "0644" asDocs() - }, - linuxPackageMappings <+= (sourceDirectory in Linux) map { bd => - packageMapping( - (bd / "usr/share/doc/sbt") -> "/usr/share/doc/sbt" - ) asDocs() - }, - linuxPackageMappings <+= (sourceDirectory in Linux) map { bd => - packageMapping( - (bd / "etc/sbt") -> "/etc/sbt" - ) withConfig() - }, - linuxPackageMappings <+= (sourceDirectory in Linux) map { bd => - packageMapping( - (bd / "etc/sbt/sbtopts") -> "/etc/sbt/sbtopts" - ) withPerms "0644" withConfig("noreplace") - }, - linuxPackageMappings <+= (sbtLaunchJar, sourceDirectory in Linux, sbtVersion) map { (jar, dir, v) => - packageMapping(dir -> "/usr/lib/sbt", - jar -> ("/usr/lib/sbt/sbt-launch.jar")) withPerms "0755" + // Here we remove the jar file and launch lib from the symlinks: + linuxPackageSymlinks <<= linuxPackageSymlinks map { links => + for { + link <- links + if !(link.destination endsWith "sbt-launch-lib.bash") + if !(link.destination endsWith "sbt-launch.jar") + } yield link }, // DEBIAN SPECIFIC name in Debian <<= (sbtVersion) apply { (sv) => "sbt" /* + "-" + (sv split "[^\\d]" take 3 mkString ".")*/ }, @@ -137,7 +85,6 @@ object Packaging { mappings in packageMsi in Windows <+= sbtLaunchJar map { f => f -> "sbt-launch.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" )}, javacOptions := Seq("-source", "1.5", "-target", "1.5"), @@ -145,16 +92,9 @@ object Packaging { // 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 <++= universalFixedScripts map { d => - Seq( - (d / "sbt") -> "bin/sbt", - (d / "sbt-launch-lib.bash") -> "bin/sbt-launch-lib.bash" - ) + mappings in Universal <+= sourceDirectory in Windows map { d => + (d / "sbt.bat") -> "bin/sbt.bat" }, - mappings in Universal <++= sourceDirectory in Windows map { d => Seq( - (d / "sbt.bat") -> "bin/sbt.bat", - (d / "sbt") -> "bin/win-sbt" - )}, // TODO - Adapt global `sbt`/`sbt-launch-lib` scripts for universal install... // Misccelaneous publishing stuff... diff --git a/project/project/plugins.scala b/project/project/plugins.scala index cf7cd2c8f..50b787b71 100644 --- a/project/project/plugins.scala +++ b/project/project/plugins.scala @@ -6,7 +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-native-packager" % "0.4.4"), + addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.0-symlink-2"), libraryDependencies += "net.databinder" % "dispatch-http_2.9.1" % "0.8.6" - ) + ) /*dependsOn(nativePackager)*/ + + + /*lazy val nativePackager = uri("file:///home/jsuereth/projects/sbt/sbt-native-packager")*/ } diff --git a/src/linux/etc/sbt/sbtopts b/src/linux/etc/sbt/sbtopts deleted file mode 100644 index f018465af..000000000 --- a/src/linux/etc/sbt/sbtopts +++ /dev/null @@ -1,49 +0,0 @@ -# ------------------------------------------------ # -# The SBT Configuration file. # -# ------------------------------------------------ # - - -# Disable ANSI color codes -# -#-no-colors - -# Starts sbt even if the current directory contains no sbt project. -# --sbt-create - -# Path to global settings/plugins directory (default: ~/.sbt) -# -#-sbt-dir /etc/sbt - -# Path to shared boot directory (default: ~/.sbt/boot in 0.11 series) -# -#-sbt-boot ~/.sbt/boot - -# Path to local Ivy repository (default: ~/.ivy2) -# -#-ivy ~/.ivy2 - -# set memory options -# -#-mem - -# Use local caches for projects, no sharing. -# -#-no-share - -# Put SBT in offline mode. -# -#-offline - -# Sets the SBT version to use. -#-sbt-version 0.11.3 - -# Scala version (default: latest release) -# -#-scala-home -#-scala-version - -# java version (default: java from PATH, currently $(java -version |& grep version)) -# -#-java-home - diff --git a/src/scripts/sbt b/src/universal/bin/sbt similarity index 64% rename from src/scripts/sbt rename to src/universal/bin/sbt index c2249d9a5..24bf2f6cd 100755 --- a/src/scripts/sbt +++ b/src/universal/bin/sbt @@ -1,31 +1,63 @@ #!/usr/bin/env bash + +### ------------------------------- ### +### Helper methods for BASH scripts ### +### ------------------------------- ### + realpath () { ( - TARGET_FILE=$1 + TARGET_FILE="$1" - cd $(dirname $TARGET_FILE) - TARGET_FILE=$(basename $TARGET_FILE) + cd $(dirname "$TARGET_FILE") + TARGET_FILE=$(basename "$TARGET_FILE") COUNT=0 while [ -L "$TARGET_FILE" -a $COUNT -lt 100 ] do - TARGET_FILE=$(readlink $TARGET_FILE) - cd $(dirname $TARGET_FILE) - TARGET_FILE=$(basename $TARGET_FILE) + TARGET_FILE=$(readlink "$TARGET_FILE") + cd $(dirname "$TARGET_FILE") + TARGET_FILE=$(basename "$TARGET_FILE") COUNT=$(($COUNT + 1)) done - echo $(pwd -P)/$TARGET_FILE + # make sure we grab the actual windows path, instead of cygwin's path. + echo $(cygwinpath "$(pwd -P)/$TARGET_FILE") ) } -. @@BASH-LIB-LOCATION@@ + +# Uses uname to detect if we're in the odd cygwin environment. +is_cygwin() { + local os=$(uname -s) + case "$os" in + CYGWIN*) return 0 ;; + *) return 1 ;; + esac +} + +# TODO - Use nicer bash-isms here. +CYGWIN_FLAG=$(if is_cygwin; then echo true; else echo false; fi) + + +# This can fix cygwin style /cygdrive paths so we get the +# windows style paths. +cygwinpath() { + local file="$1" + if [[ "$CYGWIN_FLAG" == "true" ]]; then + echo $(cygpath -w $file) + else + echo $file + fi +} + +. $(dirname "$(realpath "$0")")/sbt-launch-lib.bash declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy" declare -r sbt_opts_file=".sbtopts" -declare -r etc_sbt_opts_file="/etc/sbt/sbtopts" +declare -r etc_sbt_opts_file="${sbt_home}/conf/sbtopts" +declare -r win_sbt_opts_file="${sbt_home}/conf/sbtconfig.txt" usage() { cat < /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") "$@" +# -- Windows behavior stub'd +# JAVA_OPTS=$(cat "$WDIR/sbtconfig.txt" | sed -e 's/\r//g' -e 's/^#.*$//g' | sed ':a;N;$!ba;s/\n/ /g') + + +# Pull in the project-level config file, if it exists. [[ -f "$sbt_opts_file" ]] && set -- $(loadConfigFile "$sbt_opts_file") "$@" + 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/scripts/sbt-launch-lib.bash b/src/universal/bin/sbt-launch-lib.bash old mode 100644 new mode 100755 similarity index 78% rename from src/scripts/sbt-launch-lib.bash rename to src/universal/bin/sbt-launch-lib.bash index 7355c5596..0e159e759 --- a/src/scripts/sbt-launch-lib.bash +++ b/src/universal/bin/sbt-launch-lib.bash @@ -17,6 +17,8 @@ declare -a java_args declare -a scalac_args declare -a sbt_commands declare java_cmd=java +declare -r sbt_bin_dir="$(dirname "$(realpath "$0")")" +declare -r sbt_home="$(dirname "$sbt_bin_dir")" echoerr () { echo 1>&2 "$@" @@ -29,7 +31,8 @@ dlog () { } jar_file () { - echo "@@LAUNCH-JAR-LOCATION@@" + # TODO - Is this where we want the launch jar? + echo "${sbt_home}/bin/sbt-launch.jar" } acquire_sbt_jar () { @@ -128,6 +131,31 @@ process_args () { } } +# Detect that we have java installed. +checkJava() { + local required_version="$1" + # Now check to see if it's a good enough version + declare -r java_version=$("$java_cmd" -version 2>&1 | awk -F '"' '/version/ {print $2}') + if [[ "$java_version" == "" ]]; then + echo + echo No java installations was detected. + echo Please go to http://www.java.com/getjava/ and download + echo + exit 1 + elif [[ ! "$java_version" > "$required_version" ]]; then + echo + echo The java installation you have is not up to date + echo $script_name requires at least version $required_version+, you have + echo version $java_version + echo + echo Please go to http://www.java.com/getjava/ and download + echo a valid Java Runtime and install before running $script_name. + echo + exit 1 + fi +} + + run() { # no jar? download it. [[ -f "$sbt_jar" ]] || acquire_sbt_jar "$sbt_version" || { @@ -141,6 +169,9 @@ run() { set -- "${residual_args[@]}" argumentCount=$# + # TODO - java check should be configurable... + checkJava "1.6" + # run sbt execRunner "$java_cmd" \ ${SBT_OPTS:-$default_sbt_opts} \ diff --git a/src/universal/conf/sbtopts b/src/universal/conf/sbtopts new file mode 100644 index 000000000..e69de29bb From b531a824f1da274e7c82387a3db937f4b88ece8b Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Thu, 27 Jun 2013 19:56:21 -0400 Subject: [PATCH 5/8] Fixed up MSI generation for new layout. MinGW tests to follow. --- project/packaging.scala | 46 ++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/project/packaging.scala b/project/packaging.scala index 8b40e4a6f..95c3d007e 100644 --- a/project/packaging.scala +++ b/project/packaging.scala @@ -80,13 +80,6 @@ object Packaging { lightOptions ++= Seq("-ext", "WixUIExtension", "-ext", "WixUtilExtension", "-cultures:en-us"), - 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 <++= sourceDirectory in Windows map { d => Seq( - (d / "sbt.bat") -> "sbt.bat", - (d / "sbtconfig.txt") -> "sbtconfig.txt" - )}, javacOptions := Seq("-source", "1.5", "-target", "1.5"), // Universal ZIP download install. TODO - Share the above windows code, here.... @@ -97,6 +90,14 @@ object Packaging { }, // 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) }, projectID in Windows <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) }, @@ -147,29 +148,36 @@ object Packaging { + - + - + + + + + + + + + + + + + + - + - - - - - - - - + @@ -179,7 +187,7 @@ object Packaging { From 53f9de27352bd9da763a098c3d5e0c5671f37c1c Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Sat, 29 Jun 2013 10:09:42 -0400 Subject: [PATCH 6/8] Migrating to new native packaging plugin abstractions. * Use new native packaging abstractions for windows mappings. * Update universal sbt script to be cygwin friendly * Modify sbt.bat for universal layout * Fix some stty icanon (no)echo bugs in launcher script. --- project/packaging.scala | 157 ++++---------------------- project/project/plugins.scala | 6 +- src/universal/bin/sbt | 21 +--- src/universal/bin/sbt-launch-lib.bash | 15 +++ src/windows/sbt.bat | 2 +- 5 files changed, 44 insertions(+), 157 deletions(-) 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 From d16ab1abd14656902a4b44555c550057e5c125bf Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Sat, 29 Jun 2013 10:21:58 -0400 Subject: [PATCH 7/8] Migrate universal windows scripts into universal directory. ALso, added back the commented sbtopts settings. --- project/packaging.scala | 7 - src/{windows => universal/bin}/sbt.bat | 0 src/{windows => universal/conf}/sbtconfig.txt | 0 src/universal/conf/sbtopts | 49 +++++ src/windows/jansi-license.txt | 202 ------------------ src/windows/sbt.xml | 36 ---- 6 files changed, 49 insertions(+), 245 deletions(-) rename src/{windows => universal/bin}/sbt.bat (100%) rename src/{windows => universal/conf}/sbtconfig.txt (100%) delete mode 100644 src/windows/jansi-license.txt delete mode 100644 src/windows/sbt.xml diff --git a/project/packaging.scala b/project/packaging.scala index 852d534e0..3f9188f38 100644 --- a/project/packaging.scala +++ b/project/packaging.scala @@ -93,13 +93,6 @@ object Packaging { // Universal ZIP download install. name in Universal := "sbt", mappings in Universal <+= sbtLaunchJar map { _ -> "bin/sbt-launch.jar" }, - // 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" - ) - }, // Misccelaneous publishing stuff... projectID in Debian <<= (organization, sbtVersion) apply { (o,v) => ModuleID(o,"sbt",v) }, diff --git a/src/windows/sbt.bat b/src/universal/bin/sbt.bat similarity index 100% rename from src/windows/sbt.bat rename to src/universal/bin/sbt.bat diff --git a/src/windows/sbtconfig.txt b/src/universal/conf/sbtconfig.txt similarity index 100% rename from src/windows/sbtconfig.txt rename to src/universal/conf/sbtconfig.txt diff --git a/src/universal/conf/sbtopts b/src/universal/conf/sbtopts index e69de29bb..f018465af 100644 --- a/src/universal/conf/sbtopts +++ b/src/universal/conf/sbtopts @@ -0,0 +1,49 @@ +# ------------------------------------------------ # +# The SBT Configuration file. # +# ------------------------------------------------ # + + +# Disable ANSI color codes +# +#-no-colors + +# Starts sbt even if the current directory contains no sbt project. +# +-sbt-create + +# Path to global settings/plugins directory (default: ~/.sbt) +# +#-sbt-dir /etc/sbt + +# Path to shared boot directory (default: ~/.sbt/boot in 0.11 series) +# +#-sbt-boot ~/.sbt/boot + +# Path to local Ivy repository (default: ~/.ivy2) +# +#-ivy ~/.ivy2 + +# set memory options +# +#-mem + +# Use local caches for projects, no sharing. +# +#-no-share + +# Put SBT in offline mode. +# +#-offline + +# Sets the SBT version to use. +#-sbt-version 0.11.3 + +# Scala version (default: latest release) +# +#-scala-home +#-scala-version + +# java version (default: java from PATH, currently $(java -version |& grep version)) +# +#-java-home + diff --git a/src/windows/jansi-license.txt b/src/windows/jansi-license.txt deleted file mode 100644 index d64569567..000000000 --- a/src/windows/jansi-license.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/src/windows/sbt.xml b/src/windows/sbt.xml deleted file mode 100644 index bb0c3e020..000000000 --- a/src/windows/sbt.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file From 18352254e0dfe93987c0dde1d8aa450b144fb723 Mon Sep 17 00:00:00 2001 From: Josh Suereth Date: Sat, 29 Jun 2013 10:23:49 -0400 Subject: [PATCH 8/8] Fix config file loading to do shell expansion first. from @benevans. --- src/universal/bin/sbt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/universal/bin/sbt b/src/universal/bin/sbt index 24c9799a2..427857fd5 100755 --- a/src/universal/bin/sbt +++ b/src/universal/bin/sbt @@ -130,7 +130,9 @@ process_my_args () { } loadConfigFile() { - cat "$1" | sed '/^\#/d' + for line in $(cat "$1" | sed '/^\#/d'); do + eval echo $line + done } # TODO - Pull in config based on operating system... (MSYS + cygwin should pull in txt file).