mirror of https://github.com/sbt/sbt.git
Merge pull request #6463 from eed3si9n/wip/linux
Remove Bintray from Linux releases
This commit is contained in:
commit
d94eb97def
|
|
@ -12,3 +12,4 @@ npm-debug.log
|
||||||
.metals
|
.metals
|
||||||
.bsp/
|
.bsp/
|
||||||
metals.sbt
|
metals.sbt
|
||||||
|
launcher-package/citest/freshly-baked
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,10 @@
|
||||||
import scala.util.control.Exception.catching
|
import scala.util.control.Exception.catching
|
||||||
import _root_.bintray.InternalBintrayKeys._
|
|
||||||
import _root_.bintray.{BintrayRepo, Bintray}
|
|
||||||
import NativePackagerHelper._
|
import NativePackagerHelper._
|
||||||
import com.typesafe.sbt.packager.SettingsHelper._
|
import com.typesafe.sbt.packager.SettingsHelper._
|
||||||
import DebianConstants._
|
import DebianConstants._
|
||||||
|
|
||||||
lazy val sbtOfflineInstall =
|
lazy val sbtOfflineInstall =
|
||||||
sys.props.getOrElse("sbt.build.offline", sys.env.getOrElse("sbt.build.offline", "true")) match {
|
sys.props.getOrElse("sbt.build.offline", sys.env.getOrElse("sbt.build.offline", "false")) match {
|
||||||
case "true" | "1" => true
|
case "true" | "1" => true
|
||||||
case "false" | "0" => false
|
case "false" | "0" => false
|
||||||
case _ => false
|
case _ => false
|
||||||
|
|
@ -17,6 +15,12 @@ lazy val sbtIncludeSbtn =
|
||||||
case "false" | "0" => false
|
case "false" | "0" => false
|
||||||
case _ => false
|
case _ => false
|
||||||
}
|
}
|
||||||
|
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", {
|
lazy val sbtVersionToRelease = sys.props.getOrElse("sbt.build.version", sys.env.getOrElse("sbt.build.version", {
|
||||||
sys.error("-Dsbt.build.version must be set")
|
sys.error("-Dsbt.build.version must be set")
|
||||||
}))
|
}))
|
||||||
|
|
@ -72,15 +76,16 @@ val x86MacImageName = s"sbtn-$x86MacPlatform"
|
||||||
val x86LinuxImageName = s"sbtn-$x86LinuxPlatform"
|
val x86LinuxImageName = s"sbtn-$x86LinuxPlatform"
|
||||||
val x86WindowsImageName = s"sbtn-$x86WindowsPlatform.exe"
|
val x86WindowsImageName = s"sbtn-$x86WindowsPlatform.exe"
|
||||||
|
|
||||||
|
organization in ThisBuild := "org.scala-sbt"
|
||||||
|
version in ThisBuild := "0.1.0"
|
||||||
|
|
||||||
// This build creates a SBT plugin with handy features *and* bundles the SBT script for distribution.
|
// This build creates a SBT plugin with handy features *and* bundles the SBT script for distribution.
|
||||||
val root = (project in file(".")).
|
val root = (project in file(".")).
|
||||||
enablePlugins(UniversalPlugin, LinuxPlugin, DebianPlugin, RpmPlugin, WindowsPlugin,
|
enablePlugins(UniversalPlugin, LinuxPlugin, DebianPlugin, RpmPlugin, WindowsPlugin,
|
||||||
UniversalDeployPlugin, DebianDeployPlugin, RpmDeployPlugin, WindowsDeployPlugin).
|
UniversalDeployPlugin, DebianDeployPlugin, RpmDeployPlugin, WindowsDeployPlugin).
|
||||||
settings(
|
settings(
|
||||||
organization := "org.scala-sbt",
|
|
||||||
name := "sbt-launcher-packaging",
|
name := "sbt-launcher-packaging",
|
||||||
packageName := "sbt",
|
packageName := "sbt",
|
||||||
version := "0.1.0",
|
|
||||||
crossTarget := target.value,
|
crossTarget := target.value,
|
||||||
clean := {
|
clean := {
|
||||||
val _ = (clean in dist).value
|
val _ = (clean in dist).value
|
||||||
|
|
@ -92,7 +97,6 @@ val root = (project in file(".")).
|
||||||
case _ => Nil
|
case _ => Nil
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
useGpg := true,
|
|
||||||
usePgpKeyHex("642AC823"),
|
usePgpKeyHex("642AC823"),
|
||||||
pgpSecretRing := file(s"""${sys.props("user.home")}""") / ".ssh" / "scalasbt.key",
|
pgpSecretRing := file(s"""${sys.props("user.home")}""") / ".ssh" / "scalasbt.key",
|
||||||
pgpPublicRing := file(s"""${sys.props("user.home")}""") / ".ssh" / "scalasbt.pub",
|
pgpPublicRing := file(s"""${sys.props("user.home")}""") / ".ssh" / "scalasbt.pub",
|
||||||
|
|
@ -281,13 +285,16 @@ val root = (project in file(".")).
|
||||||
case (k, v) => (k, v)
|
case (k, v) => (k, v)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mappings in Universal ++= (Def.taskDyn {
|
||||||
mappings in Universal ++= {
|
if (sbtIncludeSbtLaunch)
|
||||||
val launchJar = sbtLaunchJar.value
|
Def.task {
|
||||||
Seq(
|
Seq(
|
||||||
launchJar -> "bin/sbt-launch.jar"
|
sbtLaunchJar.value -> "bin/sbt-launch.jar"
|
||||||
) ++ sbtnJarsMappings.value
|
)
|
||||||
},
|
}
|
||||||
|
else Def.task { Seq[(File, String)]() }
|
||||||
|
}).value,
|
||||||
|
mappings in Universal ++= sbtnJarsMappings.value,
|
||||||
mappings in Universal ++= (Def.taskDyn {
|
mappings in Universal ++= (Def.taskDyn {
|
||||||
if (sbtOfflineInstall && sbtVersionToRelease.startsWith("1."))
|
if (sbtOfflineInstall && sbtVersionToRelease.startsWith("1."))
|
||||||
Def.task {
|
Def.task {
|
||||||
|
|
@ -352,54 +359,31 @@ def makePublishToForConfig(config: Configuration) = {
|
||||||
// Add the publish to and ensure global resolvers has the resolver we just configured.
|
// Add the publish to and ensure global resolvers has the resolver we just configured.
|
||||||
inConfig(config)(Seq(
|
inConfig(config)(Seq(
|
||||||
name := "sbt",
|
name := "sbt",
|
||||||
bintrayOrganization := {
|
bintrayDebianUrl := s"https://scala.jfrog.io/artifactory/debian/",
|
||||||
// offline installation exceeds 50MB file limit for OSS organization
|
bintrayDebianExperimentalUrl := s"https://scala.jfrog.io/artifactory/debian-experimental/",
|
||||||
if (sbtOfflineInstall) Some("sbt")
|
bintrayRpmUrl := s"https://scala.jfrog.io/artifactory/rpm/",
|
||||||
else Some("sbt")
|
bintrayRpmExperimentalUrl := s"https://scala.jfrog.io/artifactory/rpm-experimental/",
|
||||||
},
|
bintrayGenericPackagesUrl := s"https://scala.jfrog.io/artifactory/native-packages/",
|
||||||
bintrayRepository := bintrayTripple.value._1,
|
|
||||||
bintrayRepo := Bintray.cachedRepo(bintrayEnsureCredentials.value,
|
|
||||||
bintrayOrganization.value,
|
|
||||||
bintrayRepository.value),
|
|
||||||
bintrayPackage := "sbt",
|
|
||||||
|
|
||||||
bintrayDebianUrl := s"https://api.bintray.com/content/${bintrayOrganization.value.get}/debian/",
|
|
||||||
bintrayDebianExperimentalUrl := s"https://api.bintray.com/content/${bintrayOrganization.value.get}/debian-experimental/",
|
|
||||||
bintrayRpmUrl := s"https://api.bintray.com/content/${bintrayOrganization.value.get}/rpm/",
|
|
||||||
bintrayRpmExperimentalUrl := s"https://api.bintray.com/content/${bintrayOrganization.value.get}/rpm-experimental/",
|
|
||||||
bintrayGenericPackagesUrl := s"https://api.bintray.com/content/${bintrayOrganization.value.get}/native-packages/",
|
|
||||||
bintrayTripple := {
|
bintrayTripple := {
|
||||||
config.name match {
|
config.name match {
|
||||||
case Debian.name if isExperimental => ("debian-experimental", bintrayDebianExperimentalUrl.value, bintrayLinuxPattern)
|
case Debian.name if isExperimental => ("debian-experimental", bintrayDebianExperimentalUrl.value, bintrayLinuxPattern)
|
||||||
case Debian.name => ("debian", bintrayDebianUrl.value, bintrayLinuxPattern)
|
case Debian.name => ("debian", bintrayDebianUrl.value, bintrayLinuxPattern)
|
||||||
case Rpm.name if isExperimental => ("rpm-experimental", bintrayRpmExperimentalUrl.value, bintrayLinuxPattern)
|
case Rpm.name if isExperimental => ("rpm-experimental", bintrayRpmExperimentalUrl.value, bintrayLinuxPattern)
|
||||||
case Rpm.name => ("rpm", bintrayRpmUrl.value, bintrayLinuxPattern)
|
case Rpm.name => ("rpm", bintrayRpmUrl.value, bintrayLinuxPattern)
|
||||||
case _ => ("native-packages", bintrayGenericPackagesUrl.value, bintrayGenericPattern)
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
publishTo := {
|
publishTo := {
|
||||||
val (id, url, pattern) = bintrayTripple.value
|
val (id, url, pattern) = bintrayTripple.value
|
||||||
val resolver = Resolver.url(id, new URL(url))(Patterns(pattern))
|
val resolver = Resolver.url(id, new URL(url))(Patterns(pattern))
|
||||||
Some(resolver)
|
Some(resolver)
|
||||||
},
|
}
|
||||||
bintrayReleaseAllStaged := bintrayRelease(bintrayRepo.value, bintrayPackage.value, version.value, sLog.value)
|
|
||||||
// Uncomment to release right after publishing
|
|
||||||
// publish <<= (publish, bintrayRepo, bintrayPackage, version, sLog) apply { (publish, bintrayRepo, bintrayPackage, version, sLog) =>
|
|
||||||
// for {
|
|
||||||
// pub <- publish
|
|
||||||
// repo <- bintrayRepo
|
|
||||||
// } yield bintrayRelease(repo, bintrayPackage, version, sLog)
|
|
||||||
// }
|
|
||||||
)) ++ Seq(
|
)) ++ Seq(
|
||||||
resolvers ++= ((publishTo in config) apply (_.toSeq)).value
|
resolvers ++= ((publishTo in config) apply (_.toSeq)).value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
def publishToSettings =
|
def publishToSettings =
|
||||||
Seq[Configuration](Debian, Universal, Windows, Rpm) flatMap makePublishToForConfig
|
Seq[Configuration](Debian, Rpm) flatMap makePublishToForConfig
|
||||||
|
|
||||||
def bintrayRelease(repo: BintrayRepo, pkg: String, version: String, log: Logger): Unit =
|
|
||||||
repo.release(pkg, version, log)
|
|
||||||
|
|
||||||
def downloadUrl(uri: URI, out: File): Unit =
|
def downloadUrl(uri: URI, out: File): Unit =
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -x
|
||||||
|
|
||||||
# exit when something fails
|
# exit when something fails
|
||||||
set -e
|
set -e
|
||||||
|
|
@ -10,8 +10,9 @@ unset SBT_OPTS
|
||||||
java -version
|
java -version
|
||||||
## end of Java switching
|
## end of Java switching
|
||||||
|
|
||||||
|
rm -rf freshly-baked
|
||||||
mkdir -p freshly-baked
|
mkdir -p freshly-baked
|
||||||
unzip -qo ../target/universal/sbt.zip -d ./freshly-baked
|
unzip ../target/universal/sbt.zip -d ./freshly-baked
|
||||||
|
|
||||||
./freshly-baked/sbt/bin/sbt -Dsbt.no.format=true about
|
./freshly-baked/sbt/bin/sbt -Dsbt.no.format=true about
|
||||||
./freshly-baked/sbt/bin/sbt -Dsbt.no.format=true about 1> output.txt 2> err.txt
|
./freshly-baked/sbt/bin/sbt -Dsbt.no.format=true about 1> output.txt 2> err.txt
|
||||||
|
|
@ -26,14 +27,14 @@ fail() {
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
env HOME=./target/home1 ./freshly-baked/sbt/bin/sbt about
|
# env HOME=./target/home1 ./freshly-baked/sbt/bin/sbt about
|
||||||
test -d ./target/home1/.sbt/preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home1/.sbt"
|
# test -d ./target/home1/.sbt/preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home1/.sbt"
|
||||||
|
|
||||||
env HOME=./target/home2 ./freshly-baked/sbt/bin/sbt -sbt-dir ./target/home2/alternate-sbt about
|
# env HOME=./target/home2 ./freshly-baked/sbt/bin/sbt -sbt-dir ./target/home2/alternate-sbt about
|
||||||
test -d ./target/home2/alternate-sbt/preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home2/alternate-sbt"
|
# test -d ./target/home2/alternate-sbt/preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home2/alternate-sbt"
|
||||||
|
|
||||||
env HOME=./target/home3 ./freshly-baked/sbt/bin/sbt -J-Dsbt.preloaded=./target/home3/alternate-preloaded about
|
# env HOME=./target/home3 ./freshly-baked/sbt/bin/sbt -J-Dsbt.preloaded=./target/home3/alternate-preloaded about
|
||||||
test -d ./target/home3/alternate-preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home3/alternate-preloaded"
|
# test -d ./target/home3/alternate-preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home3/alternate-preloaded"
|
||||||
|
|
||||||
env HOME=./target/home4 ./freshly-baked/sbt/bin/sbt -J-Dsbt.global.base=./target/home4/global-base about
|
# env HOME=./target/home4 ./freshly-baked/sbt/bin/sbt -J-Dsbt.global.base=./target/home4/global-base about
|
||||||
test -d ./target/home4/global-base/preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home4/global-base"
|
# test -d ./target/home4/global-base/preloaded/org/scala-sbt || fail "expected to find preloaded in ./target/home4/global-base"
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,16 @@
|
||||||
import sbt._
|
import sbt._
|
||||||
import Keys._
|
import Keys._
|
||||||
import com.typesafe.sbt.SbtPgp
|
import com.jsuereth.sbtpgp.SbtPgp
|
||||||
import com.typesafe.sbt.packager.universal.{ UniversalPlugin, UniversalDeployPlugin }
|
import com.typesafe.sbt.packager.universal.{ UniversalPlugin, UniversalDeployPlugin }
|
||||||
import com.typesafe.sbt.packager.debian.{ DebianPlugin, DebianDeployPlugin }
|
import com.typesafe.sbt.packager.debian.{ DebianPlugin, DebianDeployPlugin }
|
||||||
import com.typesafe.sbt.packager.rpm.{ RpmPlugin, RpmDeployPlugin }
|
import com.typesafe.sbt.packager.rpm.{ RpmPlugin, RpmDeployPlugin }
|
||||||
import com.typesafe.sbt.pgp.gpgExtension
|
import com.jsuereth.sbtpgp.gpgExtension
|
||||||
|
|
||||||
object PackageSignerPlugin extends sbt.AutoPlugin {
|
object PackageSignerPlugin extends sbt.AutoPlugin {
|
||||||
override def trigger = allRequirements
|
override def trigger = allRequirements
|
||||||
override def requires = SbtPgp && UniversalDeployPlugin && DebianDeployPlugin && RpmDeployPlugin
|
override def requires = SbtPgp && UniversalDeployPlugin && DebianDeployPlugin && RpmDeployPlugin
|
||||||
|
|
||||||
import com.typesafe.sbt.pgp.PgpKeys._
|
import com.jsuereth.sbtpgp.PgpKeys._
|
||||||
import UniversalPlugin.autoImport._
|
import UniversalPlugin.autoImport._
|
||||||
import DebianPlugin.autoImport._
|
import DebianPlugin.autoImport._
|
||||||
import RpmPlugin.autoImport._
|
import RpmPlugin.autoImport._
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
sbt.version=0.13.17
|
sbt.version=0.13.18
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.0-M9")
|
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.6")
|
||||||
libraryDependencies += "net.databinder" %% "dispatch-http" % "0.8.10"
|
libraryDependencies += "net.databinder" %% "dispatch-http" % "0.8.10"
|
||||||
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
|
|
||||||
addSbtPlugin("com.eed3si9n" % "sbt-export-repo" % "0.1.1")
|
addSbtPlugin("com.eed3si9n" % "sbt-export-repo" % "0.1.1")
|
||||||
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1")
|
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue