diff --git a/build.gradle.kts b/build.gradle.kts index 589897799..829ac2b64 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -62,22 +62,16 @@ dependencies { val compileJava: JavaCompile by tasks val mainSourceSet: SourceSet = sourceSets["main"] -val tokenizeJavaSources = task(name = "tokenizeJavaSources") { - from(mainSourceSet.allSource) { - include("**/plugin.yml") - println("version: $versionObj") - val tokens = mapOf("VERSION" to versionObj.toString()) - - filter(org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to tokens) - } - into("build/tokenizedSources") - includeEmptyDirs = false +tasks.withType { + include("*.yml") + filter( + "tokens" to mapOf( + "VERSION" to project.version.toString() + ) + ) } - compileJava.apply { - dependsOn(tokenizeJavaSources) - options.encoding = "UTF-8" doFirst { options.compilerArgs = mutableListOf("-Xlint:all") @@ -94,7 +88,8 @@ tasks.test { } tasks.named("shadowJar") { - from(tokenizeJavaSources.destinationDir) + // Tell shadow to download the packs + dependsOn(downloadDefaultPacks) archiveClassifier.set("") archiveBaseName.set("Terra") @@ -164,7 +159,6 @@ val downloadDefaultPacks = tasks.create("downloadDefaultPacks") { downloadPack(netherPackUrl) } } -tasks.processResources.get().dependsOn(downloadDefaultPacks) val testWithPaper = task(name = "testWithPaper") { standardInput = System.`in`