Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added documentation for options PackagePrivate and ConstantValue. #181

Merged
merged 1 commit into from
Feb 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,43 @@ val builtAtString: String = "2015-07-30 03:30:16.849-0700"
val builtAtMillis: Long = 1438227016849L
```

### BuildInfoOption.PackagePrivate
Set the package using `buildInfoPackage` and use the option `BuildInfoOption.PackagePrivate`

```scala
buildInfoPackage := "hello"
buildInfoOptions += BuildInfoOption.PackagePrivate
```

to make the generated `BuildInfo` object package private:

```scala
/** This object was generated by sbt-buildinfo. */
private[hello] case object BuildInfo {
...
}
```

### BuildInfoOption.ConstantValue

Add the following option

```scala
buildInfoOptions += BuildInfoOption.ConstantValue
```
to have all vals in the `BuildInfo` object declared `final` and without an explicit type annotation:

```scala
/** This object was generated by sbt-buildinfo. */
case object BuildInfo {
/** The value is "helloworld". */
final val name = "helloworld"
...
}
```

This is particular useful if the values must be constants – e.g., if you need to assign them to annotation arguments.

License
-------

Expand Down