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..3f9188f38 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,15 +9,8 @@ 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]" @@ -30,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 ++ mapGenericFilesToWinows ++ Seq( sbtLaunchJarUrl <<= sbtVersion apply downloadUrlForVersion, sbtLaunchJarLocation <<= target apply (_ / "sbt-launch.jar"), sbtLaunchJar <<= (sbtLaunchJarUrl, sbtLaunchJarLocation) map { (uri, file) => @@ -64,59 +38,18 @@ 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", 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 ".")*/ }, @@ -143,177 +76,35 @@ object Packaging { // WINDOWS SPECIFIC name in Windows := "sbt", - candleOptions ++= Seq("-ext", "WixUtilExtension"), - 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 <+= 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" - )}, - mappings in packageMsi in Windows <+= (compile in Compile, classDirectory in Compile) map { (c, d) => - compile; - (d / "SbtJansiLaunch.class") -> "SbtJansiLaunch.class" + 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"), - unmanagedJars in Compile <+= sbtLaunchJar map identity, - unmanagedJars in Compile <+= jansiJar map identity, - // 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 <+= jansiJar map { f => f -> "bin/jansi.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 => Seq( - (d / "sbt.bat") -> "bin/sbt.bat", - (d / "sbt") -> "bin/win-sbt", - (d / "jansi-license.txt") -> "jansi-license.txt" - )}, - 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 = { - 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 cf7cd2c8f..73f5ef970 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-3"), libraryDependencies += "net.databinder" % "dispatch-http_2.9.1" % "0.8.6" - ) + ) //dependsOn(nativePackager) + + + //lazy val nativePackager = uri("file:///C:/projects/sbt-native-packager") } 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/scripts/sbt b/src/universal/bin/sbt similarity index 68% rename from src/scripts/sbt rename to src/universal/bin/sbt index 7e2d54643..427857fd5 100755 --- a/src/scripts/sbt +++ b/src/universal/bin/sbt @@ -1,31 +1,67 @@ #!/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 +} + +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" 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 <&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,16 @@ run() { set -- "${residual_args[@]}" argumentCount=$# + # 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} \ @@ -150,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/universal/bin/sbt.bat similarity index 88% rename from src/windows/sbt.bat rename to src/universal/bin/sbt.bat index cd6f39a3d..2ffeb3774 100644 --- a/src/windows/sbt.bat +++ b/src/universal/bin/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 @@ -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" xsbt.boot.Boot %* if ERRORLEVEL 1 goto error goto end 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/linux/etc/sbt/sbtopts b/src/universal/conf/sbtopts similarity index 100% rename from src/linux/etc/sbt/sbtopts rename to src/universal/conf/sbtopts 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 b/src/windows/sbt index 7037324cd..ce24abbdd 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=jline.UnixTerminal -Dsbt.cygwin=true $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.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