diff --git a/build.sbt b/build.sbt index 5816be49..50ff53f7 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,8 @@ +publish / skip := true // root project + lazy val scalaTestVersion = "3.2.3" lazy val commonSettings = Seq( - crossScalaVersions := Seq("3.0.0-M1", "2.13.3", "2.12.12", "2.11.12"), - scalaVersion := "2.13.3", scalacOptions ++= Seq("-deprecation", "-feature"), ) @@ -13,7 +13,7 @@ lazy val swing = project.in(file(".")) .settings( name := "scala-swing", OsgiKeys.exportPackage := Seq(s"scala.swing.*;version=${version.value}"), - scalaModuleMimaPreviousVersion := Some("2.1.0"), + // scalaModuleMimaPreviousVersion := Some("2.1.0"), TODO re-enable after we have a 3.0 release // set the prompt (for this build) to include the project id. ThisBuild / shellPrompt := { state => Project.extract(state).currentRef.project + "> " }, libraryDependencies ++= Seq( @@ -38,7 +38,8 @@ lazy val examples = project.in(file("examples")) .settings( scalaVersion := (swing / scalaVersion).value, run / fork := true, - fork := true + fork := true, + publish / skip := true, ) lazy val uitest = project.in(file("uitest")) @@ -47,5 +48,6 @@ lazy val uitest = project.in(file("uitest")) .settings( scalaVersion := (swing / scalaVersion).value, run / fork := true, - fork := true + fork := true, + publish / skip := true, ) diff --git a/build.sh b/build.sh index 65cc465d..ae5ee5ba 100755 --- a/build.sh +++ b/build.sh @@ -10,11 +10,13 @@ set -e # sbt-dynver sets the version number from the tag # sbt-travisci sets the Scala version from the travis job matrix -# When a new binary incompatible Scala version becomes available, a previously released version -# can be released using that new Scala version by creating a new tag containing the Scala version -# after a hash, e.g., v1.2.3#2.13.0-M3. +# To back-publish an existing release for a new Scala / Scala.js / Scala Native version: +# - check out the tag for the version that needs to be published +# - change `.travis.yml` to adjust the version numbers and trim down the build matrix as necessary +# - commit the changes and tag this new revision with an arbitrary suffix after a hash, e.g., +# `v1.2.3#dotty-0.27` (the suffix is ignored, the version will be `1.2.3`) -# For normal tags that are cross-built, we release on JDK 8 for Scala 2.x +# We release on JDK 8 (for Scala 2.x and 3.x) isReleaseJob() { if [[ "$ADOPTOPENJDK" == "8" ]]; then true @@ -23,43 +25,30 @@ isReleaseJob() { fi } -# For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases -isTagScalaReleaseJob() { - if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.13\.[0-9]+$ ]]; then - true - else - false - fi -} +if [[ "$SCALAJS_VERSION" == "" ]]; then + projectPrefix="" +else + projectPrefix="" +fi verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?" -tagPat="^v$verPat(#$verPat)?$" +tagPat="^v$verPat(#.*)?$" if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then releaseTask="ci-release" - tagScalaVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//) - if [[ "$tagScalaVer" == "" ]]; then - if ! isReleaseJob; then - echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" - exit 0 - fi - else - if isTagScalaReleaseJob; then - setTagScalaVersion='set every scalaVersion := "'$tagScalaVer'"' - else - echo "The releases for Scala $tagScalaVer are built by other jobs in the travis job matrix" - exit 0 - fi + if ! isReleaseJob; then + echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION" + exit 0 fi fi # default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions -export CI_RELEASE="publishSigned" -export CI_SNAPSHOT_RELEASE="publish" +export CI_RELEASE="${projectPrefix}publishSigned" +export CI_SNAPSHOT_RELEASE="${projectPrefix}publish" # default is sonatypeBundleRelease, which closes and releases the staging repo # see https://github.com/xerial/sbt-sonatype#commands # for now, until we're confident in the new release scripts, just close the staging repo. export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose" -sbt "$setTagScalaVersion" clean test publishLocal $releaseTask +sbt clean ${projectPrefix}test ${projectPrefix}publishLocal $releaseTask