From 26dcfc182c585605ffe6fe323bdc7b2c62e000a4 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sat, 14 Nov 2020 13:16:32 -0500 Subject: [PATCH 1/2] Nightly setup --- build.sbt | 41 +++++++++++++++++++++++--------------- project/Dependencies.scala | 3 ++- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/build.sbt b/build.sbt index e0eb179bfa..edf08d0110 100644 --- a/build.sbt +++ b/build.sbt @@ -44,15 +44,6 @@ def mimaSettings: Seq[Setting[_]] = Seq( }, ) -ThisBuild / version := { - val old = (ThisBuild / version).value - nightlyVersion match { - case Some(v) => v - case _ => - if ((ThisBuild / isSnapshot).value) "1.4.0-SNAPSHOT" - else old - } -} ThisBuild / versionScheme := Some("early-semver") ThisBuild / organization := "org.scala-sbt" ThisBuild / licenses := List(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))) @@ -77,13 +68,6 @@ ThisBuild / developers := List( Developer("jvican", "Jorge Vicente Cantero", "@jvican", url("https://github.com/jvican")), Developer("Duhemm", "Martin Duhem", "@Duhemm", url("https://github.com/Duhemm")), ) -ThisBuild / publishTo := { - val old = (ThisBuild / publishTo).value - sys.props.get("sbt.build.localmaven") match { - case Some(path) => Some(MavenCache("local-maven", file(path))) - case _ => old - } -} ThisBuild / pomIncludeRepository := (_ => false) // drop repos other than Maven Central from POM ThisBuild / mimaPreviousArtifacts := Set.empty // limit the number of concurrent test so testQuick works @@ -698,6 +682,31 @@ def scriptedTask: Def.Initialize[InputTask[Unit]] = Def.inputTask { ) } +ThisBuild / version := { + val old = (ThisBuild / version).value + nightlyVersion match { + case Some(v) => v + case _ => + if ((ThisBuild / isSnapshot).value) "1.4.0-SNAPSHOT" + else old + } +} +def githubPackageRegistry: Option[Resolver] = + sys.env.get("RELEASE_GITHUB_PACKAGE_REGISTRY") map { repo => + s"GitHub Package Registry ($repo)" at s"https://maven.pkg.github.com/$repo" + } +ThisBuild / publishTo := { + val old = (ThisBuild / publishTo).value + githubPackageRegistry orElse old +} +ThisBuild / resolvers ++= githubPackageRegistry.toList +ThisBuild / credentials ++= { + sys.env.get("GITHUB_TOKEN") match { + case Some(token) => + List(Credentials("GitHub Package Registry", "maven.pkg.github.com", "unused", token)) + case _ => Nil + } +} ThisBuild / whitesourceProduct := "Lightbend Reactive Platform" ThisBuild / whitesourceAggregateProjectName := "sbt-zinc-master" ThisBuild / whitesourceAggregateProjectToken := "4b57f35176864c6397b872277d51bc27b89503de0f1742b8bc4dfa2e33b95c5c" diff --git a/project/Dependencies.scala b/project/Dependencies.scala index e9a2f2ee5f..06959b23d4 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -2,7 +2,8 @@ import sbt._, Keys._ import sbt.contraband.ContrabandPlugin.autoImport._ object Dependencies { - def nightlyVersion: Option[String] = sys.props.get("sbt.build.version") + def nightlyVersion: Option[String] = + sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version") val scala210 = "2.10.7" val scala211 = "2.11.12" From b6807267d418e70ff5808a9a6d799e8730f80cb8 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 15 Nov 2020 01:04:18 -0500 Subject: [PATCH 2/2] Use Bintray for nightly --- build.sbt | 36 ++++++++++------------------------ project/HouseRulesPlugin.scala | 4 +++- 2 files changed, 13 insertions(+), 27 deletions(-) diff --git a/build.sbt b/build.sbt index edf08d0110..07e262cf5c 100644 --- a/build.sbt +++ b/build.sbt @@ -44,12 +44,21 @@ def mimaSettings: Seq[Setting[_]] = Seq( }, ) +ThisBuild / version := { + val old = (ThisBuild / version).value + nightlyVersion match { + case Some(v) => v + case _ => + if ((ThisBuild / isSnapshot).value) "1.4.0-SNAPSHOT" + else old + } +} ThisBuild / versionScheme := Some("early-semver") ThisBuild / organization := "org.scala-sbt" ThisBuild / licenses := List(("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))) ThisBuild / scalafmtOnCompile := !(Global / insideCI).value ThisBuild / Test / scalafmtOnCompile := !(Global / insideCI).value -ThisBuild / bintrayPackage := "zinc" +ThisBuild / bintrayPackage := sys.env.get("BINTRAY_PACKAGE").getOrElse("zinc") ThisBuild / scmInfo := Some( ScmInfo(url("https://github.com/sbt/zinc"), "git@github.com:sbt/zinc.git") ) @@ -682,31 +691,6 @@ def scriptedTask: Def.Initialize[InputTask[Unit]] = Def.inputTask { ) } -ThisBuild / version := { - val old = (ThisBuild / version).value - nightlyVersion match { - case Some(v) => v - case _ => - if ((ThisBuild / isSnapshot).value) "1.4.0-SNAPSHOT" - else old - } -} -def githubPackageRegistry: Option[Resolver] = - sys.env.get("RELEASE_GITHUB_PACKAGE_REGISTRY") map { repo => - s"GitHub Package Registry ($repo)" at s"https://maven.pkg.github.com/$repo" - } -ThisBuild / publishTo := { - val old = (ThisBuild / publishTo).value - githubPackageRegistry orElse old -} -ThisBuild / resolvers ++= githubPackageRegistry.toList -ThisBuild / credentials ++= { - sys.env.get("GITHUB_TOKEN") match { - case Some(token) => - List(Credentials("GitHub Package Registry", "maven.pkg.github.com", "unused", token)) - case _ => Nil - } -} ThisBuild / whitesourceProduct := "Lightbend Reactive Platform" ThisBuild / whitesourceAggregateProjectName := "sbt-zinc-master" ThisBuild / whitesourceAggregateProjectToken := "4b57f35176864c6397b872277d51bc27b89503de0f1742b8bc4dfa2e33b95c5c" diff --git a/project/HouseRulesPlugin.scala b/project/HouseRulesPlugin.scala index 8c8958c4f6..99a201df93 100644 --- a/project/HouseRulesPlugin.scala +++ b/project/HouseRulesPlugin.scala @@ -1,3 +1,5 @@ +package zincbuild + import sbt._ import Keys._ import bintray.BintrayPlugin @@ -12,7 +14,7 @@ object HouseRulesPlugin extends AutoPlugin { lazy val baseBuildSettings: Seq[Def.Setting[_]] = Seq( bintrayOrganization := Some("sbt"), - bintrayRepository := "maven-releases", + bintrayRepository := sys.env.get("BINTRAY_REPOSITORY").getOrElse("maven-releases"), ) lazy val baseSettings: Seq[Def.Setting[_]] = Seq(