diff --git a/.travis.yml b/.travis.yml index 6adb91c3c..537f317c6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ # # Available modes: # - `release` to build native packages and upload them to S3 -# - `archive` to copy archives to chara (for scala-lang.org) +# - `archives` to copy archives to chara (for scala-lang.org) # - `update-api` to update the scaladoc api symlinks # # (*) Using an `env: global: ...` section does not work because that overrides the default `env` @@ -22,7 +22,8 @@ install: - sudo apt-get install -y rpm language: scala -jdk: openjdk8 +# java 11+ needed for sttp +jdk: openjdk21 env: global: diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..0511f2126 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,7 @@ +all repositories in these organizations: + +* [scala](https://github.com/scala) +* [scalacenter](https://github.com/scalacenter) +* [lampepfl](https://github.com/lampepfl) + +are covered by the Scala Code of Conduct: https://scala-lang.org/conduct/ diff --git a/README.md b/README.md index 3814d7f7a..326d08ad9 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,25 @@ -# The Scala 2.12.x Distribution +# Scala 2.12 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). To build a distribution, run: - * `universal:packageBin` - Builds the universal zip installer - * `universal-docs:packageBin` - Builds the universal documentation zip - * `debian:packageBin` - Builds the Debian DEB file. *requires dpkg-deb* - * `rpm:packageBin` - Builds the yum RPM file. *requires rpmbuild* - * `windows:packageBin` - Builds the Windows MSI. *requires WiX 3.6* + * `Universal/packageBin` - Builds the universal zip installer + * `UniversalDocs/packageBin` - Builds the universal documentation zip + * `Debian/packageBin` - Builds the Debian DEB file. *requires dpkg-deb* + * `Rpm/packageBin` - Builds the yum RPM file. *requires rpmbuild* + * `Windows/packageBin` - Builds the Windows MSI. *requires WiX 3.6* Alternatively, the `s3Upload` 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.) +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, -as earlier ones did not publish the `scala-dist` artifact to maven. - -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. (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!) @@ -42,9 +31,9 @@ The specification also used to be in this repo -- it is now a part of the main r - 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://contribute.akka.io/cla/scala). +## Contributing + +Please sign the [CLA](https://contribute.akka.io/contribute/cla/scala). -The branching structure mimics that of [scala/scala](https://github.com/scala/scala): -branches for 2.12.x and 2.13.x. +The branching structure mimics that of [scala/scala](https://github.com/scala/scala); +there are branches for 2.12.x and 2.13.x. diff --git a/admin/build.ps1 b/admin/build.ps1 index 4c2316a30..a6335bb95 100644 --- a/admin/build.ps1 +++ b/admin/build.ps1 @@ -34,9 +34,12 @@ if ($env:APPVEYOR_FORCED_BUILD -eq 'true') { ensureVersion clearIvyCache if ($env:mode -eq 'release') { - echo "Running a release for $env:version" - $repositoriesFile="$env:APPVEYOR_BUILD_FOLDER\conf\repositories" - & cmd /c "sbt ""-Dsbt.override.build.repos=true"" ""-Dsbt.repository.config=$repositoriesFile"" ""-Dproject.version=$env:version"" ""show fullResolvers"" clean update s3Upload" '2>&1' + if ($env:version -match '-bin-' -or $env:version -match '-pre-') { + & cmd /c "sbt ""-Dproject.version=$env:version"" clean update ""show s3Upload/mappings""" '2>&1' + } else { + echo "Running a release for $env:version" + & cmd /c "sbt ""-Dproject.version=$env:version"" clean update ghUpload" '2>&1' + } checkExit } else { echo "Unknown mode: '$env:mode'" @@ -47,6 +50,6 @@ if ($env:APPVEYOR_FORCED_BUILD -eq 'true') { clearIvyCache # By default, test building the packages (but don't uplaod) # Need to redirect stderr, otherwise any error output (like jvm warning) fails the build (ErrorActionPreference) - & cmd /c "sbt ""-Dproject.version=$env:version"" ""show s3Upload::mappings""" '2>&1' + & cmd /c "sbt ""-Dproject.version=$env:version"" ""show s3Upload/mappings""" '2>&1' checkExit } diff --git a/admin/build.sh b/admin/build.sh index 792f7c419..142ce3f9c 100755 --- a/admin/build.sh +++ b/admin/build.sh @@ -90,15 +90,20 @@ if [[ "$TRAVIS_EVENT_TYPE" == "api" ]]; then setupSSH . scripts/jobs/release/website/update-api elif [[ "$mode" == "release" ]]; then - echo "Running a release for $version" triggerMsiRelease - repositoriesFile="$TRAVIS_BUILD_DIR/conf/repositories" - # The log is too long for the travis UI, so remove ANSI codes to have a clean raw version - sbt -Dsbt.log.noformat=true \ - -Dsbt.override.build.repos=true -Dsbt.repository.config="$repositoriesFile" \ - -Dproject.version=$version \ - "show fullResolvers" clean update s3Upload - triggerSmoketest + if [[ "$version" =~ -bin- || "$version" =~ -pre- ]]; then + # The log is too long for the travis UI, so remove ANSI codes to have a clean raw version + sbt -Dsbt.log.noformat=true \ + -Dproject.version=$version \ + clean update "show s3Upload/mappings" + else + echo "Running a release for $version" + # The log is too long for the travis UI, so remove ANSI codes to have a clean raw version + sbt -Dsbt.log.noformat=true \ + -Dproject.version=$version \ + clean update ghUpload + triggerSmoketest + fi else echo "Unknown build mode: '$mode'" exit 1 @@ -107,5 +112,5 @@ else version="2.12.4" clearIvyCache # By default, test building the packages (but don't uplaod) - sbt -Dproject.version=$version "show s3Upload::mappings" + sbt -Dproject.version=$version "show s3Upload/mappings" fi diff --git a/appveyor.yml b/appveyor.yml index 56fc955e6..80fd54566 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,10 +6,11 @@ branches: - 2.12.x - 2.13.x -image: Visual Studio 2015 +image: Visual Studio 2019 environment: - JAVA_HOME: C:\Program Files\Java\jdk1.8.0 + # java 11+ needed for sttp + JAVA_HOME: C:\Program Files\Java\jdk21 AWS_ACCESS_KEY_ID: secure: X1Ix1soRBDMtfbi8IFNPOggDP2XquhW+uKcJ+XC0kiM= AWS_SECRET_ACCESS_KEY: @@ -18,7 +19,7 @@ environment: secure: nfWNfbyzNQwdg1eWHZX93XIJLoAhFOr1fR8+L86s7a3jdo/HydEZ8TyEKsPipQ+/ install: - - cmd: choco install sbt --version=1.3.2 -ia "INSTALLDIR=""C:\sbt""" + - cmd: choco install sbt --version=1.10.11 -ia "INSTALLDIR=""C:\sbt""" - cmd: SET PATH=C:\sbt\bin;%JAVA_HOME%\bin;%PATH% build_script: diff --git a/build.sbt b/build.sbt index da20e087b..28f0c1995 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,6 @@ -import com.typesafe.sbt.SbtGit._ -import ScalaDist.upload +import ScalaDist.{s3Upload, ghUpload} + +resolvers += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/" // so we don't require a native git install useJGit @@ -9,6 +10,13 @@ useJGit // For testing, the version may be overridden with -Dproject.version=... versionWithGit +isSnapshot := { + git.overrideVersion(git.versionProperty.value) match { + case Some(v) => v.endsWith("-SNAPSHOT") || git.gitUncommittedChanges.value + case _ => isSnapshot.value // defined in SbtGit.scala + } +} + Versioning.settings // necessary since sbt 0.13.12 for some dark and mysterious reason @@ -16,11 +24,9 @@ Versioning.settings // are known/understood, at scala/scala-dist#171 scalaVersion := version.value -mappings in upload := Seq() +s3Upload / mappings := Seq() -upload := { - import com.amazonaws.{ClientConfiguration, Protocol} - import com.amazonaws.auth.DefaultAWSCredentialsProviderChain +s3Upload := { import com.amazonaws.services.s3.AmazonS3ClientBuilder import com.amazonaws.services.s3.model.PutObjectRequest import com.amazonaws.regions.Regions @@ -29,13 +35,50 @@ upload := { val client = AmazonS3ClientBuilder.standard.withRegion(Regions.US_EAST_1).build val log = streams.value.log - - (mappings in upload).value map { case (file, key) => + (s3Upload / mappings).value map { case (file, key) => log.info("Uploading "+ file.getAbsolutePath() +" as "+ key) client.putObject(new PutObjectRequest("downloads.typesafe.com", key, file)) } } +ghUpload := { + import sttp.client3._ + import _root_.io.circe._, _root_.io.circe.parser._ + + val log = streams.value.log + val ghRelease = s"v${(Universal / version).value}" + + val token = sys.env.getOrElse("GITHUB_OAUTH_TOKEN", throw new MessageOnlyException("GITHUB_OAUTH_TOKEN missing")) + + val backend = HttpURLConnectionBackend() + + val rRes = basicRequest + .get(uri"https://api.github.com/repos/scala/scala/releases/tags/$ghRelease") + .header("Accept", "application/vnd.github+json") + .header("Authorization", s"Bearer $token") + .header("X-GitHub-Api-Version", "2022-11-28") + .send(backend) + val releaseId = rRes.body.flatMap(parse).getOrElse(Json.Null).hcursor.downField("id").as[Int].getOrElse( + throw new MessageOnlyException(s"Release not found: $ghRelease")) + + (s3Upload / mappings).value map { case (file, _) => + log.info(s"Uploading ${file.getAbsolutePath} as ${file.getName} to https://github.com/scala/scala/releases/tag/$ghRelease") + + // https://docs.github.com/en/rest/releases/assets?apiVersion=2022-11-28#upload-a-release-asset + val request = basicRequest + .post(uri"https://uploads.github.com/repos/scala/scala/releases/${releaseId}/assets?name=${file.getName}") + .contentType("application/octet-stream") + .header("Accept", "application/vnd.github+json") + .header("Authorization", s"Bearer $token") + .header("X-GitHub-Api-Version", "2022-11-28") + .body(file) + + val response = request.send(backend) + if (response.code.code != 201) + throw new MessageOnlyException(s"Upload failed: status=${response.code}\n${response.body}") + } +} + ScalaDist.settings Docs.settings @@ -44,6 +87,16 @@ ScalaDist.platformSettings enablePlugins(UniversalPlugin, RpmPlugin, JDebPackaging, WindowsPlugin) +// TODO This silences a warning I don't understand. +// +// * scala-dist / Universal / configuration +// +- /Users/jz/code/scala-dist/build.sbt:35 +// * scala-dist / Universal-docs / configuration +// +- /Users/jz/code/scala-dist/build.sbt:35 +// * scala-dist / Universal-src / configuration +// +- /Users/jz/code/scala-dist/build.sbt:35 +Global / excludeLintKeys += configuration + // resolvers += "local" at "file:///e:/.m2/repository" // resolvers += Resolver.mavenLocal // to test, run e.g., stage, or windows:packageBin, show s3Upload::mappings diff --git a/conf/repositories b/conf/repositories deleted file mode 100644 index 3e92a67b0..000000000 --- a/conf/repositories +++ /dev/null @@ -1,8 +0,0 @@ -[repositories] - scala-integration: https://scala-ci.typesafe.com/artifactory/scala-integration/ - sonatype-staging: https://oss.sonatype.org/content/repositories/staging/ - jcenter-cache: https://scala-ci.typesafe.com/artifactory/jcenter/ - typesafe-ivy-releases: https://repo.lightbend.com/typesafe/ivy-releases/, [organisation]/[module]/[revision]/[type]s/[artifact](-[classifier]).[ext], bootOnly - sbt-plugin-releases: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/, [organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext] - maven-central - local diff --git a/project/Docs.scala b/project/Docs.scala index ac8b99911..9ea691c17 100644 --- a/project/Docs.scala +++ b/project/Docs.scala @@ -16,16 +16,16 @@ object Docs { import ScalaDist._ def settings: Seq[Setting[_]] = Seq( - packageName in UniversalDocs := s"scala-docs-${version.value}", + UniversalDocs / packageName := s"scala-docs-${version.value}", // libraryDependencies += scalaDistDep(version.value, "javadoc"), // seems not to be necessary // need updateClassifiers to get javadoc jars - mappings in UniversalDocs ++= createMappingsWith(updateClassifiers.value.toSeq, universalDocsMappings) + UniversalDocs / mappings ++= createMappingsWith(updateClassifiers.value.toSeq, universalDocsMappings) ) private def universalDocsMappings(id: ModuleID, artifact: Artifact, file: File): Seq[(File, String)] = { def includeJar = (file -> s"api/jars/${id.name}-${id.revision}-javadoc.jar") - artifact match { - case Artifact("scala-library" | "scala-reflect" | "scala-compiler", "doc", _, _, _, _, _) => + artifact.name match { + case "scala-library" | "scala-reflect" | "scala-compiler" if artifact.`type` == "doc" => val tmpdir = IO.createTemporaryDirectory IO.unzip(file, tmpdir) // IO.listFiles(tmpdir) does not recurse, use ** with glob "*" to find all files @@ -35,7 +35,7 @@ object Docs { Seq(file -> s"api/${id.name}/$relative") } includeJar +: exploded - case Artifact(_, "doc", _, _, _, _, _) => + case _ if artifact.`type` == "doc" => Seq(includeJar) case _ => Seq() } diff --git a/project/ScalaDist.scala b/project/ScalaDist.scala index ce7a91cf9..a6d2872ed 100644 --- a/project/ScalaDist.scala +++ b/project/ScalaDist.scala @@ -10,41 +10,44 @@ import com.amazonaws.services.s3.model.PutObjectResult // can't call it Universal -- that's taken by the packager object ScalaDist { - val upload=TaskKey[Seq[PutObjectResult]]("s3-upload","Uploads files to an S3 bucket.") + val s3Upload = TaskKey[Seq[PutObjectResult]]("s3Upload","Uploads files to an S3 bucket.") + val ghUpload = TaskKey[Seq[Unit]]("ghUpload","Uploads files to GitHub Releases.") - def createMappingsWith(deps: Seq[(String, ModuleID, Artifact, File)], + def createMappingsWith(deps: Seq[(sbt.librarymanagement.ConfigRef, ModuleID, Artifact, File)], distMappingGen: (ModuleID, Artifact, File) => Seq[(File, String)]): Seq[(File, String)] = deps flatMap { - case d@(ScalaDistConfig, id, artifact, file) => distMappingGen(id, artifact, file) + case (configRef, id, artifact, file) + if configRef.name == ScalaDistConfigName && id.configurations.contains("runtime") => + distMappingGen(id, artifact, file) case _ => Seq() } - // used to make s3-upload upload the file produced by fileTask to the path scala/$version/${file.name} + // used to make s3Upload upload the file produced by fileTask to the path scala/$version/${file.name} private def uploadMapping(fileTask: TaskKey[File]) = Def.task { val file = fileTask.value file -> s"scala/${version.value}/${file.getName}" } - // make it so that s3-upload will upload the msi when we're running on windows, and everything else when we're on linux - // s3-upload thus depends on the package tasks listed below + // make it so that s3Upload will upload the msi when we're running on windows, and everything else when we're on linux + // s3Upload thus depends on the package tasks listed below def platformSettings = if (sys.props("os.name").toLowerCase(java.util.Locale.US) contains "windows") - Wix.settings :+ (mappings in upload += uploadMapping(packageBin in Windows).value) + Wix.settings :+ (s3Upload / mappings += uploadMapping(Windows / packageBin).value) else Unix.settings ++ Seq( - mappings in upload += uploadMapping(packageBin in Universal).value, - mappings in upload += uploadMapping(packageZipTarball in Universal).value, - mappings in upload += uploadMapping(packageBin in UniversalDocs).value, - mappings in upload += uploadMapping(packageZipTarball in UniversalDocs).value, - mappings in upload += uploadMapping(packageXzTarball in UniversalDocs).value, - mappings in upload += uploadMapping(packageBin in Rpm).value, + s3Upload / mappings += uploadMapping(Universal / packageBin).value, + s3Upload / mappings += uploadMapping(Universal / packageZipTarball).value, + s3Upload / mappings += uploadMapping(UniversalDocs / packageBin).value, + s3Upload / mappings += uploadMapping(UniversalDocs / packageZipTarball).value, + s3Upload / mappings += uploadMapping(UniversalDocs / packageXzTarball).value, + s3Upload / mappings += uploadMapping(Rpm / packageBin).value, // Debian needs special handling because the value sbt-native-packager - // gives us for `packageBin in Debian` (coming from the archiveFilename + // gives us for `Debian / packageBin` (coming from the archiveFilename // method) includes the debian version and arch information, // which we historically have not included. I don't see a way to // override the filename on disk, so we re-map at upload time - mappings in upload += Def.task { - (packageBin in Debian).value -> - s"scala/${version.value}/${(name in Debian).value}-${version.value}.deb" + s3Upload / mappings += Def.task { + (Debian / packageBin).value -> + s"scala/${version.value}/${(Debian / name).value}-${version.value}.deb" }.value ) @@ -57,29 +60,23 @@ object ScalaDist { packageDescription := "Have the best of both worlds. Construct elegant class hierarchies for maximum code reuse and extensibility, implement their behavior using higher-order functions. Or anything in-between.", crossPaths := false, - ivyConfigurations += config(ScalaDistConfig), + ivyConfigurations += ScalaDistConfig, libraryDependencies += scalaDistDep(version.value, "runtime"), // create lib directory by resolving scala-dist's dependencies // to populate the rest of the distribution, explode scala-dist artifact itself - mappings in Universal ++= createMappingsWith(update.value.toSeq, universalMappings), - - // work around regression in sbt-native-packager 1.0.5 where - // these tasks invoke `tar` without any flags at all. the issue - // was fixed in 1.1.0, so this could be revisited when we upgrade - universalArchiveOptions in (UniversalDocs, packageZipTarball) := Seq("--force-local", "-pcvf"), - universalArchiveOptions in (UniversalDocs, packageXzTarball ) := Seq("--force-local", "-pcvf") - + Universal / mappings ++= createMappingsWith(update.value.toSeq, universalMappings), ) // private lazy val onWindows = System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows") // only used for small batch files, normalize line endings in-place // private def toDosInPlace(f: File) = IO.writeLines(file, IO.readLines(file)) - private lazy val ScalaDistConfig = "scala-dist" + private lazy val ScalaDistConfigName = "scala-dist" + private lazy val ScalaDistConfig = config(ScalaDistConfigName) // segregate scala-dist's compile dependencies into the scala-dist config private def scalaDistDep(v: String, config: String): ModuleID = - "org.scala-lang" % "scala-dist" % v % s"${ScalaDistConfig}; ${ScalaDistConfig}->${config}" + "org.scala-lang" % "scala-dist" % v % s"${ScalaDistConfigName}; ${ScalaDistConfigName}->${config}" // map module to the corresponding file mappings (unzipping scala-dist in the process) private def universalMappings(id: ModuleID, artifact: Artifact, file: File): Seq[(File, String)] = id.name match { @@ -90,7 +87,7 @@ object ScalaDist { // create mappings from the unzip scala-dist zip contentOf(tmpdir) filter { - case (file, dest) => !(dest.endsWith("MANIFEST.MF") || dest.endsWith("META-INF")) + case (_, dest) => !(dest.endsWith("MANIFEST.MF") || dest.endsWith("META-INF")) } map { // make unix scripts executable (heuristically...) case (file, dest) if (dest startsWith "bin/") && !(dest endsWith ".bat") => diff --git a/project/Unix.scala b/project/Unix.scala index 06c33565e..8be94ee80 100644 --- a/project/Unix.scala +++ b/project/Unix.scala @@ -27,7 +27,7 @@ object Unix { // symlinks for s"/usr/bin/$script" --> s"${installTargetUnix.value}/bin/$script" // TODO: reuse code from native packager linuxPackageSymlinks ++= ( - (mappings in Universal).value collect { + (Universal / mappings).value collect { case (file, name) if (name startsWith "bin/") && !(name endsWith ".bat") => LinuxSymlink("/usr/" + name, (installTargetUnix.value / name).getAbsolutePath) } @@ -37,13 +37,13 @@ object Unix { def home(name: String) = (installTargetUnix.value / name).getAbsolutePath def docHome(name: String) = (installTargetUnixDocs.value / name).getAbsolutePath - val m = (mappings in Universal).value + val m = (Universal / mappings).value // some mappings need special treatment (different root, perms,...) val (special, regular) = m partition { case (file, name) => (name startsWith "bin") || (name startsWith "doc") || (name startsWith "man") } - val docs = (mappings in UniversalDocs).value + val docs = (UniversalDocs / mappings).value Seq( // no special treatment needed @@ -59,27 +59,27 @@ object Unix { (pkgMap( (special collect { case (file, name) if name startsWith "doc/" => file -> docHome(name drop 4) }) ++ (docs map { case (file, name) => file -> docHome(name) }) :+ - (((sourceDirectory in Linux).value / "copyright") -> docHome("copyright"))) + (((Linux / sourceDirectory).value / "copyright") -> docHome("copyright"))) withPerms "0644").asDocs ) }, // RPM Specific - name in Rpm := "scala", + Rpm / name := "scala", rpmVendor := "akka", rpmUrl := Some("https://github.com/scala/scala"), rpmLicense := Some("Apache 2"), rpmGroup := Some("Development/Languages"), // This hack lets us ignore the RPM specific versioning junks. - packageBin in Rpm := { - val simplified = target.value / s"${(name in Rpm).value}-${version.value}.rpm" + Rpm / packageBin := { + val simplified = target.value / s"${(Rpm / name).value}-${version.value}.rpm" - val rpm = (packageBin in Rpm).value match { + val rpm = (Rpm / packageBin).value match { case reported if reported.exists => reported case _ => // hack on top of hack because RpmHelper.buildRpm is broken on Mac -- `spec.meta.arch` doesn't necessarily match the arch `rpmbuild` decided on - (PathFinder(IO.listFiles((target in Rpm).value)) ** "*.rpm").get.find(file => - file.getName contains (name in Rpm).value).get + (PathFinder(IO.listFiles((Rpm / target).value)) ** "*.rpm").get.find(file => + file.getName contains (Rpm / name).value).get } IO.copyFile(rpm, simplified) @@ -87,10 +87,10 @@ object Unix { }, // Debian Specific - name in Debian := "scala", + Debian / name := "scala", debianPackageDependencies += "java8-runtime-headless", - linuxPackageMappings in Debian += (packageMapping( + Debian / linuxPackageMappings += (packageMapping( (sourceDirectory.value / "debian" / "changelog") -> "/usr/share/doc/scala/changelog.gz" ).withUser("root").withGroup("root").withPerms("0644").gzipped).asDocs() diff --git a/project/Versioning.scala b/project/Versioning.scala index b58adc7a0..305c3138f 100644 --- a/project/Versioning.scala +++ b/project/Versioning.scala @@ -5,9 +5,9 @@ import com.typesafe.sbt.SbtNativePackager.{Windows, Debian, Rpm} object Versioning { def settings: Seq[Setting[_]] = Seq( - version in Windows := makeWindowsVersion(version.value), - version in Debian := toDebianVersion((version in Windows).value), - version in Rpm := toRpmVersion((version in Windows).value)) + Windows / version := makeWindowsVersion(version.value), + Debian / version := toDebianVersion((Windows / version).value), + Rpm / version := toRpmVersion((Windows / version).value)) private def rpmBuild(version:String): String = version split "\\." match { case Array(_,_,_, b) => b diff --git a/project/Wix.scala b/project/Wix.scala index d8cdc42e0..5ec431415 100644 --- a/project/Wix.scala +++ b/project/Wix.scala @@ -11,22 +11,22 @@ import WixHelper.{generateComponentsAndDirectoryXml, cleanFileName} object Wix { // Windows installer configuration def settings: Seq[Setting[_]] = Seq( - mappings in Windows := (mappings in Universal).value, - // distributionFiles in Windows += (packageMsi in Windows).value, + Windows / mappings := (Universal / mappings).value, + // Windows / distributionFiles += (Windows / packageMsi).value, wixProductId := "7606e6da-e168-42b5-8345-b08bf774cb30", wixProductUpgradeId := "6061c134-67c7-4fb2-aff5-32b01a186968", // wixProductComments := "Scala Programming language for use in Windows.", - wixProductConfig := makeProductConfig((stagingDirectory in Universal).value, (stagingDirectory in UniversalDocs).value), + wixProductConfig := makeProductConfig((Universal / stagingDirectory).value, (UniversalDocs / stagingDirectory).value), wixProductConfig := (wixProductConfig - dependsOn (stage in Universal) - dependsOn (stage in UniversalDocs)).value, + dependsOn (Universal / stage) + dependsOn (UniversalDocs / stage)).value, - packageBin in Windows := { + Windows / packageBin := { val versioned = target.value / s"${name.value}-${version.value}.msi" - IO.copyFile((packageBin in Windows).value, versioned) + IO.copyFile((Windows / packageBin).value, versioned) versioned } ) @@ -39,7 +39,7 @@ object Wix { // enable -Xfatal-warnings again in scalacOptions in project/plugins.sbt val (bin, binDirXml0) = generateComponentsAndDirectoryXml(stage / "bin") val (doc, docDirXml) = generateComponentsAndDirectoryXml(stage / "doc", "doc_") - val (lib, libDirXml) = generateComponentsAndDirectoryXml(stage / "lib") + val (lib, libDirXml) = generateComponentsAndDirectoryXml(stage / "lib", "lib_") val (api, apiDirXml) = generateComponentsAndDirectoryXml(stageApi / "api", "api_") // add component that adds bin folder to path diff --git a/project/build.properties b/project/build.properties index 8e682c526..cc68b53f1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.18 +sbt.version=1.10.11 diff --git a/project/plugins.sbt b/project/plugins.sbt index f71b7bdbb..76d716f14 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,11 +1,17 @@ -scalacOptions ++= Seq("-deprecation", "-feature", "-Xlint") +scalacOptions ++= Seq("-deprecation", "-feature", "-Xlint:_,-unused") -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6") +// jdeb and spotify docker are 'provided' in sbt-native-packager +libraryDependencies += "org.vafer" % "jdeb" % "1.9" artifacts (Artifact("jdeb", "jar", "jar")) +libraryDependencies += "com.spotify" % "docker-client" % "8.16.0" +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1") -libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % "1.11.277" +libraryDependencies += "com.amazonaws" % "aws-java-sdk-s3" % "1.12.5" -// git plugin -resolvers += "jgit-repo" at "http://download.eclipse.org/jgit/maven" - -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.6.4") +libraryDependencies += "com.softwaremill.sttp.client3" %% "core" % "3.11.0" +libraryDependencies ++= Seq( + "io.circe" %% "circe-core", + "io.circe" %% "circe-generic", + "io.circe" %% "circe-parser" +).map(_ % "0.14.13") +addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.1") diff --git a/scripts/common b/scripts/common index 782bd0243..0832adc91 100755 --- a/scripts/common +++ b/scripts/common @@ -14,7 +14,7 @@ function travis_fold_end() { function postCommitStatus() { if [[ "$scala_sha" != "" ]]; then local jsonTemplate='{ "state": "%s", "target_url": "%s", "description": "%s", "context": "%s"}' - local json=$(printf "$jsonTemplate" "$1" "https://travis-ci.com/scala/scala-dist/builds/$TRAVIS_BUILD_ID" "$1" "travis/scala-dist/$version/$mode") + local json=$(printf "$jsonTemplate" "$1" "https://app.travis-ci.com/github/scala/scala-dist/builds/$TRAVIS_BUILD_ID" "$1" "travis/scala-dist/$version/$mode") [[ -z "$GITHUB_OAUTH_TOKEN" ]] && (echo "Missing environment variable GITHUB_OAUTH_TOKEN!"; exit 1) TMPFILE=$(mktemp -t curl.XXXXXXXXXX) diff --git a/scripts/jobs/release/package/generic b/scripts/jobs/release/package/generic deleted file mode 100755 index 5fe5d624f..000000000 --- a/scripts/jobs/release/package/generic +++ /dev/null @@ -1,32 +0,0 @@ -# @pre current directory == repo root -# must run on both windows (cygwin) and linux - -# invoked from scala-release-2.11.x-[unix|windows] - -# uses the following env vars: -# - WORKSPACE, JAVA_OPTS (jenkins standard) -# - version checked for consistency against HEAD's tag -# - sbtLauncher is a global jenkins configuration variable -# - sbtDistTarget the target (beyond clean and update) to run -# - sbtDistVersionOverride may be -Dproject.version=.... to override the version of the dist to build (only for testing, you should use tags for real releases!) - -# requires git (>= 1.8), java, bash - -repositoriesFile="$WORKSPACE/conf/repositories" - -tags="$(git tag --points-at HEAD)" - -# version is set by the scala-release-2.11.x-dist build flow, make sure it's consistent with the tag -# this is also a backstop for https://github.com/sbt/sbt-git/issues/35 -# ignore when there is no version (job is running outside of the flow) -[[ -z $sbtDistVersionOverride ]] && [[ -n $version ]] && if [ "$tags" != "v$version" ]; then - echo "Inconsistent tag/version combo detected. Abort-abort." - exit 255 -fi - -# want full control over sbt, so invoke the launcher directly -java $JAVA_OPTS -Dsbt.log.noformat=true -Dsbt.ivy.home=$WORKSPACE/.ivy2 \ - -Dsbt.override.build.repos=true -Dsbt.repository.config="$repositoriesFile" \ - -jar $sbtLauncher \ - $sbtDistVersionOverride \ - clean update $sbtDistTarget diff --git a/scripts/jobs/release/package/unix b/scripts/jobs/release/package/unix deleted file mode 100755 index f0f0ddc20..000000000 --- a/scripts/jobs/release/package/unix +++ /dev/null @@ -1,6 +0,0 @@ -# @pre current directory == repo root - -# to be extra-sure we don't pollute -rm -rf $WORKSPACE/.ivy2 - -. scripts/jobs/release/package/generic \ No newline at end of file diff --git a/scripts/jobs/release/package/windows b/scripts/jobs/release/package/windows deleted file mode 100755 index 3a0ec4032..000000000 --- a/scripts/jobs/release/package/windows +++ /dev/null @@ -1,6 +0,0 @@ -# @pre current directory == repo root - -# to be extra-sure we don't pollute -rm -rf "$(/usr/bin/cygpath --unix $WORKSPACE/.ivy2)" - -. scripts/jobs/release/package/generic \ No newline at end of file