mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Add dependency and configuration helpers to ModSettings.
This commit is contained in:
@@ -28,6 +28,8 @@ import javax.inject.Inject;
|
||||
|
||||
import org.gradle.api.Named;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.api.artifacts.Configuration;
|
||||
import org.gradle.api.artifacts.Dependency;
|
||||
import org.gradle.api.file.ConfigurableFileCollection;
|
||||
import org.gradle.api.provider.ListProperty;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
@@ -77,6 +79,23 @@ public abstract class ModSettings implements Named {
|
||||
getModSourceSets().add(new SourceSetReference(sourceSet, project));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* <p>Uses a detached configuration.
|
||||
*/
|
||||
public void dependency(Dependency... dependencies) {
|
||||
Configuration detachedConfiguration = getProject().getConfigurations().detachedConfiguration(dependencies);
|
||||
configuration(detachedConfiguration);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a {@link Configuration} to the mod's classpath group. Should be used to include all dependencies that are shaded into your mod.
|
||||
*/
|
||||
public void configuration(Configuration configuration) {
|
||||
getModFiles().from(configuration);
|
||||
}
|
||||
|
||||
/**
|
||||
* List of classpath directories, used to populate the `fabric.classPathGroups` Fabric Loader system property.
|
||||
* Use the {@link ModSettings#sourceSet} methods to add to this.
|
||||
|
||||
Reference in New Issue
Block a user