Skip to content

Commit 79aabaa

Browse files
committed
Fixup shadow compatibility support.
1 parent 48fe72b commit 79aabaa

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

dev/src/main/groovy/com/fox2code/foxloader/dev/CompatibilityModule.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ public static void appendDependenciesNamesToExclude(FoxLoaderConfig config, Coll
5858
if (config.useLWJGLX) {
5959
collection.add("com.fox2code:lwjglx:" + config.LWJGLXVersion);
6060
}
61+
collection.add(DependencyHelper.annotations.name);
62+
collection.add(DependencyHelper.jansi.name);
63+
collection.add("net.silveros:reindev-fl:" +
64+
BuildConfig.REINDEV_VERSION + "-fl_" + BuildConfig.FOXLOADER_VERSION);
6165
String foxLoaderVersion = BuildConfig.FOXLOADER_VERSION;
6266
if (config.foxLoaderLibVersionOverride != null) {
6367
foxLoaderVersion = config.foxLoaderLibVersionOverride;
@@ -69,6 +73,7 @@ public static void appendDependenciesNamesToExclude(FoxLoaderConfig config, Coll
6973
for (DependencyHelper.Dependency dependency : DependencyHelper.commonDependenciesModernJava) {
7074
collection.add(dependency.name);
7175
}
76+
collection.add(DependencyHelper.sparkDependency.name);
7277
for (String bundle : config.usedDependencyBundlesList) {
7378
for (DependencyHelper.Dependency dependency : DependencyHelper.getDependencyBundle(bundle)) {
7479
collection.add(dependency.name);

dev/src/main/groovy/com/fox2code/foxloader/dev/compatibility/ShadowCompatibility.groovy

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,11 @@ final class ShadowCompatibility extends CompatibilityModule {
4646

4747
@Override
4848
void onLateApply(Project project, FoxLoaderConfig config) {
49+
final HashSet<String> dependenciesToExclude = new HashSet<>()
50+
appendDependenciesNamesToExclude(config, dependenciesToExclude)
4951
project.tasks.named('shadowJar', ShadowJar) {
5052
archiveClassifier.set("")
5153
dependencies {
52-
for (String dependencyToExclude : getDependenciesNamesToExclude(config)) {
53-
exclude(dependency(dependencyToExclude))
54-
}
55-
// LWJGLX support.
5654
exclude(new Spec<? super ResolvedDependency>() {
5755
@Override
5856
boolean isSatisfiedBy(Object o) {
@@ -62,7 +60,10 @@ final class ShadowCompatibility extends CompatibilityModule {
6260

6361
boolean isSatisfiedBy(ResolvedDependency resolvedDependency) {
6462
String dependencyName = resolvedDependency.getName()
65-
return dependencyName.startsWith("org.lwjgl.lwjgl:") ||
63+
return dependenciesToExclude.contains(dependencyName) ||
64+
dependencyName.startsWith("net.fabricmc:sponge-mixin:") ||
65+
dependencyName.startsWith("org.spongepowered:mixin:") ||
66+
dependencyName.startsWith("org.lwjgl.lwjgl:") ||
6667
dependencyName.startsWith("org.lwjgl:")
6768
}
6869
})

patching/src/main/java/com/fox2code/foxloader/dependencies/DependencyHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public final class DependencyHelper {
5959
"org.fusesource.jansi:jansi:" + BuildConfig.JANSI_VERSION, MAVEN_CENTRAL,
6060
"org.fusesource.jansi.AnsiConsole", null, "0b7b8b003a90ea491579b62f5118828e45112914c65589b00faa49d6ec785839");
6161

62-
private static final Dependency annotations =
62+
public static final Dependency annotations =
6363
new Dependency("org.jetbrains:annotations:24.1.0", MAVEN_CENTRAL,
6464
"org.jetbrains.annotations.NotNull", null, "27a770dc7ce50500918bb8c3c0660c98290630ec796b5e3cf6b90f403b3033c6");
6565

0 commit comments

Comments
 (0)