Skip to content

Commit 0652431

Browse files
committed
Update readme for 2.1
1 parent dbd7f45 commit 0652431

File tree

1 file changed

+18
-22
lines changed

1 file changed

+18
-22
lines changed

README.md

+18-22
Original file line numberDiff line numberDiff line change
@@ -21,43 +21,36 @@ Having a shared plugin reduces duplication between the above
2121
repositories. Reducing duplication makes maintenance easier and
2222
helps ensure consistency.
2323

24-
A major feature of the plugin is automated tag-based publishing. A
25-
release is made by pushing a tag to GitHub. Travis-CI then stages
26-
artifacts on Sonatype. Pressing "Close" and "Release" in the Sonatype
27-
web UI will then send the artifacts to Maven Central.
24+
A major feature of the plugin is automated tag-based publishing using
25+
sbt-ci-release. A release is made by pushing a tag to GitHub.
26+
27+
The plugin also brings in
28+
- sbt-travisci to set the `scalaVersion` and `crossScalaVersions`
29+
- sbt-dynver to set the `version` based on the git history
30+
- sbt-header
31+
- sbt-osgi
2832

2933
## Usage
3034

3135
Add the plugin to the `project/plugins.sbt` file:
3236

3337
```
34-
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.0.0")
38+
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.1.0")
3539
```
3640

3741
Then, in your `build.sbt` add:
3842

3943
```
40-
import ScalaModulePlugin._
44+
// In a multi-project build, you might want to apply these settings only to the
45+
// main project (see e.g. scala-parallel-collections)
46+
ScalaModulePlugin.scalaModuleSettings
4147
42-
scalaModuleSettings // in a multi-project build, you might want to apply these settings only to the
43-
// main project (see e.g. scala-parallel-collections)
48+
// For JVM projects
49+
ScalaModulePlugin.scalaModuleSettingsJVM
4450
4551
name := "<module name>"
4652
repoName := "<GitHub repo name>" // the repo under github.com/scala/, only required if different from name
4753
organization := "<org>" // only required if different from "org.scala-lang.modules"
48-
version := "<module version>"
49-
50-
// The plugin uses `scalaVersionsByJvm` to set `crossScalaVersions in ThisBuild` according to the JVM major version.
51-
// The `scalaVersion in ThisBuild` is set to `crossScalaVersions.value.head`.
52-
scalaVersionsByJvm in ThisBuild := {
53-
val v211 = "2.11.12"
54-
val v212 = "2.12.8"
55-
val v213 = "2.13.0-RC1"
56-
// Map[JvmMajorVersion, List[(ScalaVersion, UseForPublishing)]]
57-
Map(
58-
8 -> List(v211 -> true, v212 -> true, v213 -> true),
59-
9 -> List(v211, v212, v213).map(_ -> false))
60-
}
6154
6255
mimaPreviousVersion := Some("1.0.0") // enables MiMa (`None` by default, which disables it)
6356
@@ -66,11 +59,14 @@ OsgiKeys.exportPackage := Seq(s"<exported package>;version=${version.value}")
6659
// Other settings
6760
```
6861

62+
Scala versions are defined in `.travis.yml`.
63+
64+
Cross-building with Scala.js is possible, see scala-xml for example.
65+
6966
These additional settings are enabled by `scalaModuleSettings`:
7067
- `scalacOptions in (Compile, compile) ++= Seq("-feature", "-deprecation", "-unchecked", "-Xlint")`
7168
- A `projectName.properties` file is generated and packaged
7269
- `fork in Test := true` to work around some classpath clashes with scala-xml
73-
- `publishTo` sonatype, credentials file expected in `~/.ivy2/.credentials`
7470
- POM and OSGi metadata
7571

7672
The following settings are also available:

0 commit comments

Comments
 (0)