diff --git a/README.md b/README.md index 15fb3df..2efccf7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,6 @@ This is an sbt 1.x plugin for building Scala modules. ## What modules use it? -* [travis-test](https://github.com/lrytz/travis-test) (example project for testing this plugin and tag-driven releases) * [scala-async](https://github.com/scala/scala-async) * [scala-collection-compat](https://github.com/scala/scala-collection-compat) * [scala-collection-contrib](https://github.com/scala/scala-collection-contrib) @@ -25,19 +24,17 @@ A major feature of the plugin is automated tag-based publishing using sbt-ci-release. A release is made by pushing a tag to GitHub. The plugin also brings in - - sbt-travisci to set the `scalaVersion` and `crossScalaVersions` - sbt-dynver to set the `version` based on the git history + - sbt-version-policy to check the versioning policy using MiMa - sbt-header to automate copyright header maintenance - - sbt-mima-plugin to maintain binary compatibility - sbt-osgi, if enabled with `scalaModuleOsgiSettings` - - sbt-version-policy to check the versioning policy ## Usage Add the plugin to the `project/plugins.sbt` file: ``` -addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.3") +addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % ) ``` Then, in your `build.sbt` add: @@ -61,20 +58,17 @@ OsgiKeys.exportPackage := Seq(s";version=${version.value}") // Other settings ``` -Scala versions are defined in `.travis.yml`. - -Cross-building with Scala.js and Scala Native is possible, see travis-test, scala-xml or scala-parser-combinators for example. +Cross-building with Scala.js and Scala Native is possible. See scala-xml or scala-parser-combinators for examples. These additional settings are enabled by `scalaModuleSettings`: - - `scalacOptions in (Compile, compile) ++= Seq("-feature", "-deprecation", "-unchecked", "-Xlint")` + - `Compile / compile / scalacOptions ++= Seq("-feature", "-deprecation", "-unchecked", "-Xlint")` - A `projectName.properties` file is generated and packaged - - `fork in Test := true` to work around some classpath clashes with scala-xml + - `Test / fork := true` to work around some classpath clashes with scala-xml - POM metadata The following settings are also available: - - `enableOptimizer` adds `-opt-inline-from:` or `-opt:l:project` or `-optimize` to `scalacOptions in (Compile, compile)`, + - `enableOptimizer` adds `-opt-inline-from:` or `-opt:l:project` or `-optimize` to `Compile / compile / scalacOptions`, depending on the Scala version - - `disablePublishing` is useful for multi-project builds for projects that should not be published ## Set up tag-based publishing @@ -91,7 +85,7 @@ The instructions here are a summary of the readme in https://github.com/olafurpg - Copy the public key to a key server - `gpg --armor --export $LONG_ID` - http://keyserver.ubuntu.com:11371/ - - Open the Settings panel on your project's travis, define four secret env vars + - In your repo's Actions settings, define four secret env vars - `PGP_PASSPHRASE` the passphrase you chose above - `PGP_SECRET` the secret key in base64 - macOS: `gpg --armor --export-secret-keys $LONG_ID | base64` diff --git a/build.sbt b/build.sbt index 1545b67..9cf87b3 100644 --- a/build.sbt +++ b/build.sbt @@ -9,6 +9,5 @@ developers := List(Developer("", "", "", url("https://scala-lang.org")) addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.6") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") -addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.2.0") // set scalaVersion and crossScalaVersions addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7") // set version, scmInfo, publishing settings -addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "2.0.0") +addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "2.0.0") // brings in MiMa diff --git a/src/main/scala/ScalaModulePlugin.scala b/src/main/scala/ScalaModulePlugin.scala index aca2714..5539c0e 100644 --- a/src/main/scala/ScalaModulePlugin.scala +++ b/src/main/scala/ScalaModulePlugin.scala @@ -37,17 +37,6 @@ object ScalaModulePlugin extends AutoPlugin { override def projectSettings: Seq[Setting[_]] = Seq( // The staging profile is called `org.scala-lang`, the default is `org.scala-lang.modules` sonatypeProfileName := "org.scala-lang", - - // The staging repository name. The default is `[sbt-sonatype] name version`. We include the - // Scala/Scala.js/Scala Native versions and the travis job number to avoid conflicts when - // running the travis jobs. Example: collection-compat has a two 2.12.x jobs, one for the - // compat library, one for the migration rules, and both were writing to the same staging repo. - sonatypeSessionName := { - val sjs = Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).map(v => s" (js $v)").getOrElse("") - val native = Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).map(v => s" (native $v)").getOrElse("") - val jobNr = Option(System.getenv("TRAVIS_JOB_NUMBER")).filter(_.nonEmpty).map(v => s" (travis #$v)").getOrElse("") - s"${sonatypeSessionName.value} Scala ${scalaVersion.value}$sjs$native$jobNr" - }, ) // Global settings @@ -69,10 +58,6 @@ object ScalaModulePlugin extends AutoPlugin { } } - lazy val disablePublishing: Seq[Setting[_]] = Seq( - publish / skip := true - ) - /** * To be included in the main sbt project of a Scala module. */