Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/main/java/net/fabricmc/loom/api/ModSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.artifacts.ProjectDependency;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.provider.ListProperty;
import org.gradle.api.tasks.SourceSet;
Expand Down Expand Up @@ -130,6 +131,18 @@ public void sourceSet(String sourceSetName, String projectPath) {
getExternalGroups().add(new ExternalClasspathGroup(projectPath, sourceSetName));
}

/**
* Add {@link SourceSet}'s output directories from the supplied project to be grouped with the named mod.
*
* <p>If the other project is not a Loom project you must apply the `net.fabricmc.fabric-loom-companion` plugin.
*
* @param sourceSetName the name of the source set
* @param projectDependency the {@link ProjectDependency} the source set belongs to
*/
public void sourceSet(String sourceSetName, ProjectDependency projectDependency) {
sourceSet(sourceSetName, projectDependency.getPath());
}

/**
* Add a number of {@link Dependency} to the mod's classpath group. Should be used to include all dependencies that are shaded into your mod.
*
Expand Down
6 changes: 3 additions & 3 deletions src/test/resources/projects/multiproject/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ allprojects {
loom {
mods {
core {
sourceSet("main", ":core")
sourceSet("main", projects.core)
}
example {
sourceSet("main", ":example")
sourceSet("main", projects.example)
}
root {
sourceSet sourceSets.main
sourceSet("main", ":javalib")
sourceSet("main", projects.javalib)
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/test/resources/projects/multiproject/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
rootProject.name = "fabric-example-mod"

enableFeaturePreview 'TYPESAFE_PROJECT_ACCESSORS'

include 'core'
include 'example'
include 'javalib'