From 3a35851fef92f8ccfab1119967deab6b23e80f53 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Mon, 16 Dec 2019 14:33:17 +0100 Subject: [PATCH] use sbt-dynver (#27042) --- RELEASING.md | 2 +- project/AkkaBuild.scala | 9 ++++++++- project/plugins.sbt | 1 + project/scripts/release | 18 +++++++++--------- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/RELEASING.md b/RELEASING.md index 51c7ab0da5..bae674099b 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -54,7 +54,7 @@ Make sure you have completed the setup in `project/scripts/release`. Nightly snapshot releases are created from master and published to https://repo.akka.io/snapshots by https://jenkins.akka.io:8498/job/akka-publish-nightly/ -To create snapshot versions manually, use `sbt clean stampVersion publish`. +To create snapshot versions manually, use `sbt clean publish`. The release artifacts are created in `akka-*/target/repository` and can be copied over to a maven server. If you have access, the Jenkins job at https://jenkins.akka.io:8498/job/akka-publish-wip/ can be used to publish diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 4644d3592e..6ad4d23482 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -29,8 +29,12 @@ object AkkaBuild { organization := "com.typesafe.akka", Dependencies.Versions, // use the same value as in the build scope + // TODO #26675 this can be removed once we use sbt-dynver instead of timestamps + // everywhere version := (version in ThisBuild).value) + // TODO #26675 this can be removed once we use sbt-dynver instead of timestamps + // everywhere lazy val currentDateTime = { // storing the first accessed timestamp in system property so that it will be the // same when build is reloaded or when using `+`. @@ -41,6 +45,8 @@ object AkkaBuild { .format(ZonedDateTime.now(ZoneOffset.UTC))) } + // TODO #26675 this can be removed once we use sbt-dynver instead of timestamps + // everywhere def akkaVersion: String = { val default = "2.6-SNAPSHOT" sys.props.getOrElse("akka.build.version", default) match { @@ -50,6 +56,8 @@ object AkkaBuild { } } + // TODO #26675 this can be removed once we use sbt-dynver instead of timestamps + // everywhere def akkaVersionFromFile(default: String): String = { val versionFile = "akka-actor/target/classes/version.conf" if (new File(versionFile).exists()) { @@ -66,7 +74,6 @@ object AkkaBuild { UnidocRoot.akkaSettings, Protobuf.settings, parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean, - version in ThisBuild := akkaVersion, // used for linking to API docs (overwrites `project-info.version`) ThisBuild / projectInfoVersion := { if (isSnapshot.value) "snapshot" else version.value } ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 24131dbfdb..a5067acfe1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -24,3 +24,4 @@ addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.18") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.3.1") // for maintenance of copyright file header addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0") addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.22") +addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0") diff --git a/project/scripts/release b/project/scripts/release index dfa99f27e6..5e7edbd805 100755 --- a/project/scripts/release +++ b/project/scripts/release @@ -251,7 +251,7 @@ declare -r current_version=$(get_current_version) echolog "Current version is ${current_version}" if [ "${current_version:0:3}" != "${version:0:3}" ]; then - fail "Releasing $version from wrong with version $current_version" + fail "Releasing $version from wrong branch with version $current_version" fi # start clean @@ -267,29 +267,29 @@ fi # build the release echolog "Building the release..." if [ ! $dry_run ]; then - RELEASE_OPT="-Dakka.build.version=${version} -Dakka.genjavadoc.enabled=true -Dpublish.maven.central=true" + RELEASE_OPT="-Dakka.genjavadoc.enabled=true -Dpublish.maven.central=true" else - RELEASE_OPT="-Dakka.build.version=${version} -Dakka.genjavadoc.enabled=true" + RELEASE_OPT="-Dakka.genjavadoc.enabled=true" fi -try sbt $RELEASE_OPT +buildRelease +# tag this release +echolog "Tagging..." +try git tag -am "Version ${version}" v${version} +try sbt $RELEASE_OPT +buildRelease try sbt $RELEASE_OPT buildDocs + echolog "Successfully created local release" # check binary compatibility for dry run if [ ! $no_mima ] && [ $dry_run ]; then echodry "Running migration manager report..." - sbt $RELEASE_OPT +mimaReportBinaryIssues + try sbt $RELEASE_OPT +mimaReportBinaryIssues echodry "Finished migration manager report" fi try sbt $RELEASE_OPT whitesourceCheckPolicies -# commit and tag this release -echolog "Tagging..." -try git tag -am "Version ${version}" v${version} - # the point of no return... we're now pushing out to servers # use a special failure from now on