mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-19 07:11:14 +00:00
Implemented alternative ProcessResources (#36)
This commit is contained in:
+9
-15
@@ -62,22 +62,16 @@ dependencies {
|
|||||||
val compileJava: JavaCompile by tasks
|
val compileJava: JavaCompile by tasks
|
||||||
val mainSourceSet: SourceSet = sourceSets["main"]
|
val mainSourceSet: SourceSet = sourceSets["main"]
|
||||||
|
|
||||||
val tokenizeJavaSources = task<Copy>(name = "tokenizeJavaSources") {
|
tasks.withType<ProcessResources> {
|
||||||
from(mainSourceSet.allSource) {
|
include("*.yml")
|
||||||
include("**/plugin.yml")
|
filter<org.apache.tools.ant.filters.ReplaceTokens>(
|
||||||
println("version: $versionObj")
|
"tokens" to mapOf(
|
||||||
val tokens = mapOf("VERSION" to versionObj.toString())
|
"VERSION" to project.version.toString()
|
||||||
|
)
|
||||||
filter(org.apache.tools.ant.filters.ReplaceTokens::class, "tokens" to tokens)
|
)
|
||||||
}
|
}
|
||||||
into("build/tokenizedSources")
|
|
||||||
includeEmptyDirs = false
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
compileJava.apply {
|
compileJava.apply {
|
||||||
dependsOn(tokenizeJavaSources)
|
|
||||||
|
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
doFirst {
|
doFirst {
|
||||||
options.compilerArgs = mutableListOf("-Xlint:all")
|
options.compilerArgs = mutableListOf("-Xlint:all")
|
||||||
@@ -94,7 +88,8 @@ tasks.test {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.named<ShadowJar>("shadowJar") {
|
tasks.named<ShadowJar>("shadowJar") {
|
||||||
from(tokenizeJavaSources.destinationDir)
|
// Tell shadow to download the packs
|
||||||
|
dependsOn(downloadDefaultPacks)
|
||||||
|
|
||||||
archiveClassifier.set("")
|
archiveClassifier.set("")
|
||||||
archiveBaseName.set("Terra")
|
archiveBaseName.set("Terra")
|
||||||
@@ -164,7 +159,6 @@ val downloadDefaultPacks = tasks.create("downloadDefaultPacks") {
|
|||||||
downloadPack(netherPackUrl)
|
downloadPack(netherPackUrl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tasks.processResources.get().dependsOn(downloadDefaultPacks)
|
|
||||||
|
|
||||||
val testWithPaper = task<JavaExec>(name = "testWithPaper") {
|
val testWithPaper = task<JavaExec>(name = "testWithPaper") {
|
||||||
standardInput = System.`in`
|
standardInput = System.`in`
|
||||||
|
|||||||
Reference in New Issue
Block a user