Download mappings straight from Jenkins, bypassing clouldflare

dev/0.11
modmuss50 2017-05-13 12:07:23 +01:00
parent 3857631498
commit 33ed804006
No known key found for this signature in database
GPG Key ID: 773D17BE8BF49C82
1 changed files with 17 additions and 8 deletions

View File

@ -74,7 +74,12 @@ public class DownloadTask extends DefaultTask {
if (!Constants.MAPPINGS_ZIP.get(extension).exists() && extension.hasPomf()) { if (!Constants.MAPPINGS_ZIP.get(extension).exists() && extension.hasPomf()) {
this.getLogger().lifecycle(":downloading mappings"); this.getLogger().lifecycle(":downloading mappings");
FileUtils.copyURLToFile(new URL("http://jenkins.modmuss50.me/job/FabricMC/job/pomf/job/" + extension.version + "/" + extension.pomfVersion + "/artifact/build/libs/pomf-enigma-" + extension.version + "." + extension.pomfVersion + ".zip"), Constants.MAPPINGS_ZIP.get(extension)); try {
FileUtils.copyURLToFile(new URL("http://modmuss50.me:8080/job/FabricMC/job/pomf/job/" + extension.version + "/" + extension.pomfVersion + "/artifact/build/libs/pomf-enigma-" + extension.version + "." + extension.pomfVersion + ".zip"), Constants.MAPPINGS_ZIP.get(extension));
} catch (Exception e) {
throw new RuntimeException("Failed to download mappings", e);
}
} }
if (!extension.hasPomf()) { if (!extension.hasPomf()) {
if (Constants.MAPPINGS_DIR_LOCAL.get(extension).exists()) { if (Constants.MAPPINGS_DIR_LOCAL.get(extension).exists()) {
@ -97,7 +102,11 @@ public class DownloadTask extends DefaultTask {
if (!Constants.MAPPINGS_TINY.get(extension).exists() && extension.hasPomf()) { if (!Constants.MAPPINGS_TINY.get(extension).exists() && extension.hasPomf()) {
if (!Constants.MAPPINGS_TINY_GZ.get(extension).exists() && !extension.localMappings) { if (!Constants.MAPPINGS_TINY_GZ.get(extension).exists() && !extension.localMappings) {
getLogger().lifecycle(":downloading tiny mappings"); getLogger().lifecycle(":downloading tiny mappings");
FileUtils.copyURLToFile(new URL("http://jenkins.modmuss50.me/job/FabricMC/job/pomf/job/" + extension.version + "/" + extension.pomfVersion + "/artifact/build/libs/pomf-tiny-" + extension.version + "." + extension.pomfVersion + ".gz"), Constants.MAPPINGS_TINY_GZ.get(extension)); try {
FileUtils.copyURLToFile(new URL("http://modmuss50.me:8080/job/FabricMC/job/pomf/job/" + extension.version + "/" + extension.pomfVersion + "/artifact/build/libs/pomf-tiny-" + extension.version + "." + extension.pomfVersion + ".gz"), Constants.MAPPINGS_TINY_GZ.get(extension));
} catch (Exception e) {
throw new RuntimeException("Failed to download mappings", e);
}
} }
GZIPInputStream gzipInputStream = new GZIPInputStream(new FileInputStream(Constants.MAPPINGS_TINY_GZ.get(extension))); GZIPInputStream gzipInputStream = new GZIPInputStream(new FileInputStream(Constants.MAPPINGS_TINY_GZ.get(extension)));
FileOutputStream fileOutputStream = new FileOutputStream(Constants.MAPPINGS_TINY.get(extension)); FileOutputStream fileOutputStream = new FileOutputStream(Constants.MAPPINGS_TINY.get(extension));