BuildInfo
Generate scala code from your buildfile. This plugin generates a single object containing information from your build.
To declare a module that uses BuildInfo you must extend the mill.contrib.buildinfo.BuildInfo trait when defining your module.
Quickstart:
build.scimport $ivy.`com.lihaoyi::mill-contrib-buildinfo:`
import mill.contrib.buildinfo.BuildInfo
object project extends BuildInfo {
val name = "project-name"
val buildInfoPackageName = "com.organization"
def buildInfoMembers = Seq(
BuildInfo.Value("name", name),
BuildInfo.Value("scalaVersion", scalaVersion()),
)
}
Main.scalaimport com.organization.BuildInfo
@main
def main = {
println(BuildInfo.name)
println(BuildInfo.scalaVersion)
}
Configuration options
-
def buildInfoMembers: T[Seq[BuildInfo.Value]]The map containing all member names and values for the generated info object. -
def buildInfoObjectName: String, default:BuildInfoThe name of the object which contains all the members frombuildInfoMembers. -
def buildInfoPackageName: StringThe package name of the object.