Revert "update logic to find maven"

This reverts commit cfffd9d050.
This commit is contained in:
Simon Gardling 2021-04-08 13:19:53 -04:00
parent 536f09e69f
commit a56fe2b4cc
2 changed files with 2 additions and 11 deletions

View File

@ -90,14 +90,4 @@ open class ToothpickExtension(objects: ObjectFactory) {
}
return upstreamArray.stream().sorted { upstream1, upstream2 -> upstream1.id - upstream2.id}.collect(Collectors.toList())
}
internal val mavenCommand: String by lazy {
if (exitsSuccessfully("mvn", "-v")) {
return@lazy "mvn"
}
if (exitsSuccessfully("mvn.cmd", "-v")) {
return@lazy "mvn.cmd"
}
error("Unable to locate maven. Please ensure you have maven installed and on your path.")
}
}

View File

@ -22,11 +22,12 @@ internal fun Project.createPaperclipTask(
val patchedJarPath = inputs.files.singleFile.absolutePath
logger.lifecycle(">>> Building paperclip")
val paperclipCmd = arrayListOf(
toothpick.mavenCommand, "-T", "2C", "clean", "package",
"mvn", "-T", "2C", "clean", "package",
"-Dmcver=${toothpick.minecraftVersion}",
"-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")