From 39de89cf0d5941fd66f728ff52be479e06817a19 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sat, 2 Mar 2024 02:28:35 +0200 Subject: [PATCH] fromCommon showcase --- build.gradle | 2 +- fabric/build.gradle | 33 ++++++++------------------------- settings.gradle | 1 + testmod-fabric/build.gradle | 12 ++---------- 4 files changed, 12 insertions(+), 36 deletions(-) diff --git a/build.gradle b/build.gradle index 6808ab15a..4d990ad67 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } plugins { - id "architectury-plugin" version "3.4-SNAPSHOT" + id "architectury-plugin" version "4.0.9999" id "dev.architectury.loom" version "1.1-SNAPSHOT" apply false id "org.cadixdev.licenser" version "0.6.1" id "io.github.juuxel.loom-quiltflower" version "1.8.0" apply false diff --git a/fabric/build.gradle b/fabric/build.gradle index bb31ec210..f8d4a0e1e 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,5 +1,4 @@ plugins { - id "com.github.johnrengelman.shadow" version "7.1.2" id "me.shedaniel.unified-publishing" } @@ -10,14 +9,18 @@ loom { architectury { platformSetupLoomIde() fabric() + fromCommon(':common') { + bundle { + configure { + exclude "architectury-common.accessWidener" + exclude "architectury.common.json" + } + } + } } configurations { common - shadowCommon // Don't use shadow from the shadow plugin because we don't want IDEA to index this. - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common } repositories { @@ -28,9 +31,6 @@ dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" modCompileOnly("com.terraformersmc:modmenu:${rootProject.mod_menu_version}") { transitive false } - - common(project(path: ":common", configuration: "namedElements")) { transitive false } - shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } } processResources { @@ -40,19 +40,8 @@ processResources { inputs.property "version", project.version } -shadowJar { - exclude "architectury-common.accessWidener" - exclude "architectury.common.json" - - configurations = [project.configurations.shadowCommon] - archiveClassifier = "dev-shadow" -} - remapJar { injectAccessWidener = true - input.set shadowJar.archiveFile - dependsOn shadowJar - archiveClassifier = null } task renameJarForPublication(type: Zip, dependsOn: remapJar) { @@ -81,12 +70,6 @@ sourcesJar { } } -components.java { - withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) { - skip() - } -} - publishing { publications { mavenFabric(MavenPublication) { diff --git a/settings.gradle b/settings.gradle index 8bfde8127..a1811f2dd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,6 +4,7 @@ pluginManagement { maven { url "https://maven.architectury.dev/" } maven { url "https://files.minecraftforge.net/maven/" } gradlePluginPortal() + mavenLocal() } } diff --git a/testmod-fabric/build.gradle b/testmod-fabric/build.gradle index a298fd9dd..e279075de 100644 --- a/testmod-fabric/build.gradle +++ b/testmod-fabric/build.gradle @@ -1,5 +1,4 @@ plugins { - id "com.github.johnrengelman.shadow" version "7.0.0" id "com.matthewprenger.cursegradle" } @@ -12,13 +11,8 @@ loom { architectury { platformSetupLoomIde() fabric() -} - -configurations { - common - compileClasspath.extendsFrom common - runtimeClasspath.extendsFrom common - developmentFabric.extendsFrom common + fromCommon(':common') { bundle { enabled = false } } + fromCommon(':testmod-common') { bundle { enabled = false } } } dependencies { @@ -26,6 +20,4 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}" implementation project(path: ":fabric", configuration: "namedElements") - common(project(path: ":common", configuration: "namedElements")) { transitive false } - common(project(path: ":testmod-common", configuration: "namedElements")) { transitive false } }