diff --git a/.gitignore b/.gitignore index 57e68c0..9023533 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,5 @@ !/HEADER !/LICENSE !/README.md -!/settings.gradle \ No newline at end of file +!/settings.gradle +!/Jenkinsfile \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..963bbb2 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,15 @@ +node { + stage 'Checkout' + + checkout scm + + stage 'Build' + + sh "rm -rf build/libs/" + sh "chmod +x gradlew" + sh "./gradlew build" + + stage "Archive artifacts" + + sh "./gradlew upload" +} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 7a021b6..fc362ed 100644 --- a/build.gradle +++ b/build.gradle @@ -5,16 +5,17 @@ plugins { id 'idea' id 'eclipse' - - id 'net.minecrell.licenser' version '0.2.1' } sourceCompatibility = 1.8 targetCompatibility = 1.8 +apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/maven.gradle' +apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/license.gradle' + group = 'net.fabricmc' archivesBaseName = project.name.toLowerCase() -version = '0.0.2-SNAPSHOT' +version = '0.0.3-SNAPSHOT' repositories { mavenCentral() @@ -40,22 +41,15 @@ configurations { dependencies { compile gradleApi() - shade 'org.zeroturnaround:zt-zip:1.9' - shade 'org.slf4j:slf4j-api:1.7.21' - shade 'org.slf4j:slf4j-simple:1.7.21' - shade 'com.google.code.gson:gson:2.6.2' - shade 'commons-io:commons-io:1.4' - shade 'com.google.guava:guava:19.0' - shade 'net.fabricmc:blending-jar:0.1.1.6' - shade 'net.fabricmc:enigma:+' - shade 'org.javassist:javassist:3.+' - shade 'org.bitbucket.mstrobel:procyon-compilertools:0.5.33.6-enigma' - shade 'de.sciss:syntaxpane:1.1.+' -} -license { - header file('HEADER') - include '**/*.java' + shade 'org.zeroturnaround:zt-zip:1.9' + shade 'org.slf4j:slf4j-api:1.7.21' + shade 'org.slf4j:slf4j-simple:1.7.21' + shade 'com.google.code.gson:gson:2.6.2' + shade 'commons-io:commons-io:1.4' + shade 'com.google.guava:guava:19.0' + shade 'net.fabricmc:weave:0.1.0.6' + shade 'cuchaz:enigma:0.11.0.5:lib' } sourceSets { @@ -73,58 +67,7 @@ jar { } } -uploadArchives { - repositories { - mavenDeployer { - if (project.hasProperty('mavenPass')) { - repository(url: 'http://mavenupload.modmuss50.me/') { - authentication(userName: 'buildslave', password: project.getProperty('mavenPass')) - } - } else { - repository(url: 'file:///var/www/maven/') - } - - pom { - artifactId = project.archivesBaseName - - project { - name = project.name - description = project.description - packaging = 'jar' - url = project.url - - scm { - url = 'https://github.com/FabricMC/fabric-loom' - connection = 'scm:git:git@github.com:FabricMC/fabric-loom.git' - developerConnection = 'scm:git:git@github.com:FabricMC/fabric-loom.git' - } - - issueManagement { - system = 'GitHub' - url = 'https://github.com/FabricMC/fabric-loom/issues' - } - - licenses { - license { - name = 'MIT License' - url = 'https://github.com/FabricMC/fabric-loom/blob/master/LICENSE' - distribution = 'repo' - } - } - - developers { - developer { - id = 'modmuss50' - name = 'modmuss50' - roles { role 'developer' } - } - } - } - } - } - } -} task wrapper(type: Wrapper) { - gradleVersion = '3.0' + gradleVersion = '3.1' } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 3baa851..deedc7f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7e88482..63d119f 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sat Sep 10 13:02:22 BST 2016 +#Thu Sep 22 09:58:14 BST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.0-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.1-bin.zip diff --git a/gradlew b/gradlew index 27309d9..9aa616c 100755 --- a/gradlew +++ b/gradlew @@ -161,4 +161,9 @@ function splitJvmOpts() { eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong +if [[ "$(uname)" == "Darwin" ]] && [[ "$HOME" == "$PWD" ]]; then + cd "$(dirname "$0")" +fi + exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/gradlew.bat b/gradlew.bat index 832fdb6..f955316 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -49,7 +49,6 @@ goto fail @rem Get command-line arguments, handling Windows variants if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args :win9xME_args @rem Slurp the command line arguments. @@ -60,11 +59,6 @@ set _SKIP=2 if "x%~1" == "x" goto execute set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ :execute @rem Setup the command line diff --git a/src/main/java/net/fabricmc/loom/task/DownloadTask.java b/src/main/java/net/fabricmc/loom/task/DownloadTask.java index 79631c8..c2043a4 100644 --- a/src/main/java/net/fabricmc/loom/task/DownloadTask.java +++ b/src/main/java/net/fabricmc/loom/task/DownloadTask.java @@ -147,7 +147,7 @@ public class DownloadTask extends DefaultTask { if (!Constants.MINECRAFT_JSON.get(extension).exists()) { logger.lifecycle(":downloading minecraft json"); FileUtils.copyURLToFile(new URL("https://launchermeta.mojang.com/mc/game/version_manifest.json"), Constants.VERSION_MANIFEST.get(extension)); - ManifestVersion mcManifest = new GsonBuilder().create().fromJson(FileUtils.readFileToString(Constants.VERSION_MANIFEST.get(extension), Charset.defaultCharset()), ManifestVersion.class); + ManifestVersion mcManifest = new GsonBuilder().create().fromJson(FileUtils.readFileToString(Constants.VERSION_MANIFEST.get(extension), "UTF-8"), ManifestVersion.class); Optional optionalVersion = mcManifest.versions.stream().filter(versions -> versions.id.equalsIgnoreCase(extension.version)).findFirst(); if (optionalVersion.isPresent()) { diff --git a/src/main/java/net/fabricmc/loom/task/GenVSCodeProjectTask.java b/src/main/java/net/fabricmc/loom/task/GenVSCodeProjectTask.java index e05199b..37df9e2 100644 --- a/src/main/java/net/fabricmc/loom/task/GenVSCodeProjectTask.java +++ b/src/main/java/net/fabricmc/loom/task/GenVSCodeProjectTask.java @@ -77,7 +77,7 @@ public class GenVSCodeProjectTask extends DefaultTask { element = new JsonPrimitive("vscode"); jsonObject.add("outputDirectory", element); - FileUtils.write(configFile, gson.toJson(jsonObject), Charset.defaultCharset()); + FileUtils.writeStringToFile(configFile, gson.toJson(jsonObject), "UF-8"); } } diff --git a/src/main/java/net/fabricmc/loom/task/MergeJarsTask.java b/src/main/java/net/fabricmc/loom/task/MergeJarsTask.java index a71d3b0..6d6b5b5 100644 --- a/src/main/java/net/fabricmc/loom/task/MergeJarsTask.java +++ b/src/main/java/net/fabricmc/loom/task/MergeJarsTask.java @@ -24,9 +24,9 @@ package net.fabricmc.loom.task; -import net.fabricmc.blendingjar.JarMerger; import net.fabricmc.loom.LoomGradleExtension; import net.fabricmc.loom.util.Constants; +import net.fabricmc.weave.merge.JarMerger; import org.gradle.api.DefaultTask; import org.gradle.api.tasks.TaskAction;