diff --git a/README.md b/README.md index fbd370a4f..950a377dd 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# The Scala 2.11.x Distribution # +# The Scala 2.12.x Distribution This project morphs the `"org.scala-lang" % "scala-dist" % $version` maven artifact into a Scala `$version` distribution (zip, tar.gz, deb, rpm, and msi). @@ -7,43 +7,45 @@ To build a distribution, run: * `universal:package-bin` - Builds the universal zip installer * `universal-docs:package-bin` - Builds the universal documentation zip - * `debian:package-bin` - Builds the debian DEB file. *Requires dpkg-deb* + * `debian:package-bin` - Builds the Debian DEB file. *requires dpkg-deb* * `rpm:package-bin` - Builds the yum RPM file. *requires rpmbuild* - * `windows:package-bin` - Builds the windows MSI. *Requires WIX 3.6 installed* + * `windows:package-bin` - Builds the Windows MSI. *requires WiX 3.6* -Alternatively, the `s3-upload` task's mapping are configured based on the platform -the installer is running on: on Windows, it builds the MSI; on another platform, +Alternatively, the `s3-upload` task's mappings are configured based on the platform +the installer is running on. On Windows, it builds the MSI; on another platform, it'll create and upload the other packages in the above list. (Use `s3Upload::mappings` for a dry-run.) The version of Scala to package is derived from the most recent git tag, or you can specify it using `-Dproject.version`. -This packager only works for Scala 2.11 releases (starting with M8) or newer, +This packager only works for Scala 2.11+ releases (starting with M8), as earlier ones did not publish the `scala-dist` artifact to maven. -Due to limited resources, the native packages are quite rudimental -- we welcome new maintainers! +Due to limited resources, the native packages are quite rudimentary. +We welcome new maintainers! ## Legacy If you're looking for the editor configurations that used to be in the tool-support directory, please see https://github.com/scala/scala-tool-support. -They were moved out because they no longer ship with the Scala distribution (you're welcome to take over the scala-tool-support project!). +They were moved out because they no longer ship with the Scala distribution. (New maintainers are welcome on the scala-tool-support project!) The specification also used to be in this repo -- it is now a part of the main repository over at [scala/scala](https://github.com/scala/scala/tree/2.11.x/spec). ## Windows VM - - install windows 7 professional N 64-bit, ensure network access to github - - install oracle java 6 jdk - - install wix v3.6 (reboot!) - - download sbt launcher 0.13.1 from xsbt.org to c:\users\jenkins\Downloads - - install git - - configure the jenkins master's tool locations for + - install Windows 7 professional N 64-bit, ensure network access to GitHub + - install Oracle Java 6 JDK + - install WiX v3.6 (reboot!) + - download sbt launcher 0.13.1 from xsbt.org to `c:\users\jenkins\Downloads` + - install Git + - configure the Jenkins master's tool locations for - HOME - - jdk path - - git (path of git.exe) + - JDK path + - Git (path of git.exe) - sbt launch jar - ## Contributing ## Please read the [Scala Pull Request Policy](https://github.com/scala/scala/wiki/Pull-Request-Policy) and sign the [CLA](http://typesafe.com/contribute/cla/scala). -The branching structure mimics that of [scala/scala](https://github.com/scala/scala). +The branching structure mimics that of [scala/scala](https://github.com/scala/scala): +branches for 2.11.x, 2.12.x, etc. + diff --git a/build.sbt b/build.sbt index 46944ca88..6e4aaa761 100644 --- a/build.sbt +++ b/build.sbt @@ -23,6 +23,8 @@ Docs.settings ScalaDist.platformSettings +enablePlugins(UniversalPlugin, RpmPlugin, JDebPackaging) + // resolvers += "local" at "file:///e:/.m2/repository" // resolvers += Resolver.mavenLocal -// to test, run e.g., stage, or windows:packageBin, show s3-upload::mappings \ No newline at end of file +// to test, run e.g., stage, or windows:packageBin, show s3-upload::mappings diff --git a/conf/repositories b/conf/repositories index 3c69f2dab..b0bd68691 100644 --- a/conf/repositories +++ b/conf/repositories @@ -1,7 +1,7 @@ [repositories] - plugins: http://dl.bintray.com/sbt/sbt-plugin-releases/, [organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] private-repo: https://scala-ci.typesafe.com/artifactory/scala-release-temp/ - typesafe-ivy-releases: http://repo.typesafe.com/typesafe/ivy-releases/, [organization]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly - sbt-plugin-releases: http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] + jcenter-cache: https://scala-ci.typesafe.com/artifactory/jcenter/ + typesafe-ivy-releases: https://dl.bintray.com/typesafe/ivy-releases/, [organisation]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly + sbt-plugin-releases: https://dl.bintray.com/sbt/sbt-plugin-releases/, [organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] maven-central local diff --git a/project/ScalaDist.scala b/project/ScalaDist.scala index 58a4fc732..c312b7f75 100644 --- a/project/ScalaDist.scala +++ b/project/ScalaDist.scala @@ -2,6 +2,8 @@ import sbt._ import sbt.Keys._ import com.typesafe.sbt.SbtNativePackager._ +import com.typesafe.sbt.packager.MappingsHelper._ +import com.typesafe.sbt.packager.universal.UniversalPlugin.autoImport.useNativeZip import com.typesafe.sbt.packager.Keys._ import com.typesafe.sbt.S3Plugin.S3.upload @@ -37,7 +39,6 @@ object ScalaDist { ) def settings: Seq[Setting[_]] = - packagerSettings ++ useNativeZip ++ // use native zip to preserve +x permission on scripts Seq( name := "scala", @@ -69,19 +70,16 @@ object ScalaDist { case "scala-dist" => val tmpdir = IO.createTemporaryDirectory IO.unzip(file, tmpdir) - // IO.listFiles(tmpdir) does not recurse, use ** with glob "*" to find all files - (PathFinder(IO.listFiles(tmpdir)) ** "*").get flatMap { file => - val relative = IO.relativize(tmpdir, file).get // .get is safe because we just unzipped under tmpdir - - // files are stored in repository with platform-appropriate line endings - // if (onWindows && (relative endsWith ".bat")) toDosInPlace(file) + // create mappings from the unzip scala-dist zip + contentOf(tmpdir) filter { + case (file, dest) => !(dest.endsWith("MANIFEST.MF") || dest.endsWith("META-INF")) + } map { // make unix scripts executable (heuristically...) - if ((relative startsWith "bin/") && !(file.getName endsWith ".bat")) + case (file, dest) if (dest startsWith "bin/") && !(dest endsWith ".bat") => file.setExecutable(true, true) - - if (relative startsWith "META-INF") Seq() - else Seq(file -> relative) + file -> dest + case mapping => mapping } // core jars: use simple name for backwards compat diff --git a/project/Unix.scala b/project/Unix.scala index 1fc97fa8f..8f75f767f 100644 --- a/project/Unix.scala +++ b/project/Unix.scala @@ -4,6 +4,7 @@ import sbt.Keys._ import com.typesafe.sbt.SbtNativePackager._ import com.typesafe.sbt.packager.Keys._ import com.typesafe.sbt.packager.linux.{LinuxPackageMapping => pkgMap, LinuxSymlink} +import com.typesafe.sbt.packager.linux.LinuxPlugin.autoImport.packageMapping /** Create debian & rpm packages. * @@ -87,7 +88,7 @@ object Unix { // Debian Specific name in Debian := "scala", - debianPackageDependencies += "openjdk-7-jre-headless | java-runtime-headless", + debianPackageDependencies += "java8-runtime-headless", // debianPackageDependencies += "libjansi-java", linuxPackageMappings in Debian += (packageMapping( @@ -96,5 +97,6 @@ object Unix { // Hack so we use regular version, rather than debian version. target in Debian := target.value / s"${(name in Debian).value}-${version.value}" + ) } diff --git a/project/plugins.sbt b/project/plugins.sbt index 07c892e87..4ab1b9843 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,4 @@ -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "0.6.4") +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.4") addSbtPlugin("com.typesafe.sbt" % "sbt-s3" % "0.8")