From 015e596eda7e26ea7fc7758b7a5833a96ef37232 Mon Sep 17 00:00:00 2001 From: coolGi2007 Date: Sun, 3 Apr 2022 19:47:29 +0930 Subject: [PATCH] Fixed building --- build.gradle | 29 +++++++++++++++-------------- fabric/build.gradle | 6 ------ forge/build.gradle | 1 + 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/build.gradle b/build.gradle index 3b74df4e5..5f775e872 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ def loadProperties() { println "Loading properties file at " + mcVersion + ".properties" def props = new Properties() props.load(new FileInputStream("$rootProject.rootDir/"+"$mcVersion"+".properties")) - + props.each { prop -> rootProject.ext.set(prop.key, prop.value) // println "Added prop [key:" + prop.key + ", value:" + prop.value + "]" @@ -58,20 +58,13 @@ subprojects { p -> silentMojangMappingsLicense() // Set what accesswidener to use - def acsessWidenerLocation = "src/main/resources/${acsessWidenerVersion}.lod.accesswidener" - accessWidenerPath.set(project(":common").file(acsessWidenerLocation)) + if (p != project(":core")) { + def acsessWidenerLocation = "src/main/resources/${acsessWidenerVersion}.lod.accesswidener" + accessWidenerPath.set(project(":common").file(acsessWidenerLocation)) + } } jar { - // Copy the correct accesswidener to the jar - copy { - from(project(":common").file("src/main/resources")) - include "${acsessWidenerVersion}.lod.accesswidener" - into(file(p.file("build/resources/main"))) - rename "${acsessWidenerVersion}.lod.accesswidener", "lod.accesswidener" -// into(file(p.file("build/resources/main"))) - } - // Requred to run the standalone jar manifest { attributes 'Implementation-Title': rootProject.archives_base_name, @@ -90,7 +83,7 @@ subprojects { p -> minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" // The following line declares the mojmap mappings mappings loom.officialMojangMappings() - + //Manifold annotationProcessor "systems.manifold:manifold-preprocessor:${rootProject.manifold_version}" @@ -124,7 +117,7 @@ allprojects { p -> mavenCentral() // used to download and compile dependencies from git repos maven { url 'https://jitpack.io' } - + // For Manifold Preprocessor maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' } @@ -198,6 +191,14 @@ allprojects { p -> } + // This method copies the access wideners from the common project to the fabric project. And it was generated by Github Copilot + task copyAccessWidener(type: Copy) { + from project(":common").file("src/main/resources/${acsessWidenerVersion}.lod.accesswidener") + into(file(p.file("build/resources/main"))) + rename "${acsessWidenerVersion}.lod.accesswidener", "lod.accesswidener" + } + + tasks.withType(JavaCompile) { // Add Manifold Preprocessor // def excapedMCVersion = rootProject.minecraft_version.replace(".", "_") diff --git a/fabric/build.gradle b/fabric/build.gradle index a51bde9a7..55e7339c7 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -90,12 +90,6 @@ dependencies { shadowMe 'org.apache.commons:commons-compress:1.21' } -// This method copies the access wideners from the common project to the fabric project. And it was generated by Github Copilot -task copyAccessWidener(type: Copy) { - from project(":common").file("src/main/resources/lod.accesswidener") - into file("src/generated/resources") -} - task copyCoreResources(type: Copy) { from fileTree(project(":core").file("src/main/resources")) into file("build/resources/main") diff --git a/forge/build.gradle b/forge/build.gradle index f0bd93927..70fce1944 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -65,6 +65,7 @@ task copyCommonResources(type: Copy) { } processResources { + dependsOn(copyAccessWidener) dependsOn(copyCoreResources) dependsOn(copyCommonResources) }