[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 {
|
||||
id("java-gradle-plugin")
|
||||
id("jf.maven-publish")
|
||||
id("jf.codegen")
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
@ -38,10 +39,12 @@ gradlePlugin {
|
||||
tasks.publish.get().dependsOn(tasks.build.get())
|
||||
rootProject.tasks.deployDebug.dependsOn(tasks.publish.get())
|
||||
|
||||
projectDir.resolve("src/main/java/io/gitlab/jfronny/libjf/config/plugin/BuildMetadata.java").writeText("""
|
||||
package io.gitlab.jfronny.libjf.config.plugin;
|
||||
|
||||
public class BuildMetadata {
|
||||
public static final boolean isRelease = ${project.hasProperty("release")};
|
||||
sourceSets {
|
||||
main {
|
||||
generate(project) {
|
||||
`class`("io.gitlab.jfronny.libjf.config.plugin", "BuildMetadata") {
|
||||
field("IS_RELEASE", project.hasProperty("release"), "public static final")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
Loading…
Reference in New Issue
Block a user