Skip to content

Commit

Permalink
Fix (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
calmilamsy authored Feb 5, 2025
1 parent 08351fa commit c502408
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/babric/BabricLoomPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ private void applyProject(Project project) {

// Add a transitiveImplementation configuration because gradle has no built-in way to say "don't add this to the pom"
Configuration transitiveImplementation = project.getConfigurations().create("transitiveImplementation");
project.getConfigurations().getByName("implementation").extendsFrom(transitiveImplementation);

ListProperty<LibraryProcessorManager.LibraryProcessorFactory> libraryProcessors = LoomGradleExtension.get(project).getLibraryProcessors();
libraryProcessors.add(LWJGL2LibraryProcessor::new);
Expand Down Expand Up @@ -78,7 +77,7 @@ private void applyProject(Project project) {
Node depsNode = new Node(null, "dependencies");

// Jank solution to an annoying issue
project.getConfigurations().getByName("transitiveImplementation").getDependencies().forEach(dependency -> {
transitiveImplementation.getDependencies().forEach(dependency -> {
Node depNode = depsNode.appendNode("dependency");
depNode.appendNode("groupId", dependency.getGroup());
depNode.appendNode("artifactId", dependency.getName());
Expand Down
16 changes: 16 additions & 0 deletions test-mod/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ repositories {
// for more information about repositories.
maven { url = "https://maven.glass-launcher.net/snapshots" }
maven { url = "https://maven.glass-launcher.net/releases" }
maven { url = "https://jitpack.io" }
maven { url = "https://maven.minecraftforge.net" }

exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}

dependencies {
Expand All @@ -35,6 +49,8 @@ dependencies {
implementation "org.slf4j:slf4j-api:1.8.0-beta4"
transitiveImplementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.17.2"

transitiveImplementation modImplementation("net.modificationstation:StationAPI:2.0.0-alpha.3") as Dependency

// This is an example on how to include a mod transitively.
// transitiveImplementation(modImplementation("net.glasslauncher.mods:glass-networking:1.0.3") {
// transitive = false // Disables trying to resolve this mod's dependencies.
Expand Down

0 comments on commit c502408

Please sign in to comment.