Skip to content

Commit 6132734

Browse files
authored
Update usage in README
1 parent 1bf89fd commit 6132734

File tree

1 file changed

+36
-13
lines changed

1 file changed

+36
-13
lines changed

README.md

+36-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,44 @@
11
# Scala modules sbt plugin
2-
This is an sbt plugin for creating a scala module build.
32

3+
This is an sbt plugin for creating a scala module build.
44

5-
# Usage
5+
## Usage
66

7-
You must be using sbt 0.13 for your projects. First create a `project/plugins.sbt` files:
7+
Add the plugin to the `project/plugins.sbt` file:
88

9-
addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.0")
9+
```
10+
addSbtPlugin("org.scala-lang.modules" % "scala-module-plugin" % "1.0.6")
11+
```
1012

1113
Then, in your `build.sbt` add:
1214

13-
scalaModuleSettings
14-
15-
name := "<your module name>"
16-
17-
version := "<your module version>"
18-
19-
// standard stuff follows:
20-
scalaVersion := "2.11.0-M8"
21-
15+
```
16+
scalaModuleSettings
17+
18+
name := "<module name>"
19+
repoName := "<GitHub repo name>" // the repo under github.com/scala/, only required if different from name
20+
organization := "<org>"
21+
version := "<module version>"
22+
23+
// The plugin uses `scalaVersionsByJvm` to set `crossScalaVersions` according to the JVM major version.
24+
// The `scalaVersion` is set to `crossScalaVersions.value.head`.
25+
scalaVersionsByJvm := {
26+
val v211 = "2.11.11"
27+
val v212 = "2.12.2"
28+
val v213 = "2.13.0-M1"
29+
30+
// Map[JvmMajorVersion, List[(ScalaVersion, UseForPublishing)]]
31+
Map(
32+
6 -> List(v211 -> true),
33+
7 -> List(v211 -> false),
34+
8 -> List(v212 -> true, v213 -> true, v211 -> false),
35+
9 -> List(v212, v213, v211).map(_ -> false)
36+
)
37+
}
38+
39+
mimaPreviousVersion := Some("1.0.3") // enables MiMa (`None` by default, which disables it)
40+
41+
OsgiKeys.exportPackage := Seq(s"<exported package>;version=${version.value}")
42+
43+
// Other settings
44+
```

0 commit comments

Comments
 (0)