Skip to content

Commit

Permalink
fromCommon showcase
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Mar 2, 2024
1 parent 306e947 commit 39de89c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 36 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 8 additions & 25 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "me.shedaniel.unified-publishing"
}

Expand All @@ -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 {
Expand All @@ -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 {
Expand All @@ -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) {
Expand Down Expand Up @@ -81,12 +70,6 @@ sourcesJar {
}
}

components.java {
withVariantsFromConfiguration(project.configurations.shadowRuntimeElements) {
skip()
}
}

publishing {
publications {
mavenFabric(MavenPublication) {
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pluginManagement {
maven { url "https://maven.architectury.dev/" }
maven { url "https://files.minecraftforge.net/maven/" }
gradlePluginPortal()
mavenLocal()
}
}

Expand Down
12 changes: 2 additions & 10 deletions testmod-fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.matthewprenger.cursegradle"
}

Expand All @@ -12,20 +11,13 @@ 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 {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
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 }
}

0 comments on commit 39de89c

Please sign in to comment.