mirror of https://github.com/sbt/sbt.git
Bump plugins
This commit is contained in:
parent
5645f8fe6d
commit
ce2a01af40
17
build.sbt
17
build.sbt
|
|
@ -143,11 +143,10 @@ lazy val extra = project
|
|||
|
||||
lazy val cli = project
|
||||
.dependsOn(coreJvm, cache, extra)
|
||||
.enablePlugins(PackPlugin, SbtProguard)
|
||||
.settings(
|
||||
shared,
|
||||
dontPublishIn("2.10", "2.12"),
|
||||
generatePack,
|
||||
proguard,
|
||||
coursierPrefix,
|
||||
libs ++= {
|
||||
if (scalaBinaryVersion.value == "2.11")
|
||||
|
|
@ -250,10 +249,10 @@ lazy val `sbt-shading` = project
|
|||
)
|
||||
|
||||
lazy val `sbt-launcher` = project
|
||||
.enablePlugins(PackPlugin)
|
||||
.dependsOn(cache)
|
||||
.settings(
|
||||
shared,
|
||||
generatePack,
|
||||
dontPublishIn("2.10", "2.12"),
|
||||
libs ++= {
|
||||
if (scalaBinaryVersion.value == "2.11")
|
||||
|
|
@ -268,9 +267,9 @@ lazy val `sbt-launcher` = project
|
|||
)
|
||||
|
||||
lazy val `http-server` = project
|
||||
.enablePlugins(PackPlugin)
|
||||
.settings(
|
||||
shared,
|
||||
generatePack,
|
||||
dontPublishIn("2.10", "2.11"),
|
||||
libs ++= {
|
||||
if (scalaBinaryVersion.value == "2.12")
|
||||
|
|
@ -406,7 +405,7 @@ lazy val addBootstrapInProguardedJar = {
|
|||
import java.nio.charset.StandardCharsets
|
||||
import java.nio.file.Files
|
||||
|
||||
ProguardKeys.proguard.in(Proguard) := {
|
||||
proguard.in(Proguard) := {
|
||||
val bootstrapJar = packageBin.in(bootstrap).in(Compile).value
|
||||
val source = proguardedJar.value
|
||||
|
||||
|
|
@ -439,15 +438,15 @@ lazy val addBootstrapInProguardedJar = {
|
|||
}
|
||||
|
||||
lazy val proguardedCli = Seq(
|
||||
ProguardKeys.proguardVersion.in(Proguard) := SharedVersions.proguard,
|
||||
ProguardKeys.options.in(Proguard) ++= Seq(
|
||||
proguardVersion.in(Proguard) := SharedVersions.proguard,
|
||||
proguardOptions.in(Proguard) ++= Seq(
|
||||
"-dontwarn",
|
||||
"-keep class coursier.cli.Coursier {\n public static void main(java.lang.String[]);\n}",
|
||||
"-keep class coursier.cli.IsolatedClassLoader {\n public java.lang.String[] getIsolationTargets();\n}",
|
||||
"-adaptresourcefilenames **.properties"
|
||||
),
|
||||
javaOptions.in(Proguard, ProguardKeys.proguard) := Seq("-Xmx3172M"),
|
||||
artifactPath.in(Proguard) := ProguardKeys.proguardDirectory.in(Proguard).value / "coursier-standalone.jar",
|
||||
javaOptions.in(Proguard, proguard) := Seq("-Xmx3172M"),
|
||||
artifactPath.in(Proguard) := proguardDirectory.in(Proguard).value / "coursier-standalone.jar",
|
||||
artifacts ++= {
|
||||
if (scalaBinaryVersion.value == "2.11")
|
||||
Seq(proguardedArtifact.value)
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ import sbt.Defaults.itSettings
|
|||
import sbt.Keys._
|
||||
import sbt.ScriptedPlugin.{scriptedConf, scriptedLaunchConf, scriptedSbt, scriptedSettings}
|
||||
|
||||
import com.typesafe.sbt.SbtProguard.proguardSettings
|
||||
|
||||
object Aliases {
|
||||
|
||||
def libs = libraryDependencies
|
||||
|
|
@ -31,8 +29,6 @@ object Aliases {
|
|||
|
||||
def hasITs = itSettings
|
||||
|
||||
def proguard = proguardSettings
|
||||
|
||||
def ShadingPlugin = coursier.ShadingPlugin
|
||||
|
||||
def root = file(".")
|
||||
|
|
|
|||
|
|
@ -3,16 +3,25 @@ import java.nio.file.Files
|
|||
import java.util.regex.Pattern
|
||||
|
||||
import com.typesafe.sbt.pgp.PgpKeys
|
||||
import sbt._
|
||||
import sbt.{ProcessLogger => _, _}
|
||||
import sbt.Keys._
|
||||
import sbt.Package.ManifestAttributes
|
||||
import sbtrelease.ReleasePlugin.autoImport._
|
||||
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
|
||||
|
||||
import scala.io._
|
||||
import scala.sys.process.ProcessLogger
|
||||
|
||||
object Release {
|
||||
|
||||
// adapted from https://github.com/sbt/sbt-release/blob/eccd4cb7b9818b2a731380fe31c399dc9cb7375b/src/main/scala/ReleaseExtra.scala#L239-L243
|
||||
private def toProcessLogger(st: State): ProcessLogger =
|
||||
new ProcessLogger {
|
||||
def err(s: => String) = st.log.info(s)
|
||||
def out(s: => String) = st.log.info(s)
|
||||
def buffer[T](f: => T) = st.log.buffer(f)
|
||||
}
|
||||
|
||||
implicit final class StateOps(val state: State) extends AnyVal {
|
||||
def vcs: sbtrelease.Vcs =
|
||||
Project.extract(state).get(releaseVcs).getOrElse {
|
||||
|
|
@ -112,9 +121,11 @@ object Release {
|
|||
|
||||
val vcs = state.vcs
|
||||
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
for (f <- scriptFiles) {
|
||||
updateVersionInScript(f, releaseVer)
|
||||
vcs.add(f.getAbsolutePath).!!(state.log)
|
||||
vcs.add(f.getAbsolutePath).!!(log)
|
||||
}
|
||||
|
||||
state
|
||||
|
|
@ -130,10 +141,11 @@ object Release {
|
|||
)
|
||||
|
||||
val vcs = state.vcs
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
for ((f, output) <- scriptFiles) {
|
||||
sbt.Process(Seq(f.getAbsolutePath, "-f")).!!(state.log)
|
||||
vcs.add(output.getAbsolutePath).!!(state.log)
|
||||
vcs.add(output.getAbsolutePath).!!(log)
|
||||
}
|
||||
|
||||
state
|
||||
|
|
@ -163,6 +175,8 @@ object Release {
|
|||
|
||||
val updateTutReadme = ReleaseStep { state =>
|
||||
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
val previousVer = state.get(previousReleaseVersion).getOrElse {
|
||||
sys.error(s"${previousReleaseVersion.label} key not set")
|
||||
}
|
||||
|
|
@ -177,17 +191,19 @@ object Release {
|
|||
val newContent = pattern.replaceAllIn(content, releaseVer)
|
||||
Files.write(readmeFile.toPath, newContent.getBytes(StandardCharsets.UTF_8))
|
||||
|
||||
state.vcs.add(readmeFile.getAbsolutePath).!!(state.log)
|
||||
state.vcs.add(readmeFile.getAbsolutePath).!!(log)
|
||||
|
||||
state
|
||||
}
|
||||
|
||||
val stageReadme = ReleaseStep { state =>
|
||||
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
val baseDir = Project.extract(state).get(baseDirectory.in(ThisBuild))
|
||||
val processedReadmeFile = baseDir / "README.md"
|
||||
|
||||
state.vcs.add(processedReadmeFile.getAbsolutePath).!!(state.log)
|
||||
state.vcs.add(processedReadmeFile.getAbsolutePath).!!(log)
|
||||
|
||||
state
|
||||
}
|
||||
|
|
@ -198,6 +214,7 @@ object Release {
|
|||
val updatePluginsSbt = ReleaseStep { state =>
|
||||
|
||||
val vcs = state.vcs
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
val (releaseVer, _) = state.get(ReleaseKeys.versions).getOrElse {
|
||||
sys.error(s"${ReleaseKeys.versions.label} key not set")
|
||||
|
|
@ -221,7 +238,7 @@ object Release {
|
|||
|
||||
val newContent = coursierVersionPattern.replaceAllIn(content, "def coursierVersion0 = \"" + releaseVer + "\"")
|
||||
Files.write(f.toPath, newContent.getBytes(StandardCharsets.UTF_8))
|
||||
vcs.add(f.getAbsolutePath).!!(state.log)
|
||||
vcs.add(f.getAbsolutePath).!!(log)
|
||||
}
|
||||
|
||||
state
|
||||
|
|
@ -232,6 +249,7 @@ object Release {
|
|||
val updateMimaVersions = ReleaseStep { state =>
|
||||
|
||||
val vcs = state.vcs
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
val (releaseVer, _) = state.get(ReleaseKeys.versions).getOrElse {
|
||||
sys.error(s"${ReleaseKeys.versions.label} key not set")
|
||||
|
|
@ -258,7 +276,7 @@ object Release {
|
|||
)
|
||||
|
||||
Files.write(mimaScalaFile.toPath, newContent.getBytes(StandardCharsets.UTF_8))
|
||||
vcs.add(mimaScalaFile.getAbsolutePath).!!(state.log)
|
||||
vcs.add(mimaScalaFile.getAbsolutePath).!!(log)
|
||||
|
||||
state
|
||||
}
|
||||
|
|
@ -266,11 +284,13 @@ object Release {
|
|||
val commitUpdates = ReleaseStep(
|
||||
action = { state =>
|
||||
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
val (releaseVer, _) = state.get(ReleaseKeys.versions).getOrElse {
|
||||
sys.error(s"${ReleaseKeys.versions.label} key not set")
|
||||
}
|
||||
|
||||
state.vcs.commit(s"Updates for $releaseVer", sign = true).!(state.log)
|
||||
state.vcs.commit(s"Updates for $releaseVer", sign = true).!(log)
|
||||
|
||||
state
|
||||
},
|
||||
|
|
@ -311,6 +331,8 @@ object Release {
|
|||
// tagRelease from sbt-release seem to use the next version (snapshot one typically) rather than the released one :/
|
||||
val reallyTagRelease = ReleaseStep { state =>
|
||||
|
||||
val log = toProcessLogger(state)
|
||||
|
||||
val (releaseVer, _) = state.get(ReleaseKeys.versions).getOrElse {
|
||||
sys.error(s"${ReleaseKeys.versions.label} key not set")
|
||||
}
|
||||
|
|
@ -319,7 +341,7 @@ object Release {
|
|||
|
||||
val tag = "v" + releaseVer
|
||||
|
||||
state.vcs.tag(tag, s"Releasing $tag", sign).!(state.log)
|
||||
state.vcs.tag(tag, s"Releasing $tag", sign).!(log)
|
||||
|
||||
state
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@ import sbt._
|
|||
import sbt.Keys._
|
||||
import sbt.ScriptedPlugin._
|
||||
|
||||
import com.lightbend.sbt.SbtProguard.autoImport._
|
||||
import com.typesafe.sbt.pgp._
|
||||
import com.typesafe.sbt.SbtProguard._
|
||||
import coursier.ShadingPlugin.autoImport._
|
||||
|
||||
import xerial.sbt.Pack.{packAutoSettings, packExcludeArtifactTypes}
|
||||
|
||||
import Aliases._
|
||||
|
||||
object Settings {
|
||||
|
|
@ -225,10 +223,6 @@ object Settings {
|
|||
PgpKeys.publishLocalSigned := PgpKeys.publishLocalSigned.in(Shading).value
|
||||
)
|
||||
|
||||
lazy val generatePack = packAutoSettings :+ {
|
||||
packExcludeArtifactTypes += "pom"
|
||||
}
|
||||
|
||||
lazy val proguardedArtifact = Def.setting {
|
||||
Artifact(
|
||||
moduleName.value,
|
||||
|
|
@ -240,7 +234,7 @@ object Settings {
|
|||
|
||||
lazy val proguardedJar = Def.task {
|
||||
|
||||
val results = ProguardKeys.proguard.in(Proguard).value
|
||||
val results = proguard.in(Proguard).value
|
||||
|
||||
results match {
|
||||
case Seq(f) => f
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
|
||||
plugins_(
|
||||
"io.get-coursier" % "sbt-coursier" % coursierVersion,
|
||||
"com.typesafe" % "sbt-mima-plugin" % "0.1.15",
|
||||
"org.xerial.sbt" % "sbt-pack" % "0.8.2",
|
||||
"com.jsuereth" % "sbt-pgp" % "1.0.1",
|
||||
"com.typesafe.sbt" % "sbt-proguard" % "0.2.3",
|
||||
"com.github.gseitz" % "sbt-release" % "1.0.5",
|
||||
"org.scala-js" % "sbt-scalajs" % "0.6.19",
|
||||
"com.typesafe" % "sbt-mima-plugin" % "0.1.18",
|
||||
"org.xerial.sbt" % "sbt-pack" % "0.9.1",
|
||||
"com.jsuereth" % "sbt-pgp" % "1.1.0",
|
||||
"com.lightbend.sbt" % "sbt-proguard" % "0.3.0",
|
||||
"com.github.gseitz" % "sbt-release" % "1.0.6",
|
||||
"org.scala-js" % "sbt-scalajs" % "0.6.20",
|
||||
"io.get-coursier" % "sbt-shading" % coursierVersion,
|
||||
"org.xerial.sbt" % "sbt-sonatype" % "1.1",
|
||||
"com.timushev.sbt" % "sbt-updates" % "0.3.0",
|
||||
"org.tpolecat" % "tut-plugin" % "0.5.2"
|
||||
"org.xerial.sbt" % "sbt-sonatype" % "2.0",
|
||||
"com.timushev.sbt" % "sbt-updates" % "0.3.3",
|
||||
"org.tpolecat" % "tut-plugin" % "0.5.5"
|
||||
)
|
||||
|
||||
libs ++= Seq(
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
addSbtCoursier
|
||||
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.0")
|
||||
addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.3.3")
|
||||
|
||||
// required for just released things
|
||||
resolvers += Resolver.sonatypeRepo("releases")
|
||||
|
|
|
|||
|
|
@ -129,6 +129,17 @@ checkBinaryCompatibility() {
|
|||
|
||||
testLauncherJava6() {
|
||||
sbt ++${SCALA_VERSION} cli/pack
|
||||
|
||||
# Via docker, getting errors like
|
||||
# standard_init_linux.go:178: exec user process caused "exec format error"
|
||||
# because of the initial empty line in the sbt-pack launchers.
|
||||
# Required until something like https://github.com/xerial/sbt-pack/pull/120
|
||||
# gets merged.
|
||||
local DIR="cli/target/pack/bin"
|
||||
mv "$DIR/coursier" "$DIR/coursier.orig"
|
||||
sed '1{/^$/d}' < "$DIR/coursier.orig" > "$DIR/coursier"
|
||||
chmod +x "$DIR/coursier"
|
||||
|
||||
docker run -it --rm \
|
||||
-v $(pwd)/cli/target/pack:/opt/coursier \
|
||||
-e CI=true \
|
||||
|
|
|
|||
Loading…
Reference in New Issue