diff --git a/build.gradle b/build.gradle index c1c104105..cffa4b222 100755 --- a/build.gradle +++ b/build.gradle @@ -61,6 +61,10 @@ allprojects { apply plugin: "architectury-plugin" repositories { + maven { + name = 'spongepowered-repo' + url = 'https://repo.spongepowered.org/repository/maven-public/' + } maven { name = 'impactdevelopment-repo' url = 'https://impactdevelopment.github.io/maven/' diff --git a/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java b/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java index 5e5dbfc0d..d3acaa6ed 100644 --- a/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java +++ b/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java @@ -53,13 +53,6 @@ public class ProguardTask extends BaritoneGradleTask { return url; } - @Input - private String mixinUrl; - - public String getMixinUrl() { - return mixinUrl; - } - @Input private String extract; @@ -93,7 +86,7 @@ public class ProguardTask extends BaritoneGradleTask { } private File getMcJar() throws IOException { - File mcClientJar = this.getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().findByName("main").getRuntimeClasspath().getFiles() + File mcClientJar = this.getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().findByName("main").getCompileClasspath().getFiles() .stream() .filter(this::isMcJar) .map(f -> { @@ -138,13 +131,6 @@ public class ProguardTask extends BaritoneGradleTask { } } - private void downloadMixin() throws Exception { - Path mixinJar = getTemporaryFile(MIXIN_JAR); - if (!Files.exists(mixinJar)) { - write(new URL(this.mixinUrl).openStream(), mixinJar); - } - } - private String getJavaBinPathForProguard() throws Exception { String path; try { @@ -273,9 +259,6 @@ public class ProguardTask extends BaritoneGradleTask { libraries.forEach(f -> { template.add(2, "-libraryjars '" + f + "'"); }); - - downloadMixin(); - template.add(2, "-libraryjars '" + this.getTemporaryFile(MIXIN_JAR) + "'"); } Files.createDirectories(this.getRootRelativeFile(PROGUARD_MAPPING_DIR)); @@ -294,7 +277,7 @@ public class ProguardTask extends BaritoneGradleTask { } private Stream acquireDependencies() { - return getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().findByName("main").getRuntimeClasspath().getFiles() + return getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().findByName("main").getCompileClasspath().getFiles() .stream() .filter(File::isFile); } @@ -319,10 +302,6 @@ public class ProguardTask extends BaritoneGradleTask { this.url = url; } - public void setMixinUrl(String mixinUrl) { - this.mixinUrl = mixinUrl; - } - public void setExtract(String extract) { this.extract = extract; } diff --git a/common/build.gradle b/common/build.gradle index 7d5bc7b03..5880988e2 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -6,6 +6,7 @@ architectury { common() } +// ignore this jank, it's so I don't have to move the src folder, as that creates unnecessary git conflicts sourceSets { realmain { java { @@ -87,7 +88,10 @@ configurations { dependencies { // We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies // Do NOT use other classes from fabric loader - modImplementation "net.fabricmc:fabric-loader:${project.fabric_version}" + modCompileOnly "net.fabricmc:fabric-loader:${project.fabric_version}" + + // want in the pom but not to compile against as it's also provided by loom + runtimeOnly "org.spongepowered:mixin:0.8.4" // this makes it compile with the forge tweak stuff implementation 'com.github.ImpactDevelopment:SimpleTweaker:1.2' @@ -96,7 +100,7 @@ dependencies { exclude module: 'asm-debug-all' } - implementation 'com.google.code.findbugs:jsr305:3.0.2' + compileOnly 'com.google.code.findbugs:jsr305:3.0.2' testImplementation 'junit:junit:4.12' } @@ -134,7 +138,6 @@ remapJar { task proguard(type: ProguardTask) { url 'https://github.com/Guardsquare/proguard/releases/download/v7.2.1/proguard-7.2.1.zip' - mixinUrl 'https://maven.fabricmc.net/net/fabricmc/sponge-mixin/0.11.3%2Bmixin.0.8.5/sponge-mixin-0.11.3%2Bmixin.0.8.5.jar' extract 'proguard-7.2.1/lib/proguard.jar' compType "OFFICIAL" } @@ -142,3 +145,17 @@ task proguard(type: ProguardTask) { task createDist(type: CreateDistTask, dependsOn: proguard) build.finalizedBy(createDist) + +publishing { + publications { + mavenCommon(MavenPublication) { + artifactId = rootProject.archives_base_name + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + } +} \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 9f7e94d34..170bc7922 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -41,8 +41,8 @@ dependencies { modImplementation "net.fabricmc:fabric-loader:${project.fabric_version}" // this makes it compile with the forge tweak stuff - implementation 'com.github.ImpactDevelopment:SimpleTweaker:1.2' - implementation('net.minecraft:launchwrapper:1.12') { + compileOnly 'com.github.ImpactDevelopment:SimpleTweaker:1.2' + compileOnly('net.minecraft:launchwrapper:1.12') { exclude module: 'lwjgl' exclude module: 'asm-debug-all' } @@ -82,11 +82,24 @@ components.java { task proguard(type: ProguardTask) { url 'https://github.com/Guardsquare/proguard/releases/download/v7.2.1/proguard-7.2.1.zip' - mixinUrl 'https://maven.fabricmc.net/net/fabricmc/sponge-mixin/0.11.3%2Bmixin.0.8.5/sponge-mixin-0.11.3%2Bmixin.0.8.5.jar' extract 'proguard-7.2.1/lib/proguard.jar' compType "FABRIC" } task createDist(type: CreateDistTask, dependsOn: proguard) -build.finalizedBy(createDist) \ No newline at end of file +build.finalizedBy(createDist) + +publishing { + publications { + mavenFabric(MavenPublication) { + artifactId = rootProject.archives_base_name + "-" + project.name + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + } +} \ No newline at end of file diff --git a/src/launch/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json similarity index 100% rename from src/launch/resources/fabric.mod.json rename to fabric/src/main/resources/fabric.mod.json diff --git a/forge/build.gradle b/forge/build.gradle index 2d6dcfd51..0cb039747 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -47,8 +47,8 @@ dependencies { forge "net.minecraftforge:forge:${rootProject.forge_version}" // this makes it compile with the forge tweak stuff - implementation 'com.github.ImpactDevelopment:SimpleTweaker:1.2' - implementation('net.minecraft:launchwrapper:1.12') { + compileOnly 'com.github.ImpactDevelopment:SimpleTweaker:1.2' + compileOnly('net.minecraft:launchwrapper:1.12') { exclude module: 'lwjgl' exclude module: 'asm-debug-all' } @@ -100,7 +100,6 @@ components.java { task proguard(type: ProguardTask) { url 'https://github.com/Guardsquare/proguard/releases/download/v7.2.1/proguard-7.2.1.zip' - mixinUrl 'https://maven.fabricmc.net/net/fabricmc/sponge-mixin/0.11.3%2Bmixin.0.8.5/sponge-mixin-0.11.3%2Bmixin.0.8.5.jar' extract 'proguard-7.2.1/lib/proguard.jar' compType "FORGE" } @@ -108,4 +107,18 @@ task proguard(type: ProguardTask) { task createDist(type: CreateDistTask, dependsOn: proguard) -build.finalizedBy(createDist) \ No newline at end of file +build.finalizedBy(createDist) + +publishing { + publications { + mavenFabric(MavenPublication) { + artifactId = rootProject.archives_base_name + "-" + project.name + from components.java + } + } + + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. + repositories { + // Add repositories to publish to here. + } +} \ No newline at end of file