diff options
Diffstat (limited to 'build.gradle.kts')
-rw-r--r-- | build.gradle.kts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index bffe9f6d..409a8d51 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -22,6 +22,8 @@ import net.fabricmc.loom.task.RemapJarTask import java.io.ByteArrayOutputStream import java.nio.file.FileSystems import java.nio.file.Files +import java.nio.charset.StandardCharsets +import java.util.* plugins { idea @@ -173,7 +175,22 @@ tasks.shadowJar { tasks.assemble.get().dependsOn(remapJar) +val generateBuildFlags by tasks.creating { + outputs.upToDateWhen { false } + val t = layout.buildDirectory.file("buildflags.properties") + outputs.file(t) + val props = project.properties.filter { (name, value) -> name.startsWith("neu.buildflags.") } + doLast { + val p = Properties() + p.putAll(props) + t.get().asFile.writer(StandardCharsets.UTF_8).use { + p.store(it, "Store build time configuration for NEU") + } + } +} + tasks.processResources { + from(generateBuildFlags) filesMatching("mcmod.info") { expand( "version" to project.version, "mcversion" to "1.8.9" |