Allow -DcommitId flag when building Pkl (#954)
This is to allow building Pkl in environments that don't have access to git.
This commit is contained in:
1 parent
1a4f9ee72e
commit
eabfcdd333
1 file changed
+2
@@ -350,6 +350,8 @@ open class BuildInfo(private val project: Project) {
|
||||
|
||||
// could be `commitId: Provider<String> = project.provider { ... }`
|
||||
val commitId: String by lazy {
|
||||
// allow -DcommitId=abc123 for build environments that don't have git.
|
||||
System.getProperty("commitId").let { if (it != null) return@lazy it }
|
||||
// only run command once per build invocation
|
||||
if (project === project.rootProject) {
|
||||
val process =
|
||||
|
||||
Reference in new issue
Block a user