Skip to content

Commit

Permalink
Remote the ignoreList regex (#62)
Browse files Browse the repository at this point in the history
The regex attempts to remove version information from the jar, so that it would go from `artifact-name-<version>.jar` to `artifact-name` in the BSL ignore list. But the full name will work as well. See https://github.com/McModLauncher/bootstraplauncher/blob/d1e91742561c9ea37c035c0fec2bd756967a1395/src/main/java/cpw/mods/bootstraplauncher/BootstrapLauncher.java#L70.

And in fact the full name is already being used by fml-core and fml-events (jar names `core-<version>.jar` and `events-<version>.jar`) because `core` is too generic of a prefix to be excluding, and same for `event`.

It was buggy when paired with versions with classifiers, and is simply not needed. No implementations of maven downloaders will rename the file. So just remove the core/events special cases and the regex altogether.
  • Loading branch information
Matyrobbrt authored Nov 30, 2023
1 parent 9da8a2e commit ae319cf
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -747,12 +747,7 @@ private static void configureInstallerTokens(final TokenizedTask tokenizedTask,
tokenizedTask.token("MC_VERSION", runtimeDefinition.getSpecification().getMinecraftVersion());
tokenizedTask.token("MCP_VERSION", runtimeDefinition.getJoinedNeoFormRuntimeDefinition().getSpecification().getNeoFormVersion());
tokenizedTask.token("FORGE_GROUP", tokenizedTask.getProject().getGroup());
tokenizedTask.token("IGNORE_LIST", ignoreConfigurations.stream().flatMap(config -> config.getFiles().stream()).map(file -> {
if (file.getName().startsWith("events") || file.getName().startsWith("core")) {
return file.getName();
}
return file.getName().replaceAll("([-_]([.\\d]*\\d+)|\\.jar$)", "");
}).collect(Collectors.joining(",")));
tokenizedTask.token("IGNORE_LIST", ignoreConfigurations.stream().flatMap(config -> config.getFiles().stream()).map(File::getName).collect(Collectors.joining(",")));
tokenizedTask.token("PLUGIN_LAYER_LIBRARIES", pluginLayerLibraries.getFiles().stream().map(File::getName).collect(Collectors.joining(",")));
tokenizedTask.token("GAME_LAYER_LIBRARIES", gameLayerLibraries.getFiles().stream().map(File::getName).collect(Collectors.joining(",")));
tokenizedTask.token("MODULES", "ALL-MODULE-PATH");
Expand All @@ -767,7 +762,7 @@ private static Provider<String> createIgnoreList(Configuration moduleOnlyConfigu
return project.provider(() -> {
StringBuilder ignoreList = new StringBuilder(1000);
for (Configuration cfg : Arrays.asList(moduleOnlyConfiguration, gameLayerLibraryConfiguration, pluginLayerLibraryConfiguration)) {
ignoreList.append(cfg.getFiles().stream().map(file -> (file.getName().startsWith("events") || file.getName().startsWith("core") ? file.getName() : file.getName().replaceAll("([-_]([.\\d]*\\d+)|\\.jar$)", ""))).collect(Collectors.joining(","))).append(",");
ignoreList.append(cfg.getFiles().stream().map(File::getName).collect(Collectors.joining(","))).append(",");
}
ignoreList.append("client-extra").append(",").append(project.getName()).append("-");
return ignoreList.toString();
Expand Down

0 comments on commit ae319cf

Please sign in to comment.