build: Synthesize modules to link with multiple versions of libraries

Gson and Guava are both used in pre- and post-modular versions in
environments where Mixin is used on the module path, so we have to be
able to link against both in the compile-time module descriptor.
This commit is contained in:
zml committed 2021-12-01 08:15:18 -08:00
1 parent 1e1aa7fb52
commit 8cd66d8241
9 files changed
+194 -7

No files matched your search

+11 -6
View File
@@ -40,7 +40,7 @@ module org.spongepowered.mixin {
requires transitive org.objectweb.asm.tree.analysis;
requires transitive org.objectweb.asm.util;
requires java.logging;
//
// Modules we require for compilation but don't necessarily need at runtime
//
@@ -48,12 +48,18 @@ module org.spongepowered.mixin {
requires static transitive cpw.mods.modlauncher;
requires static cpw.mods.securejarhandler;
requires static transitive org.apache.logging.log4j;
//
// Automatic modules we depend on, using static to avoid the forward compatibility mess
//
requires static jopt.simple;
// Guava, by file name and official module
requires static com.google.common;
requires static guava;
// Gson, by file name and official module
requires static com.google.gson;
requires static gson;
//
@@ -105,11 +111,10 @@ module org.spongepowered.mixin {
exports org.spongepowered.tools.obfuscation.mcp;
exports org.spongepowered.tools.obfuscation.mirror;
exports org.spongepowered.tools.obfuscation.service;
// one of these won't exist, the SuppressWarnings above stops the compiler complaining
opens org.spongepowered.asm.mixin.transformer
to com.google.gson, gson;
//
// Service wiring
//
@@ -132,7 +137,7 @@ module org.spongepowered.mixin {
uses cpw.mods.modlauncher.serviceapi.ILaunchPluginService;
provides cpw.mods.modlauncher.serviceapi.ILaunchPluginService
with org.spongepowered.asm.launch.MixinLaunchPlugin;
uses javax.annotation.processing.Processor;
provides javax.annotation.processing.Processor
with org.spongepowered.tools.obfuscation.MixinObfuscationProcessorInjection,