[CI-SKIP] Fix Paperclip building on windows (#381)

* Fix Paperclip building on windows

Fixes https://github.com/YatopiaMC/Yatopia/issues/348

* Toothpick Updates

figured I'd just tack this on here

Co-authored-by: Zoe <duplexsys@protonmail.com>
This commit is contained in:
ishland 2021-02-03 08:02:10 +08:00 committed by GitHub
parent 021f928c4d
commit da1e376b10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 7 deletions

View File

@ -1,15 +1,18 @@
import org.gradle.api.Project
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.api.tasks.testing.Test
import org.gradle.kotlin.dsl.withType
import task.*
@Suppress("UNUSED_VARIABLE")
internal fun Project.initToothpickTasks() {
if (project.hasProperty("fast")) {
gradle.taskGraph.whenReady {
gradle.taskGraph.allTasks.filter {
it.name.contains("test", ignoreCase = true) || it.name.contains("javadoc", ignoreCase = true)
}.forEach {
it.onlyIf { false }
}
gradle.taskGraph.whenReady {
val fast = project.hasProperty("fast")
tasks.withType<Test> {
onlyIf { !fast }
}
tasks.withType<Javadoc> {
onlyIf { !fast || gradle.taskGraph.allTasks.any { it.name.contains("publish", ignoreCase = true) } }
}
}

View File

@ -27,6 +27,7 @@ internal fun Project.createPaperclipTask(
"-Dpaperjar=$patchedJarPath",
"-Dvanillajar=$vanillaJarPath"
)
if (System.getProperty("os.name").startsWith("Windows")) paperclipCmd[0] = "mvn.cmd"
if (jenkins) paperclipCmd.add("-Dstyle.color=never")
ensureSuccess(cmd(*paperclipCmd.toTypedArray(), dir = paperclipDir, printOut = true))
val paperClip = paperclipDir.resolve("assembly/target/paperclip-${toothpick.minecraftVersion}.jar")