Rename things
parent
451adbeeb6
commit
d358f461fe
27
build.gradle
27
build.gradle
|
@ -4,7 +4,7 @@ apply plugin: 'maven'
|
|||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'idea'
|
||||
|
||||
group = 'chorusmc.gradle'
|
||||
group = 'net.fabric.gradle'
|
||||
version = '0.0.1'
|
||||
sourceCompatibility = targetCompatibility = '1.8'
|
||||
|
||||
|
@ -14,12 +14,9 @@ if (System.getenv().BUILD_NUMBER) {
|
|||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
maven {
|
||||
name = "Modmuss50"
|
||||
url = "http://maven.modmuss50.me/"
|
||||
name = "Fabric"
|
||||
url = "https://maven.fabricmc.net/"
|
||||
}
|
||||
maven {
|
||||
name "Cuchaz"
|
||||
|
@ -42,7 +39,7 @@ dependencies {
|
|||
shade 'commons-io:commons-io:1.4'
|
||||
shade 'com.google.guava:guava:19.0'
|
||||
|
||||
shade 'chorusmc:enigma:0.11.+'
|
||||
shade 'net.fabricmc:enigma:0.11.+'
|
||||
shade 'org.javassist:javassist:3.+'
|
||||
shade 'org.bitbucket.mstrobel:procyon-decompiler:0.5.28-enigma'
|
||||
shade 'org.javassist:javassist:3.20.0-GA'
|
||||
|
@ -76,27 +73,27 @@ uploadArchives {
|
|||
repository(url: "file:///var/www/maven/")
|
||||
}
|
||||
pom {
|
||||
groupId = "chorusmc"
|
||||
groupId = "net.fabricmc"
|
||||
version = project.version
|
||||
artifactId = project.archivesBaseName
|
||||
project {
|
||||
name project.archivesBaseName
|
||||
packaging 'jar'
|
||||
description 'chorus-gradle'
|
||||
url 'https://github.com/ChorusMC/chorus-gradle'
|
||||
description 'fabric-loom'
|
||||
url 'https://github.com/FabricMC/fabric-loom'
|
||||
scm {
|
||||
url 'https://github.com/ChorusMC/chorus-gradle'
|
||||
connection 'scm:git:git@github.com:ChorusMC/chorus-gradle.git'
|
||||
developerConnection 'scm:git:git@github.com:ChorusMC/chorus-gradle.git'
|
||||
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/ChorusMC/chorus-gradle/issues'
|
||||
url 'https://github.com/FabricMC/fabric-loom/issues'
|
||||
}
|
||||
licenses {
|
||||
license {
|
||||
name 'License'
|
||||
url 'https://github.com/ChorusMC/chorus-gradle/blob/master/readme.txt'
|
||||
url 'https://github.com/FabricMC/fabric-loom/blob/master/readme.txt'
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
rootProject.name = 'ChorusGradle'
|
||||
rootProject.name = 'fabric-loom'
|
||||
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
package chorusmc.gradle.util.delayed;
|
||||
|
||||
import chorusmc.gradle.ChorusGradleExtension;
|
||||
|
||||
public interface IDelayed<T> {
|
||||
T get(ChorusGradleExtension extension);
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
package chorusmc.gradle;
|
||||
package net.fabric.loom;
|
||||
|
||||
import chorusmc.gradle.util.Constants;
|
||||
import net.fabric.loom.util.Constants;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import org.gradle.api.Plugin;
|
||||
import org.gradle.api.Project;
|
||||
|
@ -25,7 +25,7 @@ public class AbstractPlugin implements Plugin<Project> {
|
|||
project.apply(ImmutableMap.of("plugin", "eclipse"));
|
||||
project.apply(ImmutableMap.of("plugin", "idea"));
|
||||
|
||||
project.getExtensions().create("minecraft", ChorusGradleExtension.class);
|
||||
project.getExtensions().create("minecraft", LoomGradleExtension.class);
|
||||
|
||||
// Force add Mojang repository
|
||||
addMavenRepo(target, "Mojang", "https://libraries.minecraft.net/");
|
|
@ -1,6 +1,6 @@
|
|||
package chorusmc.gradle;
|
||||
package net.fabric.loom;
|
||||
|
||||
public class ChorusGradleExtension {
|
||||
public class LoomGradleExtension {
|
||||
public String version;
|
||||
public String runDir = "run";
|
||||
}
|
|
@ -1,17 +1,20 @@
|
|||
package chorusmc.gradle;
|
||||
package net.fabric.loom;
|
||||
|
||||
import chorusmc.gradle.task.*;
|
||||
import net.fabric.loom.task.DownloadTask;
|
||||
import net.fabric.loom.task.ExtractNativesTask;
|
||||
import net.fabric.loom.task.GenIdeaProjectTask;
|
||||
import net.fabric.loom.task.MapJarsTask;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.Project;
|
||||
|
||||
public class ChorusGradlePlugin extends AbstractPlugin {
|
||||
public class LoomGradlePlugin extends AbstractPlugin {
|
||||
@Override
|
||||
public void apply(Project target) {
|
||||
super.apply(target);
|
||||
|
||||
makeTask("download", DownloadTask.class);
|
||||
makeTask("mapJars", MapJarsTask.class).dependsOn("download");
|
||||
makeTask("setupChorus", DefaultTask.class).dependsOn("mapJars");
|
||||
makeTask("setupFabric", DefaultTask.class).dependsOn("mapJars");
|
||||
|
||||
makeTask("extractNatives", ExtractNativesTask.class).dependsOn("download");
|
||||
makeTask("genIdeaRuns", GenIdeaProjectTask.class).dependsOn("cleanIdea").dependsOn("idea").dependsOn("extractNatives");
|
|
@ -1,11 +1,11 @@
|
|||
package chorusmc.gradle.task;
|
||||
package net.fabric.loom.task;
|
||||
|
||||
import chorusmc.gradle.util.Constants;
|
||||
import net.fabric.loom.util.Constants;
|
||||
import net.fabric.loom.util.progress.ProgressLogger;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.tasks.Input;
|
||||
import org.gradle.api.tasks.OutputFile;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
import chorusmc.gradle.util.progress.ProgressLogger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
|
@ -1,7 +1,7 @@
|
|||
package chorusmc.gradle.task;
|
||||
package net.fabric.loom.task;
|
||||
|
||||
import chorusmc.gradle.util.Constants;
|
||||
import chorusmc.gradle.util.Version;
|
||||
import net.fabric.loom.util.Constants;
|
||||
import net.fabric.loom.util.Version;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
|
@ -9,12 +9,12 @@ import org.gradle.api.DefaultTask;
|
|||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.artifacts.dsl.DependencyHandler;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
import chorusmc.gradle.ChorusGradleExtension;
|
||||
import chorusmc.gradle.util.Checksum;
|
||||
import chorusmc.gradle.util.ManifestVersion;
|
||||
import chorusmc.gradle.util.assets.AssetIndex;
|
||||
import chorusmc.gradle.util.assets.AssetObject;
|
||||
import chorusmc.gradle.util.progress.ProgressLogger;
|
||||
import net.fabric.loom.LoomGradleExtension;
|
||||
import net.fabric.loom.util.Checksum;
|
||||
import net.fabric.loom.util.ManifestVersion;
|
||||
import net.fabric.loom.util.assets.AssetIndex;
|
||||
import net.fabric.loom.util.assets.AssetObject;
|
||||
import net.fabric.loom.util.progress.ProgressLogger;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
|
@ -27,7 +27,7 @@ public class DownloadTask extends DefaultTask {
|
|||
@TaskAction
|
||||
public void download() {
|
||||
try {
|
||||
ChorusGradleExtension extension = this.getProject().getExtensions().getByType(ChorusGradleExtension.class);
|
||||
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
|
||||
|
||||
if (!Constants.MINECRAFT_JSON.get(extension).exists()) {
|
||||
this.getLogger().lifecycle(":downloading minecraft json");
|
||||
|
@ -56,7 +56,7 @@ public class DownloadTask extends DefaultTask {
|
|||
}
|
||||
|
||||
this.getLogger().lifecycle(":downloading mappings");
|
||||
FileUtils.copyURLToFile(new URL("https://github.com/ChorusMC/pomf/archive/master.zip"), Constants.MAPPINGS_ZIP);
|
||||
FileUtils.copyURLToFile(new URL("https://github.com/FabricMC/pomf/archive/master.zip"), Constants.MAPPINGS_ZIP);
|
||||
|
||||
DependencyHandler dependencyHandler = getProject().getDependencies();
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package chorusmc.gradle.task;
|
||||
package net.fabric.loom.task;
|
||||
|
||||
import net.fabric.loom.util.Constants;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
import org.zeroturnaround.zip.ZipUtil;
|
||||
import chorusmc.gradle.util.Constants;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
|
@ -1,9 +1,9 @@
|
|||
package chorusmc.gradle.task;
|
||||
package net.fabric.loom.task;
|
||||
|
||||
import chorusmc.gradle.ChorusGradleExtension;
|
||||
import chorusmc.gradle.util.Constants;
|
||||
import chorusmc.gradle.util.IdeaRunConfig;
|
||||
import chorusmc.gradle.util.Version;
|
||||
import net.fabric.loom.LoomGradleExtension;
|
||||
import net.fabric.loom.util.Constants;
|
||||
import net.fabric.loom.util.IdeaRunConfig;
|
||||
import net.fabric.loom.util.Version;
|
||||
import com.google.gson.Gson;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
|
@ -29,7 +29,7 @@ import java.io.IOException;
|
|||
public class GenIdeaProjectTask extends DefaultTask {
|
||||
@TaskAction
|
||||
public void genIdeaRuns() throws IOException, ParserConfigurationException, SAXException, TransformerException {
|
||||
ChorusGradleExtension extension = this.getProject().getExtensions().getByType(ChorusGradleExtension.class);
|
||||
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
|
||||
|
||||
File file = new File(getProject().getName() + ".iml");
|
||||
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
|
||||
|
@ -143,7 +143,7 @@ public class GenIdeaProjectTask extends DefaultTask {
|
|||
}
|
||||
|
||||
IdeaRunConfig ideaClient = new IdeaRunConfig();
|
||||
ideaClient.mainClass = "chorusmc.base.launch.ChorusClientMain";
|
||||
ideaClient.mainClass = "net.fabricmc.base.launch.FabricClientMain ";
|
||||
ideaClient.projectName = getProject().getName();
|
||||
ideaClient.configName = "Minecraft Client";
|
||||
ideaClient.runDir = "file://$PROJECT_DIR$/" + extension.runDir;
|
|
@ -1,16 +1,13 @@
|
|||
package chorusmc.gradle.task;
|
||||
package net.fabric.loom.task;
|
||||
|
||||
import cuchaz.enigma.Deobfuscator;
|
||||
import cuchaz.enigma.mapping.MappingsEnigmaReader;
|
||||
import cuchaz.enigma.throwables.MappingParseException;
|
||||
import groovy.lang.Closure;
|
||||
import net.fabric.loom.LoomGradleExtension;
|
||||
import net.fabric.loom.util.Constants;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.gradle.api.DefaultTask;
|
||||
import org.gradle.api.tasks.TaskAction;
|
||||
import org.gradle.process.ExecResult;
|
||||
import org.gradle.process.JavaExecSpec;
|
||||
import chorusmc.gradle.ChorusGradleExtension;
|
||||
import chorusmc.gradle.util.Constants;
|
||||
import org.zeroturnaround.zip.ZipUtil;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -23,7 +20,7 @@ public class MapJarsTask extends DefaultTask {
|
|||
|
||||
@TaskAction
|
||||
public void mapJars() throws IOException, MappingParseException {
|
||||
ChorusGradleExtension extension = this.getProject().getExtensions().getByType(ChorusGradleExtension.class);
|
||||
LoomGradleExtension extension = this.getProject().getExtensions().getByType(LoomGradleExtension.class);
|
||||
if(Constants.MINECRAFT_CLIENT_MAPPED_JAR.get(extension).exists()){
|
||||
Constants.MINECRAFT_CLIENT_MAPPED_JAR.get(extension).delete();
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util;
|
||||
package net.fabric.loom.util;
|
||||
|
||||
import com.google.common.hash.HashCode;
|
||||
import com.google.common.hash.Hashing;
|
|
@ -1,7 +1,7 @@
|
|||
package chorusmc.gradle.util;
|
||||
package net.fabric.loom.util;
|
||||
|
||||
import chorusmc.gradle.util.delayed.IDelayed;
|
||||
import chorusmc.gradle.util.delayed.DelayedFile;
|
||||
import net.fabric.loom.util.delayed.IDelayed;
|
||||
import net.fabric.loom.util.delayed.DelayedFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URL;
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util;
|
||||
package net.fabric.loom.util;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import com.google.common.collect.ImmutableMap;
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util;
|
||||
package net.fabric.loom.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util;
|
||||
package net.fabric.loom.util;
|
||||
|
||||
public class OperatingSystem {
|
||||
public static String getOS() {
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util;
|
||||
package net.fabric.loom.util;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util.assets;
|
||||
package net.fabric.loom.util.assets;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util.assets;
|
||||
package net.fabric.loom.util.assets;
|
||||
|
||||
public class AssetObject {
|
||||
private String hash;
|
|
@ -1,20 +1,20 @@
|
|||
package chorusmc.gradle.util.delayed;
|
||||
package net.fabric.loom.util.delayed;
|
||||
|
||||
import chorusmc.gradle.ChorusGradleExtension;
|
||||
import net.fabric.loom.LoomGradleExtension;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.function.Function;
|
||||
|
||||
public class DelayedFile implements IDelayed<File> {
|
||||
private File file;
|
||||
private Function<ChorusGradleExtension, File> function;
|
||||
private Function<LoomGradleExtension, File> function;
|
||||
|
||||
public DelayedFile(Function<ChorusGradleExtension, File> function) {
|
||||
public DelayedFile(Function<LoomGradleExtension, File> function) {
|
||||
this.function = function;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File get(ChorusGradleExtension extension) {
|
||||
public File get(LoomGradleExtension extension) {
|
||||
if (this.file == null) {
|
||||
this.file = this.function.apply(extension);
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package net.fabric.loom.util.delayed;
|
||||
|
||||
import net.fabric.loom.LoomGradleExtension;
|
||||
|
||||
public interface IDelayed<T> {
|
||||
T get(LoomGradleExtension extension);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package chorusmc.gradle.util.progress;
|
||||
package net.fabric.loom.util.progress;
|
||||
|
||||
import org.gradle.api.Project;
|
||||
|
|
@ -1 +1 @@
|
|||
implementation-class=chorusmc.gradle.ChorusGradlePlugin
|
||||
implementation-class=net.fabric.loom.LoomGradlePlugin
|
Loading…
Reference in New Issue