[build] Utilize jf.codegen to replace manual file creation
This commit is contained in:
parent
5459a313c2
commit
6bc0209815
1
libjf-config-compiler-plugin/.gitignore
vendored
1
libjf-config-compiler-plugin/.gitignore
vendored
|
@ -1 +0,0 @@
|
||||||
src/main/java/io/gitlab/jfronny/libjf/config/plugin/BuildMetadata.java
|
|
|
@ -3,6 +3,7 @@ import io.gitlab.jfronny.scripts.*
|
||||||
plugins {
|
plugins {
|
||||||
id("java-gradle-plugin")
|
id("java-gradle-plugin")
|
||||||
id("jf.maven-publish")
|
id("jf.maven-publish")
|
||||||
|
id("jf.codegen")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = rootProject.group
|
group = rootProject.group
|
||||||
|
@ -38,10 +39,12 @@ gradlePlugin {
|
||||||
tasks.publish.get().dependsOn(tasks.build.get())
|
tasks.publish.get().dependsOn(tasks.build.get())
|
||||||
rootProject.tasks.deployDebug.dependsOn(tasks.publish.get())
|
rootProject.tasks.deployDebug.dependsOn(tasks.publish.get())
|
||||||
|
|
||||||
projectDir.resolve("src/main/java/io/gitlab/jfronny/libjf/config/plugin/BuildMetadata.java").writeText("""
|
sourceSets {
|
||||||
package io.gitlab.jfronny.libjf.config.plugin;
|
main {
|
||||||
|
generate(project) {
|
||||||
public class BuildMetadata {
|
`class`("io.gitlab.jfronny.libjf.config.plugin", "BuildMetadata") {
|
||||||
public static final boolean isRelease = ${project.hasProperty("release")};
|
field("IS_RELEASE", project.hasProperty("release"), "public static final")
|
||||||
}
|
}
|
||||||
""".trimIndent())
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user