From 1a3048d1b4a2d1ac894c5fd8e8f7d442a98fec33 Mon Sep 17 00:00:00 2001 From: Martin Gamwell Dawids <728722+martingd@users.noreply.github.com> Date: Tue, 15 Feb 2022 23:12:20 +0100 Subject: [PATCH] Added documentation for options PackagePrivate and ConstantValue. --- README.markdown | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.markdown b/README.markdown index 842116e..da9052a 100644 --- a/README.markdown +++ b/README.markdown @@ -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 -------