sbt/launcher-package/build.sbt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

534 lines
23 KiB
Plaintext
Raw Normal View History

import scala.util.control.Exception.catching
import scala.sys.process.*
import NativePackagerHelper.*
import com.typesafe.sbt.packager.SettingsHelper.*
import DebianConstants.*
import Dependencies.*
2017-04-07 06:56:55 +02:00
lazy val sbtOfflineInstall =
2021-04-24 22:27:38 +02:00
sys.props.getOrElse("sbt.build.offline", sys.env.getOrElse("sbt.build.offline", "false")) match {
2017-05-11 06:11:11 +02:00
case "true" | "1" => true
case "false" | "0" => false
case _ => false
2017-04-07 06:56:55 +02:00
}
lazy val sbtIncludeSbtn =
sys.props.getOrElse("sbt.build.includesbtn", sys.env.getOrElse("sbt.build.includesbtn", "true")) match {
case "true" | "1" => true
case "false" | "0" => false
case _ => false
}
2021-04-24 22:27:38 +02:00
lazy val sbtIncludeSbtLaunch =
sys.props.getOrElse("sbt.build.includesbtlaunch", sys.env.getOrElse("sbt.build.includesbtlaunch", "true")) match {
case "true" | "1" => true
case "false" | "0" => false
case _ => false
}
lazy val sbtVersionToRelease = sys.props
.getOrElse("sbt.build.version", sys.env.getOrElse("sbt.build.version", "1.12.0"))
lazy val scala210 = "2.10.7"
lazy val scala210Jline = "org.scala-lang" % "jline" % scala210
lazy val jansi = {
2019-10-14 08:59:34 +02:00
if (sbtVersionToRelease startsWith "1.") "org.fusesource.jansi" % "jansi" % "1.12"
else "org.fusesource.jansi" % "jansi" % "1.4"
}
lazy val scala212Compiler = "org.scala-lang" % "scala-compiler" % scala212
lazy val scala212Jline = "jline" % "jline" % "2.14.6"
2025-12-09 09:06:51 +01:00
// use the scala-xml version used by the compiler not the latest: https://github.com/scala/scala/blob/v2.12.21/versions.properties
lazy val scala212Xml = "org.scala-lang.modules" % "scala-xml_2.12" % "2.3.0"
lazy val sbtActual = "org.scala-sbt" % "sbt" % sbtVersionToRelease
lazy val sbt013ExtraDeps = {
if (sbtVersionToRelease startsWith "0.13.") Seq(scala210Jline)
else Seq()
}
lazy val isWindows: Boolean = sys.props("os.name").toLowerCase(java.util.Locale.ENGLISH).contains("windows")
2016-05-09 06:25:16 +02:00
lazy val isExperimental = (sbtVersionToRelease contains "RC") || (sbtVersionToRelease contains "M")
val sbtLaunchJarUrl = SettingKey[String]("sbt-launch-jar-url")
2016-10-31 21:30:39 +01:00
val sbtLaunchJarLocation = SettingKey[File]("sbt-launch-jar-location")
val sbtLaunchJar = TaskKey[File]("sbt-launch-jar", "Resolves SBT launch jar")
2016-05-09 06:25:16 +02:00
val moduleID = (organization) apply { (o) => ModuleID(o, "sbt", sbtVersionToRelease) }
val sbtnVersion = SettingKey[String]("sbtn-version")
2020-09-23 08:53:13 +02:00
val sbtnJarsMappings = TaskKey[Seq[(File, String)]]("sbtn-jars-mappings", "Resolves sbtn JARs")
val sbtnJarsBaseUrl = SettingKey[String]("sbtn-jars-base-url")
lazy val bintrayDebianUrl = settingKey[String]("API point for Debian packages")
lazy val bintrayDebianExperimentalUrl = settingKey[String]("API point for Debian experimental packages")
lazy val bintrayRpmUrl = settingKey[String]("API point for RPM packages")
lazy val bintrayRpmExperimentalUrl = settingKey[String]("API point for RPM experimental packages")
lazy val bintrayGenericPackagesUrl = settingKey[String]("API point for generic packages")
lazy val bintrayTripple = settingKey[(String, String, String)]("id, url, and pattern")
2021-04-25 02:26:18 +02:00
val artifactoryLinuxPattern = "[module]-[revision].[ext]"
val artifactoryDebianPattern = "[module]-[revision].[ext];deb.distribution=all;deb.component=main;deb.architecture=all"
val bintrayGenericPattern = "[module]/[revision]/[module]/[revision]/[module]-[revision].[ext]"
2015-08-11 07:30:16 +02:00
val bintrayReleaseAllStaged = TaskKey[Unit]("bintray-release-all-staged", "Release all staged artifacts on bintray.")
val windowsBuildId = settingKey[Int]("build id for Windows installer")
2017-04-27 02:08:26 +02:00
val debianBuildId = settingKey[Int]("build id for Debian")
val exportRepoUsingCoursier = taskKey[File]("export Maven style repository")
val exportRepoCsrDirectory = settingKey[File]("")
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val exportRepo = taskKey[File]("export Ivy style repository")
val exportRepoDirectory = settingKey[File]("directory for exported repository")
2024-05-06 04:18:40 +02:00
val universalMacPlatform = "universal-apple-darwin"
val x86LinuxPlatform = "x86_64-pc-linux"
val aarch64LinuxPlatform = "aarch64-pc-linux"
val x86WindowsPlatform = "x86_64-pc-win32"
2024-05-06 04:18:40 +02:00
val universalMacImageName = s"sbtn-$universalMacPlatform"
val x86LinuxImageName = s"sbtn-$x86LinuxPlatform"
val aarch64LinuxImageName = s"sbtn-$aarch64LinuxPlatform"
val x86WindowsImageName = s"sbtn-$x86WindowsPlatform.exe"
Global / excludeLintKeys += bintrayGenericPackagesUrl
2021-04-24 21:53:08 +02:00
// This build creates a SBT plugin with handy features *and* bundles the SBT script for distribution.
val launcherPackage = (project in file(".")).
2017-01-21 12:36:33 +01:00
enablePlugins(UniversalPlugin, LinuxPlugin, DebianPlugin, RpmPlugin, WindowsPlugin,
UniversalDeployPlugin, RpmDeployPlugin, WindowsDeployPlugin).
settings(
name := "sbt-launcher-packaging",
2016-10-31 21:30:39 +01:00
packageName := "sbt",
2017-01-21 12:36:33 +01:00
crossTarget := target.value,
2017-03-11 22:34:18 +01:00
clean := {
val _ = (dist / clean).value
2017-03-11 22:34:18 +01:00
clean.value
},
2020-01-24 21:03:40 +01:00
credentials ++= {
(sys.env.get("BINTRAY_USER"), sys.env.get("BINTRAY_PASS")) match {
case (Some(u), Some(p)) => Seq(Credentials("Bintray API Realm", "api.bintray.com", u, p))
case _ => Nil
}
},
2017-05-11 06:11:11 +02:00
usePgpKeyHex("642AC823"),
2017-05-10 19:33:07 +02:00
pgpSecretRing := file(s"""${sys.props("user.home")}""") / ".ssh" / "scalasbt.key",
pgpPublicRing := file(s"""${sys.props("user.home")}""") / ".ssh" / "scalasbt.pub",
publishToSettings,
2016-05-09 06:25:16 +02:00
sbtLaunchJarUrl := downloadUrlForVersion(sbtVersionToRelease),
2017-01-21 12:36:33 +01:00
sbtLaunchJarLocation := { target.value / "sbt-launch.jar" },
sbtLaunchJar := {
val uri = sbtLaunchJarUrl.value
val file = sbtLaunchJarLocation.value
if(!file.exists) {
// oddly, some places require us to create the file before writing...
IO.touch(file)
val url = new URI(uri).toURL
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val connection = url.openConnection()
val input = connection.getInputStream
val writer = new java.io.BufferedOutputStream(new java.io.FileOutputStream(file))
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
try {
val buffer = new Array[Byte](8192)
var bytesRead = input.read(buffer)
while (bytesRead != -1) {
writer.write(buffer, 0, bytesRead)
bytesRead = input.read(buffer)
}
} finally {
input.close()
writer.close()
}
}
// TODO - GPG Trust validation.
file
},
2021-05-17 21:40:30 +02:00
// update sbt.sh at root
2025-09-07 00:42:39 +02:00
sbtnVersion := "1.11.6",
sbtnJarsBaseUrl := "https://github.com/sbt/sbtn-dist/releases/download",
sbtnJarsMappings := {
val baseUrl = sbtnJarsBaseUrl.value
val v = sbtnVersion.value
2024-05-06 04:18:40 +02:00
val macosUniversalImageTar = s"sbtn-$universalMacPlatform-$v.tar.gz"
val linuxX86ImageTar = s"sbtn-$x86LinuxPlatform-$v.tar.gz"
val linuxAarch64ImageTar = s"sbtn-$aarch64LinuxPlatform-$v.tar.gz"
2020-09-23 08:53:13 +02:00
val windowsImageZip = s"sbtn-$x86WindowsPlatform-$v.zip"
val t = target.value
2024-05-06 04:18:40 +02:00
val macosUniversalTar = t / macosUniversalImageTar
val linuxX86Tar = t / linuxX86ImageTar
val linuxAarch64Tar = t / linuxAarch64ImageTar
val windowsZip = t / windowsImageZip
2024-05-06 04:18:40 +02:00
if(!macosUniversalTar.exists && !isWindows && sbtIncludeSbtn) {
IO.touch(macosUniversalTar)
val url = new URI(s"$baseUrl/v$v/$macosUniversalImageTar").toURL
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val connection = url.openConnection()
val input = connection.getInputStream
2024-05-06 04:18:40 +02:00
val writer = new java.io.BufferedOutputStream(new java.io.FileOutputStream(macosUniversalTar))
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
try {
val buffer = new Array[Byte](8192)
var bytesRead = input.read(buffer)
while (bytesRead != -1) {
writer.write(buffer, 0, bytesRead)
bytesRead = input.read(buffer)
}
} finally {
input.close()
writer.close()
}
2024-05-06 04:18:40 +02:00
val platformDir = t / universalMacPlatform
IO.createDirectory(platformDir)
2024-05-06 04:18:40 +02:00
s"tar zxvf $macosUniversalTar --directory $platformDir".!
IO.move(platformDir / "sbtn", t / universalMacImageName)
}
if(!linuxX86Tar.exists && !isWindows && sbtIncludeSbtn) {
IO.touch(linuxX86Tar)
val url = new URI(s"$baseUrl/v$v/$linuxX86ImageTar").toURL
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val connection = url.openConnection()
val input = connection.getInputStream
val writer = new java.io.BufferedOutputStream(new java.io.FileOutputStream(linuxX86Tar))
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
try {
val buffer = new Array[Byte](8192)
var bytesRead = input.read(buffer)
while (bytesRead != -1) {
writer.write(buffer, 0, bytesRead)
bytesRead = input.read(buffer)
}
} finally {
input.close()
writer.close()
}
val platformDir = t / x86LinuxPlatform
IO.createDirectory(platformDir)
s"""tar zxvf $linuxX86Tar --directory $platformDir""".!
IO.move(platformDir / "sbtn", t / x86LinuxImageName)
}
if(!linuxAarch64Tar.exists && !isWindows && sbtIncludeSbtn) {
IO.touch(linuxAarch64Tar)
val url = new URI(s"$baseUrl/v$v/$linuxAarch64ImageTar").toURL
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val connection = url.openConnection()
val input = connection.getInputStream
val writer = new java.io.BufferedOutputStream(new java.io.FileOutputStream(linuxAarch64Tar))
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
try {
val buffer = new Array[Byte](8192)
var bytesRead = input.read(buffer)
while (bytesRead != -1) {
writer.write(buffer, 0, bytesRead)
bytesRead = input.read(buffer)
}
} finally {
input.close()
writer.close()
}
val platformDir = t / aarch64LinuxPlatform
IO.createDirectory(platformDir)
s"""tar zxvf $linuxAarch64Tar --directory $platformDir""".!
IO.move(platformDir / "sbtn", t / aarch64LinuxImageName)
}
if(!windowsZip.exists && sbtIncludeSbtn) {
IO.touch(windowsZip)
val url = new URI(s"$baseUrl/v$v/$windowsImageZip").toURL
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val connection = url.openConnection()
val input = connection.getInputStream
val writer = new java.io.BufferedOutputStream(new java.io.FileOutputStream(windowsZip))
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
try {
val buffer = new Array[Byte](8192)
var bytesRead = input.read(buffer)
while (bytesRead != -1) {
writer.write(buffer, 0, bytesRead)
bytesRead = input.read(buffer)
}
} finally {
input.close()
writer.close()
}
val platformDir = t / x86WindowsPlatform
IO.unzip(windowsZip, platformDir)
IO.move(platformDir / "sbtn.exe", t / x86WindowsImageName)
}
if (!sbtIncludeSbtn) Seq()
else if (isWindows) Seq(t / x86WindowsImageName -> s"bin/$x86WindowsImageName")
else
2024-05-06 04:18:40 +02:00
Seq(t / universalMacImageName -> s"bin/$universalMacImageName",
t / x86LinuxImageName -> s"bin/$x86LinuxImageName",
t / aarch64LinuxImageName -> s"bin/$aarch64LinuxImageName",
t / x86WindowsImageName -> s"bin/$x86WindowsImageName")
},
2019-02-22 23:48:37 +01:00
// GENERAL LINUX PACKAGING STUFFS
2023-06-20 13:42:07 +02:00
maintainer := "Eugene Yokota <eed3si9n@gmail.com>",
2015-08-11 07:34:13 +02:00
packageSummary := "sbt, the interactive build tool",
packageDescription := """This script provides a native way to run sbt,
a build tool for Scala and more.""",
// Here we remove the jar file and launch lib from the symlinks:
2017-01-21 12:36:33 +01:00
linuxPackageSymlinks := {
val links = linuxPackageSymlinks.value
2016-05-09 06:25:16 +02:00
for {
link <- links
if !(link.destination endsWith "sbt-launch.jar")
} yield link
},
2015-08-11 07:34:13 +02:00
// DEBIAN SPECIFIC
2020-01-24 17:56:29 +01:00
debianBuildId := sys.props.getOrElse("sbt.build.patch", sys.env.getOrElse("DIST_PATCHVER", "0")).toInt,
Debian / version := {
2017-04-27 02:08:26 +02:00
if (debianBuildId.value == 0) sbtVersionToRelease
else sbtVersionToRelease + "." + debianBuildId.value
},
// Used to have "openjdk-8-jdk" but that doesn't work on Ubuntu 14.04 https://github.com/sbt/sbt/issues/3105
// before that we had java6-runtime-headless" and that was pulling in JDK9 on Ubuntu 16.04 https://github.com/sbt/sbt/issues/2931
Debian / debianPackageDependencies ++= Seq("bash (>= 3.2)", "curl | wget"),
Debian / debianPackageRecommends += "git",
Debian / linuxPackageMappings += {
2017-01-21 12:36:33 +01:00
val bd = sourceDirectory.value
(packageMapping(
2017-01-21 12:36:33 +01:00
(bd / "debian" / "changelog") -> "/usr/share/doc/sbt/changelog.gz"
) withUser "root" withGroup "root" withPerms "0644" gzipped) asDocs()
},
Debian / debianChangelog := { Some(sourceDirectory.value / "debian" / "changelog") },
addPackage(Debian, (Debian / packageBin), "deb"),
Debian / debianNativeBuildOptions := Seq("-Zgzip", "-z3"),
2019-01-08 01:09:05 +01:00
// use the following instead of DebianDeployPlugin to skip changelog
makeDeploymentSettings(Debian, (Debian / packageBin), "deb"),
// RPM SPECIFIC
2020-01-24 17:56:29 +01:00
rpmRelease := debianBuildId.value.toString,
Rpm / version := {
2017-04-27 02:08:26 +02:00
val stable0 = (sbtVersionToRelease split "[^\\d]" filterNot (_.isEmpty) mkString ".")
val stable = if (rpmRelease.value == "0") stable0
else stable0 + "." + rpmRelease.value
2016-05-09 06:25:16 +02:00
if (isExperimental) ((sbtVersionToRelease split "[^\\d]" filterNot (_.isEmpty)).toList match {
case List(_, _, c, d) => List(0, 99, c, d).mkString(".")
2016-05-09 06:25:16 +02:00
})
else stable
},
2020-09-21 02:39:48 +02:00
// remove sbtn from RPM because it complains about it being noarch
Rpm / linuxPackageMappings := {
val orig = ((Rpm / linuxPackageMappings)).value
val _ = sbtnJarsMappings.value
2020-09-21 02:39:48 +02:00
orig.map(o => o.copy(mappings = o.mappings.toList filterNot {
case (_, p) => p.contains("sbtn-x86_64") || p.contains("sbtn-aarch64")
2020-09-21 02:39:48 +02:00
}))
},
2023-06-20 13:42:07 +02:00
rpmVendor := "scalacenter",
2015-08-11 07:34:13 +02:00
rpmUrl := Some("http://github.com/sbt/sbt-launcher-package"),
2021-04-20 06:12:39 +02:00
rpmLicense := Some("Apache-2.0"),
// This is intentionally empty. java-devel could bring in JDK 9-ea on Fedora,
// and java-1.8.0-devel doesn't work on CentOS 6 and 7.
// https://github.com/sbt/sbt-launcher-package/issues/151
// https://github.com/elastic/logstash/issues/6275#issuecomment-261359933
rpmRequirements := Seq(),
rpmProvides := Seq("sbt"),
2016-05-09 06:25:16 +02:00
// WINDOWS SPECIFIC
2017-04-08 07:13:12 +02:00
windowsBuildId := 0,
Windows / version := {
2017-01-21 12:36:33 +01:00
val bid = windowsBuildId.value
2016-05-09 06:25:16 +02:00
val sv = sbtVersionToRelease
(sv split "[^\\d]" filterNot (_.isEmpty)) match {
2017-04-08 07:13:12 +02:00
case Array(major,minor,bugfix, _*) if bid == 0 => Seq(major, minor, bugfix) mkString "."
case Array(major,minor,bugfix, _*) => Seq(major, minor, bugfix, bid.toString) mkString "."
case Array(major,minor) => Seq(major, minor, "0", bid.toString) mkString "."
case Array(major) => Seq(major, "0", "0", bid.toString) mkString "."
}
},
Windows / maintainer := "Scala Center",
Windows / packageSummary := "sbt " + (Windows / version).value,
Windows / packageDescription := "The interactive build tool.",
wixProductId := "ce07be71-510d-414a-92d4-dff47631848a",
wixProductUpgradeId := Hash.toHex(Hash((Windows / version).value)).take(32),
2019-10-19 21:13:08 +02:00
javacOptions := Seq("-source", "1.8", "-target", "1.8"),
// Universal ZIP download install.
Universal / packageName := packageName.value, // needs to be set explicitly due to a bug in native-packager
Windows / name := packageName.value,
Windows / packageName := packageName.value,
Universal / version := sbtVersionToRelease,
2017-08-10 10:42:57 +02:00
Universal / mappings += {
2021-04-20 05:43:15 +02:00
(baseDirectory.value.getParentFile / "sbt") -> ("bin" + java.io.File.separator + "sbt")
},
Universal / mappings := {
val t = (Universal / target).value
val prev = (Universal / mappings).value
2019-09-24 00:08:29 +02:00
val BinSbt = "bin" + java.io.File.separator + "sbt"
val BinBat = BinSbt + ".bat"
2017-08-10 10:42:57 +02:00
prev.toList map {
2019-09-24 00:08:29 +02:00
case (k, BinSbt) =>
import java.nio.file.{Files, FileSystems}
2019-09-24 00:08:29 +02:00
val x = IO.read(k)
2021-11-14 14:59:34 +01:00
IO.write(t / "sbt", x.replace(
2019-09-24 00:08:29 +02:00
"declare init_sbt_version=_to_be_replaced",
s"declare init_sbt_version=$sbtVersionToRelease"))
if (FileSystems.getDefault.supportedFileAttributeViews.contains("posix")) {
val perms = Files.getPosixFilePermissions(k.toPath)
Files.setPosixFilePermissions(t / "sbt" toPath, perms)
}
2019-09-24 00:08:29 +02:00
(t / "sbt", BinSbt)
2017-08-10 11:26:03 +02:00
case (k, BinBat) =>
2017-08-10 10:42:57 +02:00
val x = IO.read(k)
IO.write(t / "sbt.bat", x.replaceAllLiterally(
"set init_sbt_version=_to_be_replaced",
s"set init_sbt_version=$sbtVersionToRelease"))
2017-08-10 11:26:03 +02:00
(t / "sbt.bat", BinBat)
2017-08-10 10:42:57 +02:00
case (k, v) => (k, v)
}
},
Universal / mappings ++= (Def.taskDyn {
2021-04-24 22:27:38 +02:00
if (sbtIncludeSbtLaunch)
Def.task {
Seq(
sbtLaunchJar.value -> "bin/sbt-launch.jar"
)
}
else Def.task { Seq[(File, String)]() }
}).value,
Universal / mappings ++= sbtnJarsMappings.value,
Universal / mappings ++= (Def.taskDyn {
if (sbtOfflineInstall && sbtVersionToRelease.startsWith("1."))
Def.task {
val _ = ((dist / exportRepoUsingCoursier)).value
directory(((dist / target)).value / "lib")
}
else if (sbtOfflineInstall)
2017-04-07 06:56:55 +02:00
Def.task {
val _ = ((dist / exportRepo)).value
directory(((dist / target)).value / "lib")
2017-04-07 06:56:55 +02:00
}
else Def.task { Seq[(File, String)]() }
}).value,
Universal / mappings ++= {
2019-04-05 15:11:01 +02:00
val base = baseDirectory.value
if (sbtVersionToRelease startsWith "0.13.") Nil
2021-04-20 06:12:39 +02:00
else Seq[(File, String)](base.getParentFile / "LICENSE" -> "LICENSE", base / "NOTICE" -> "NOTICE")
2019-04-05 15:11:01 +02:00
},
Spelling (#8028) * spelling: 1.x Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: a Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: aether Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: anymore Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: artifact Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: available Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: be Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: bridge Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: cannot Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: case-insensitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: checksum Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: class loads Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: contra Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dependencies Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dependency Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: dependent Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: deriveds Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: describes Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: early Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: enclosed Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: evaluation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: excluding Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: execution Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: for Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: frequently Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: github Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: green Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: https://www Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: https Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: in-sourcing Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: include Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: incompatible Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: indefinitely Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: information Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: inputted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: just Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: lastmodifiedtimes Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: latest Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: manifest Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: miscellaneous Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: more Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: neither Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: never Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: nonexistent Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: opted Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: outputting Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: params Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: performance Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: preceding Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: presentation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: project Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: projects Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: protocol Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: related Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: representation Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: res Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: resolverlist Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: resolverset Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: response Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: returned Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: sbt_version Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: scalacheck Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: sentinels Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: separates Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: serves Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: should Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: significant Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: specifically Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: substitute Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: suppress Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: terminal Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: the Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: title Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: transitive Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: version Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: versions Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: want Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: wanting Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * spelling: whether Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: sbt Cached Resolution Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * link: Testing sbt plugins Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com> --------- Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2025-02-04 07:11:28 +01:00
// Miscellaneous publishing stuff...
Debian / projectID := {
2017-04-27 02:08:26 +02:00
val m = moduleID.value
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
m.withRevision((Debian / version).value)
2017-04-27 02:08:26 +02:00
},
Windows / projectID := {
val m = moduleID.value
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
m.withRevision((Windows / version).value)
},
Rpm / projectID := {
2017-04-27 02:08:26 +02:00
val m = moduleID.value
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
m.withRevision((Rpm / version).value)
2017-04-27 02:08:26 +02:00
},
Universal / projectID := {
2017-04-27 02:08:26 +02:00
val m = moduleID.value
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
m.withRevision((Universal / version).value)
2017-04-27 02:08:26 +02:00
}
)
def downloadUrlForVersion(v: String) = (v.split("[^\\d]") flatMap (i => catching(classOf[Exception]) opt (i.toInt))) match {
2020-09-20 04:18:49 +02:00
case Array(0, 11, 3, _*) => "https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.11.3-2/sbt-launch.jar"
case Array(0, 11, x, _*) if x >= 3 => "https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/"+v+"/sbt-launch.jar"
case Array(0, y, _*) if y >= 12 => "https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/"+v+"/sbt-launch.jar"
case Array(1, _, _*) if v contains ("-20") => "https://repo.scala-sbt.org/scalasbt/maven-snapshots/org/scala-sbt/sbt-launch/"+v+"/sbt-launch.jar"
2021-03-08 01:24:05 +01:00
case _ => "https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/"+v+"/sbt-launch-"+v+".jar"
}
def makePublishToForConfig(config: Configuration) = {
// Add the publish to and ensure global resolvers has the resolver we just configured.
inConfig(config)(Seq(
2017-04-09 16:37:42 +02:00
name := "sbt",
2021-04-24 21:53:08 +02:00
bintrayDebianUrl := s"https://scala.jfrog.io/artifactory/debian/",
bintrayDebianExperimentalUrl := s"https://scala.jfrog.io/artifactory/debian-experimental/",
bintrayRpmUrl := s"https://scala.jfrog.io/artifactory/rpm/",
bintrayRpmExperimentalUrl := s"https://scala.jfrog.io/artifactory/rpm-experimental/",
bintrayGenericPackagesUrl := s"https://scala.jfrog.io/artifactory/native-packages/",
bintrayTripple := {
config.name match {
case Debian.name if isExperimental => ("debian-experimental", bintrayDebianExperimentalUrl.value, artifactoryDebianPattern)
case Debian.name => ("debian", bintrayDebianUrl.value, artifactoryDebianPattern)
2021-04-25 02:26:18 +02:00
case Rpm.name if isExperimental => ("rpm-experimental", bintrayRpmExperimentalUrl.value, artifactoryLinuxPattern)
case Rpm.name => ("rpm", bintrayRpmUrl.value, artifactoryLinuxPattern)
}
},
publishTo := {
val (id, url, pattern) = bintrayTripple.value
val resolver = Resolver.url(id, new URI(url).toURL)(Patterns(pattern))
Some(resolver)
2021-04-24 21:53:08 +02:00
}
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
))
}
2016-05-09 06:25:16 +02:00
def publishToSettings =
2021-04-24 21:53:08 +02:00
Seq[Configuration](Debian, Rpm) flatMap makePublishToForConfig
def downloadUrl(uri: URI, out: File): Unit =
{
if(!out.exists) {
IO.touch(out)
val url = new URI(uri.toString).toURL
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val connection = url.openConnection()
val input = connection.getInputStream
val writer = new java.io.BufferedOutputStream(new java.io.FileOutputStream(out))
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
try {
val buffer = new Array[Byte](8192)
var bytesRead = input.read(buffer)
while (bytesRead != -1) {
writer.write(buffer, 0, bytesRead)
bytesRead = input.read(buffer)
}
} finally {
input.close()
writer.close()
}
}
}
def colonName(m: ModuleID): String = s"${m.organization}:${m.name}:${m.revision}"
lazy val dist = (project in file("dist"))
.settings(
name := "dist",
2017-04-18 19:28:12 +02:00
scalaVersion := {
if (sbtVersionToRelease startsWith "0.13.") scala210
else scala212
},
libraryDependencies ++= Seq(sbtActual, jansi, scala212Compiler, scala212Jline, scala212Xml) ++ sbt013ExtraDeps,
exportRepo := {
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val outDir = exportRepoDirectory.value
sbtVersionToRelease match {
case v if v.startsWith("1.") =>
sys.error("sbt 1.x should use coursier")
case v if v.startsWith("0.13.") =>
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
val outbase = outDir / "org.scala-sbt" / "compiler-interface" / v
val uribase = s"https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/compiler-interface/$v/"
downloadUrl(uri(uribase + "ivys/ivy.xml"), outbase / "ivys" / "ivy.xml")
downloadUrl(uri(uribase + "jars/compiler-interface.jar"), outbase / "jars" / "compiler-interface.jar")
downloadUrl(uri(uribase + "srcs/compiler-interface-sources.jar"), outbase / "srcs" / "compiler-interface-sources.jar")
case _ =>
}
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
outDir
},
exportRepoDirectory := target.value / "lib" / "local-preloaded",
exportRepoCsrDirectory := exportRepoDirectory.value,
exportRepoUsingCoursier := {
val outDirectory = exportRepoCsrDirectory.value
val csr =
if (isWindows) (LocalRootProject / baseDirectory).value / "bin" / "coursier.bat"
else (LocalRootProject / baseDirectory).value / "bin" / "coursier"
val cache = target.value / "coursier"
IO.delete(cache)
val v = sbtVersionToRelease
s"$csr fetch --cache $cache org.scala-sbt:sbt:$v".!
s"$csr fetch --cache $cache ${colonName(jansi)}".!
s"$csr fetch --cache $cache ${colonName(scala212Compiler)}".!
s"$csr fetch --cache $cache ${colonName(scala212Xml)}".!
val mavenCache = cache / "https" / "repo1.maven.org" / "maven2"
val compilerBridgeVer = IO.listFiles(mavenCache / "org" / "scala-sbt" / "compiler-bridge_2.12", DirectoryFilter).toList.headOption
compilerBridgeVer match {
case Some(bridgeDir) =>
val bridgeVer = bridgeDir.getName
s"$csr fetch --cache $cache --sources org.scala-sbt:compiler-bridge_2.10:$bridgeVer".!
s"$csr fetch --cache $cache --sources org.scala-sbt:compiler-bridge_2.11:$bridgeVer".!
s"$csr fetch --cache $cache --sources org.scala-sbt:compiler-bridge_2.12:$bridgeVer".!
s"$csr fetch --cache $cache --sources org.scala-sbt:compiler-bridge_2.13:$bridgeVer".!
case _ =>
sys.error("bridge not found")
}
IO.copyDirectory(mavenCache, outDirectory, true, true)
outDirectory
},
conflictWarning := ConflictWarning.disable,
[2.x] fix: Upgrade launcher-package to sbt 1.10.7 and replace dispatch-http (#8465) Fixes #7826 Changes: - Upgrade sbt version from 0.13.18 to 1.10.7 in launcher-package/project/build.properties - Remove dead dispatch-http 0.8.10 dependency from plugins.sbt - Update sbt-native-packager from 1.7.6 to 1.10.4 (com.github.sbt) - Update sbt-pgp from 2.1.2 to 2.3.1 - Replace all dispatch.classic._ HTTP calls with Java URL.openStream() The dispatch-http library is dead and doesn't support sbt 1.x. This change uses standard Java networking APIs for HTTP downloads, eliminating the dependency on outdated libraries. All HTTP download operations now use: - java.net.URL.openConnection() - InputStream with buffered reading - Proper resource cleanup with try-finally blocks - Removes the sbt-export-repo plugin dependency - Defines exportRepo and exportRepoDirectory settings locally - Removes ExportRepoPlugin from dist project - Fixes exportRepo task to not reference itself * fix: Update PackageSignerPlugin.scala for sbt 1.x compatibility - Use withExtension instead of copy(extension = ...) for Artifact - Update Classpaths.publishConfig to use sbt 1.x signature with all required parameters - Use new slash syntax for scoped keys (pgpSigner / skip instead of skip in pgpSigner) * fix: Use computed status instead of status key in PackageSignerPlugin * fix: Use withRevision instead of copy for ModuleID in build.sbt - Add scala.sys.process._ import for shell command execution (! method) - Fix resolvers setting to use new slash syntax and proper Option handling - Fix publish/publishLocal to use {} instead of () to avoid deprecation warning - Fix Classpaths.publishTask to use variant without delivery key (deprecated since 1.1.1) - Add scala.sys.process._ import for shell command execution - Fix publish/publishLocal to use {} instead of () - Remove problematic resolvers setting that caused task/setting dependency issues - Use IvyActions.publish directly instead of deprecated Classpaths.publishTask - Fix ModuleID.copy to use withRevision - Fix Artifact.copy to use withExtension - Use computed status value instead of status key Build now compiles successfully with sbt 1.10.7.
2026-01-11 13:17:24 +01:00
publish := {},
publishLocal := {},
2017-03-11 20:29:58 +01:00
resolvers += Resolver.typesafeIvyRepo("releases")
)