From 4d73c3ecb89df49b8b8b1725286214d2d011b275 Mon Sep 17 00:00:00 2001 From: coolGi Date: Sun, 18 Feb 2024 21:09:00 +1030 Subject: [PATCH] Moved common to Unimined --- build.gradle | 17 +++++++++-------- common/build.gradle | 40 ++++++++++++---------------------------- 2 files changed, 21 insertions(+), 36 deletions(-) diff --git a/build.gradle b/build.gradle index c2a3a898b..56f3e0443 100644 --- a/build.gradle +++ b/build.gradle @@ -91,7 +91,7 @@ forgix { } subprojects { p -> - // Does the same as "p == project(":common") || p == project(":fabric") || p == project(":quilt") || p == project(":forge") || p == project("WhateverLoaderWeAddLaterOn")" + // Does the same as "p == project(":common") || p == project(":fabric") || p == project(":forge") || p == project("WhateverLoaderWeAddLaterOn")" // Useful later on so we dont have duplicated code def isMinecraftSubProject = p != project(":core") && p != project(":api") @@ -99,11 +99,10 @@ subprojects { p -> // Apply plugins apply plugin: "java" apply plugin: "com.github.johnrengelman.shadow" - if (p == project(":core")) { + if (p == project(":core")) apply plugin: "application" - } - if (p != project(":common") && isMinecraftSubProject) { + if (isMinecraftSubProject) { apply plugin: "xyz.wagyourtail.unimined" unimined.minecraft(sourceSets.main, true) { @@ -117,10 +116,12 @@ subprojects { p -> } } - tasks.withType(JavaCompile).configureEach { - source(project(":common").sourceSets.main.java) - source(project(":api").sourceSets.main.java) - source(project(":core").sourceSets.main.java) + if (p != project(":common")) { + tasks.withType(JavaCompile).configureEach { + source(project(":common").sourceSets.main.java) + source(project(":api").sourceSets.main.java) + source(project(":core").sourceSets.main.java) + } } } diff --git a/common/build.gradle b/common/build.gradle index b61221fda..d4bf54ebe 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -1,32 +1,16 @@ -plugins { - id "org.spongepowered.gradle.vanilla" version "0.2.1-SNAPSHOT" -} +// Use Unimined's implimentation for MC as we can use Parchment mappings in common now! :tada: +// With Sponge's vanilla gradle, we cannot change the mappings to anything out of mojmaps +unimined.minecraft { + fabric { // TODO: Find a way to only include the mc stuff, not fabric's loader + loader rootProject.fabric_loader_version + accessWidener(project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener")) -minecraft { - accessWideners(project(":common").file("src/main/resources/${accessWidenerVersion}.distanthorizons.accesswidener")) - version(rootProject.minecraft_version) + skipInsertAw = true + } + + defaultRemapJar = false } 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:${rootProject.fabric_loader_version}" - - // So mixins can be written in common - compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5' -} - - -publishing { - publications { - mavenCommon(MavenPublication) { - artifactId = rootProject.mod_readable_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