Skip to content

Commit

Permalink
Switch to "include" filter on Forge's repo (#226)
Browse files Browse the repository at this point in the history
Fixes #221. The set of groups is sufficient to build Forge mods on 1.14-1.21 and should work for all other versions too.
  • Loading branch information
Juuxel authored Jul 10, 2024
1 parent 351c5f7 commit 9416fc1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/main/java/net/fabricmc/loom/LoomRepositoryPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

package net.fabricmc.loom;

import java.util.List;

import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.ArtifactRepositoryContainer;
Expand All @@ -40,6 +42,14 @@
import net.fabricmc.loom.util.MirrorUtil;

public class LoomRepositoryPlugin implements Plugin<PluginAware> {
private static final List<String> FORGE_GROUPS = List.of(
"net.minecraftforge",
"cpw.mods",
"de.oceanlabs",
"net.jodah",
"org.mcmodlauncher"
);

@Override
public void apply(@NotNull PluginAware target) {
if (target instanceof Settings settings) {
Expand Down Expand Up @@ -95,9 +105,11 @@ private void declareRepositories(RepositoryHandler repositories, LoomFiles files
repo.setUrl("https://maven.minecraftforge.net/");

repo.content(descriptor -> {
descriptor.excludeGroupByRegex("org\\.eclipse\\.?.*");
// Some of these downloads hang and this is already available from central to begin with.
descriptor.excludeGroup("org.ow2.asm");
// Only include these groups to avoid slowing down/hanging the build,
// or downloading incorrect artifacts.
for (String group : FORGE_GROUPS) {
descriptor.includeGroupAndSubgroups(group);
}
});
repo.metadataSources(sources -> {
sources.mavenPom();
Expand Down

0 comments on commit 9416fc1

Please sign in to comment.