Skip to content

Commit

Permalink
Merge pull request sbt#116 from sbt/wip/0.8.0
Browse files Browse the repository at this point in the history
0.8.0
  • Loading branch information
eed3si9n committed Feb 22, 2018
2 parents bb40207 + c188052 commit b0519a1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 57 deletions.
52 changes: 0 additions & 52 deletions Migration.md

This file was deleted.

7 changes: 4 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ sbt-buildinfo generates Scala source from your build definitions.
Latest Stable
-------------

For sbt 0.13.6+ and sbt 1.x add sbt-buildinfo as a dependency in `project/buildinfo.sbt`:
For sbt 1.x add sbt-buildinfo as a dependency in `project/plugins.sbt`:

![Bintray version](https://img.shields.io/bintray/v/eed3si9n/sbt-plugins/sbt-buildinfo.svg)

```scala
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "x.y.z")
```

For sbt 0.13.(x < 6), see [0.3.2](https://github.com/sbt/sbt-buildinfo/tree/0.3.2).
- For sbt 0.13.(x >= 6), see [0.7.0](https://github.com/sbt/sbt-buildinfo/tree/v0.7.0).
- For sbt 0.13.(x < 6), see [0.3.2](https://github.com/sbt/sbt-buildinfo/tree/0.3.2).

Usage
-----
Expand All @@ -27,7 +28,7 @@ Add the following in your `build.sbt`:
lazy val root = (project in file(".")).
enablePlugins(BuildInfoPlugin).
settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, scalaVersion, sbtVersion),
buildInfoKeys := BuildInfoKey.ofN(name, version, scalaVersion, sbtVersion),
buildInfoPackage := "hello"
)
```
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
lazy val commonSettings: Seq[Setting[_]] = Seq(
git.baseVersion in ThisBuild := "0.7.0",
git.baseVersion in ThisBuild := "0.8.0",
organization in ThisBuild := "com.eed3si9n"
)

Expand Down
32 changes: 32 additions & 0 deletions notes/0.8.0.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
sbt-buildinfo 0.8.0 is published for sbt 1.

### BuildInfoKey.of(...) and BuildInfoKey.ofN(...)

Prior to 0.8.0 when sbt-buildinfo generated the `BuildInfo` object using tasks, it was executing the tasks out-of-graph.
This would occasionally cause race conditions when used with side-effecty tasks.

To workaround this issue sbt-buildinfo introduces a new `BuildInfokey.of(...)` and `BuildInfoKey.ofN(...)` macro that will safely execute the tasks within the control of the task engine.

#### Before 0.8.0

```scala
lazy val root = (project in file("."))
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoKeys := Seq[BuildInfoKey](name, version, someTask),
buildInfoPackage := "hello"
)
```

#### After 0.8.0

```scala
lazy val root = (project in file("."))
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoKeys := BuildInfoKey.ofN(name, version, someTask),
buildInfoPackage := "hello"
)
```

This feature was contributed by @dwijnand as #114
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.0
sbt.version=1.1.1

0 comments on commit b0519a1

Please sign in to comment.