mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-28 04:07:01 -05:00
Port Forge run templates to the new classpath group system
This commit is contained in:
@@ -36,6 +36,7 @@ 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.file.DirectoryProperty;
|
||||
import org.gradle.api.provider.ListProperty;
|
||||
import org.gradle.api.tasks.SourceSet;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
@@ -54,6 +55,13 @@ public abstract class ModSettings implements Named {
|
||||
*/
|
||||
public abstract ConfigurableFileCollection getModFiles();
|
||||
|
||||
/**
|
||||
* The main resource directory in the mod.
|
||||
* On Forge and NeoForge, this is the resource directory that contains mods.toml.
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
public abstract DirectoryProperty getMainResourceDirectory();
|
||||
|
||||
@Inject
|
||||
public ModSettings() {
|
||||
getExternalGroups().finalizeValueOnRead();
|
||||
@@ -125,6 +133,14 @@ public abstract class ModSettings implements Named {
|
||||
SourceSetReference ref = new SourceSetReference(SourceSetHelper.getSourceSetByName(sourceSetName, getProject()), getProject());
|
||||
List<File> classpath = SourceSetHelper.getClasspath(ref, false);
|
||||
getModFiles().from(classpath);
|
||||
|
||||
// Arch: store resource dir
|
||||
File resourcesDir = ref.sourceSet().getOutput().getResourcesDir();
|
||||
|
||||
if (resourcesDir != null && !getMainResourceDirectory().isPresent()) {
|
||||
getMainResourceDirectory().set(resourcesDir);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user