summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos A. Rueda <carueda@gmail.com>2019-09-22 13:20:29 -0700
committerTobias Roeser <le.petit.fou@web.de>2019-09-22 22:20:29 +0200
commit6c7a42eac6a05746eca96c648b55a50af2587a3b (patch)
tree2bdabea07e9dd99f40e5c2fb49540bf14d3a595d
parentef3708f936e2824632cb136add4496227af5cf88 (diff)
downloadmill-6c7a42eac6a05746eca96c648b55a50af2587a3b.tar.gz
mill-6c7a42eac6a05746eca96c648b55a50af2587a3b.tar.bz2
mill-6c7a42eac6a05746eca96c648b55a50af2587a3b.zip
Add JBuildInfo (#697)
* Add JBuildInfo * Update JBuildInfo 0.1.2 now generates getter methods instead
-rw-r--r--docs/pages/10 - Thirdparty Modules.md53
1 files changed, 53 insertions, 0 deletions
diff --git a/docs/pages/10 - Thirdparty Modules.md b/docs/pages/10 - Thirdparty Modules.md
index 58aaf558..a6b87b81 100644
--- a/docs/pages/10 - Thirdparty Modules.md
+++ b/docs/pages/10 - Thirdparty Modules.md
@@ -352,3 +352,56 @@ Publishing to custom local Maven repository
Publishing to /tmp/m2repo
```
+## JBuildInfo
+
+This is a [mill](https://www.lihaoyi.com/mill/) module similar to
+[BuildInfo](https://www.lihaoyi.com/mill/page/contrib-modules.html#buildinfo)
+but for Java.
+It will generate a Java class containing information from your build.
+
+Project home: https://github.com/carueda/mill-jbuildinfo
+
+To declare a module that uses this plugin, extend the
+`com.github.carueda.mill.JBuildInfo` trait and provide
+the desired information via the `buildInfoMembers` method:
+
+```scala
+// build.sc
+import $ivy.`com.github.carueda::jbuildinfo:0.1.2`
+import com.github.carueda.mill.JBuildInfo
+import mill.T
+
+object project extends JBuildInfo {
+ def buildInfoMembers: T[Map[String, String]] = T {
+ Map(
+ "name" -> "some name",
+ "version" -> "x.y.z"
+ )
+ }
+}
+```
+
+This will generate:
+
+```java
+// BuildInfo.java
+public class BuildInfo {
+ public static final String getName() { return "some name"; }
+ public static final String getVersion() { return "x.y.z"; }
+}
+```
+
+### Configuration options
+
+* `def buildInfoMembers: T[Map[String, String]]`
+
+ The map containing all member names and values for the generated class.
+
+* `def buildInfoClassName: String`, default: `BuildInfo`
+
+ The name of the class that will contain all the members from
+ `buildInfoMembers`.
+
+* `def buildInfoPackageName: Option[String]`, default: `None`
+
+ The package name for the generated class.