From 2759a122cf2ea40f6d6b1e6627f5d65125b84c84 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 7 Mar 2021 17:41:52 -0500 Subject: [PATCH] Drop Bintray from release Fixes https://github.com/sbt/sbt/issues/6370 compatibility note Today we release the sbt-launcher JAR **twice** under https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.4.7/: - https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.4.7/sbt-launch-1.4.7.jar - https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.4.7/sbt-launch.jar I think this goes back to the early days when we used to tell people to download the `sbt-launch.jar` and write your own launcher script, which I remember doing. Some remnant seen in https://www.scala-sbt.org/0.12.4/docs/Getting-Started/Setup.html#unix. I think we can drop this old practice. --- .gitignore | 2 +- build.sbt | 77 ++++++++++++++++------------------ project/HouseRulesPlugin.scala | 12 +----- project/Release.scala | 34 --------------- project/build.properties | 2 +- project/plugins.sbt | 3 +- 6 files changed, 41 insertions(+), 89 deletions(-) delete mode 100644 project/Release.scala diff --git a/.gitignore b/.gitignore index a9190442a..4901fa3a4 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ npm-debug.log .bloop .metals .bsp/ -/project/metals.sbt +metals.sbt diff --git a/build.sbt b/build.sbt index a222d60d9..cea416b0d 100644 --- a/build.sbt +++ b/build.sbt @@ -7,6 +7,8 @@ import java.nio.file.{ Files, Path => JPath } import scala.util.Try +// ThisBuild settings take lower precedence, +// but can be shared across the multi projects. ThisBuild / version := { val v = "1.5.0-SNAPSHOT" nightlyVersion.getOrElse(v) @@ -17,6 +19,30 @@ ThisBuild / scalafmtOnCompile := !(Global / insideCI).value ThisBuild / Test / scalafmtOnCompile := !(Global / insideCI).value ThisBuild / turbo := true ThisBuild / usePipelining := false // !(Global / insideCI).value +ThisBuild / organization := "org.scala-sbt" +ThisBuild / description := "sbt is an interactive build tool" +ThisBuild / licenses := List("Apache-2.0" -> url("https://github.com/sbt/sbt/blob/develop/LICENSE")) +ThisBuild / javacOptions ++= Seq("-source", "1.8", "-target", "1.8") +ThisBuild / Compile / doc / javacOptions := Nil +ThisBuild / developers := List( + Developer("harrah", "Mark Harrah", "@harrah", url("https://github.com/harrah")), + Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("https://github.com/eed3si9n")), + Developer("jsuereth", "Josh Suereth", "@jsuereth", url("https://github.com/jsuereth")), + Developer("dwijnand", "Dale Wijnand", "@dwijnand", url("https://github.com/dwijnand")), + Developer("eatkins", "Ethan Atkins", "@eatkins", url("https://github.com/eatkins")), + Developer( + "gkossakowski", + "Grzegorz Kossakowski", + "@gkossakowski", + url("https://github.com/gkossakowski") + ), + Developer("Duhemm", "Martin Duhem", "@Duhemm", url("https://github.com/Duhemm")) +) +ThisBuild / homepage := Some(url("https://github.com/sbt/sbt")) +ThisBuild / scmInfo := Some( + ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git") +) +ThisBuild / resolvers += Resolver.mavenLocal Global / semanticdbEnabled := !(Global / insideCI).value Global / semanticdbVersion := "4.4.10" @@ -27,37 +53,6 @@ Global / excludeLint += whitesourceIgnoredScopes Global / excludeLint += scriptedBufferLog Global / excludeLint += checkPluginCross -// ThisBuild settings take lower precedence, -// but can be shared across the multi projects. -def buildLevelSettings: Seq[Setting[_]] = - inThisBuild( - Seq( - organization := "org.scala-sbt", - description := "sbt is an interactive build tool", - bintrayPackage := sys.env.get("BINTRAY_PACKAGE").getOrElse("sbt"), - licenses := List("Apache-2.0" -> url("https://github.com/sbt/sbt/blob/develop/LICENSE")), - javacOptions ++= Seq("-source", "1.8", "-target", "1.8"), - Compile / doc / javacOptions := Nil, - developers := List( - Developer("harrah", "Mark Harrah", "@harrah", url("https://github.com/harrah")), - Developer("eed3si9n", "Eugene Yokota", "@eed3si9n", url("https://github.com/eed3si9n")), - Developer("jsuereth", "Josh Suereth", "@jsuereth", url("https://github.com/jsuereth")), - Developer("dwijnand", "Dale Wijnand", "@dwijnand", url("https://github.com/dwijnand")), - Developer("eatkins", "Ethan Atkins", "@eatkins", url("https://github.com/eatkins")), - Developer( - "gkossakowski", - "Grzegorz Kossakowski", - "@gkossakowski", - url("https://github.com/gkossakowski") - ), - Developer("Duhemm", "Martin Duhem", "@Duhemm", url("https://github.com/Duhemm")) - ), - homepage := Some(url("https://github.com/sbt/sbt")), - scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt"), "git@github.com:sbt/sbt.git")), - resolvers += Resolver.mavenLocal, - ) - ) - def commonBaseSettings: Seq[Setting[_]] = Def.settings( headerLicense := Some( HeaderLicense.Custom( @@ -72,7 +67,6 @@ def commonBaseSettings: Seq[Setting[_]] = Def.settings( componentID := None, resolvers += Resolver.typesafeIvyRepo("releases").withName("typesafe-sbt-build-ivy-releases"), resolvers += Resolver.sonatypeRepo("snapshots"), - resolvers += "bintray-sbt-maven-releases" at "https://dl.bintray.com/sbt/maven-releases/", resolvers += Resolver.url( "bintray-scala-hedgehog", url("https://dl.bintray.com/hedgehogqa/scala-hedgehog") @@ -116,7 +110,7 @@ def utilCommonSettings: Seq[Setting[_]] = def minimalSettings: Seq[Setting[_]] = commonSettings ++ customCommands ++ - publishPomSettings ++ Release.javaVersionCheckSettings + publishPomSettings def baseSettings: Seq[Setting[_]] = minimalSettings ++ Seq(projectComponent) ++ baseScalacOptions ++ Licensed.settings @@ -173,7 +167,6 @@ lazy val sbtRoot: Project = (project in file(".")) // .enablePlugins(ScriptedPlugin) .aggregate(nonRoots: _*) .settings( - buildLevelSettings, minimalSettings, onLoadMessage := { val version = sys.props("java.specification.version") @@ -228,21 +221,17 @@ lazy val sbtRoot: Project = (project in file(".")) // This is used to configure an sbt-launcher for this version of sbt. lazy val bundledLauncherProj = (project in file("launch")) + .enablePlugins(SbtLauncherPlugin) .settings( minimalSettings, inConfig(Compile)(Transform.configSettings), - Release.launcherSettings(sbtLaunchJar) ) - .enablePlugins(SbtLauncherPlugin) .settings( name := "sbt-launch", moduleName := "sbt-launch", description := "sbt application launcher", autoScalaLibrary := false, crossPaths := false, - // mimaSettings, // TODO: Configure MiMa, deal with Proguard - publish := Release.deployLauncher.value, - publishLauncher := Release.deployLauncher.value, packageBin in Compile := sbtLaunchJar.value, mimaSettings, mimaPreviousArtifacts := Set() @@ -1442,7 +1431,6 @@ def otherRootSettings = publishLocalBinAll := { val _ = (Compile / publishLocalBin).all(scriptedProjects).value }, - aggregate in bintrayRelease := false, ) ++ inConfig(Scripted.RepoOverrideTest)( Seq( scriptedLaunchOpts := List( @@ -1542,6 +1530,15 @@ def customCommands: Seq[Setting[_]] = Seq( }, ) +ThisBuild / pomIncludeRepository := { _ => + false +} +ThisBuild / publishTo := { + val nexus = "https://oss.sonatype.org/" + if (isSnapshot.value) Some("snapshots" at nexus + "content/repositories/snapshots") + else Some("releases" at nexus + "service/local/staging/deploy/maven2") +} +ThisBuild / publishMavenStyle := true ThisBuild / whitesourceProduct := "Lightbend Reactive Platform" ThisBuild / whitesourceAggregateProjectName := { // note this can get detached on tag build etc diff --git a/project/HouseRulesPlugin.scala b/project/HouseRulesPlugin.scala index 3e8eab391..42d1c2e6d 100644 --- a/project/HouseRulesPlugin.scala +++ b/project/HouseRulesPlugin.scala @@ -1,23 +1,13 @@ import sbt._ import Keys._ -import bintray.BintrayPlugin -import bintray.BintrayPlugin.autoImport._ object HouseRulesPlugin extends AutoPlugin { - override def requires = plugins.JvmPlugin && BintrayPlugin + override def requires = plugins.JvmPlugin override def trigger = allRequirements - override def buildSettings: Seq[Def.Setting[_]] = baseBuildSettings override def projectSettings: Seq[Def.Setting[_]] = baseSettings - lazy val baseBuildSettings: Seq[Def.Setting[_]] = Seq( - bintrayOrganization := Some("sbt"), - bintrayRepository := sys.env.get("BINTRAY_REPOSITORY").getOrElse("maven-releases"), - ) - lazy val baseSettings: Seq[Def.Setting[_]] = Seq( - bintrayPackage := (ThisBuild / bintrayPackage).value, - bintrayRepository := (ThisBuild / bintrayRepository).value, scalacOptions ++= Seq("-encoding", "utf8"), scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xlint"), scalacOptions += "-language:higherKinds", diff --git a/project/Release.scala b/project/Release.scala deleted file mode 100644 index 25cea8595..000000000 --- a/project/Release.scala +++ /dev/null @@ -1,34 +0,0 @@ -import sbt._ -import Keys._ -//import com.typesafe.sbt.JavaVersionCheckPlugin.autoImport._ -import _root_.bintray.BintrayPlugin.autoImport._ -import _root_.bintray.InternalBintrayKeys._ - -object Release { - lazy val launcherRemotePath = SettingKey[String]("launcher-remote-path") - lazy val deployLauncher = TaskKey[Unit]( - "deploy-launcher", - "Upload the launcher to its traditional location for compatibility with existing scripts." - ) - - def launcherSettings(launcher: TaskKey[File]): Seq[Setting[_]] = Seq( - launcherRemotePath := { - val organizationPath = organization.value.replaceAll("""\.""", "/") - s"$organizationPath/${moduleName.value}/${version.value}/${moduleName.value}.jar" - }, - deployLauncher := { - val repo = bintrayRepo.value - repo.upload( - bintrayPackage.value, - version.value, - launcherRemotePath.value, - launcher.value, - sLog.value - ) - } - ) - - def javaVersionCheckSettings = Seq( - //javaVersionPrefix in javaVersionCheck := Some("1.8") - ) -} diff --git a/project/build.properties b/project/build.properties index d91c272d4..0b2e09c5a 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.6 +sbt.version=1.4.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index 254c1387d..6fd8635fe 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,8 +3,7 @@ ThisBuild / useCoursier := false scalacOptions ++= Seq("-feature", "-language:postfixOps", "-Ywarn-unused:_,-imports") addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0") -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.0") +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.3.0") addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.5.1") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "3.0.2")