Skip to content

Commit

Permalink
Fix dependency conflicts (#3917)
Browse files Browse the repository at this point in the history
  • Loading branch information
ImMorpheus authored Nov 12, 2023
1 parent 9c209aa commit 323fab8
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 22 deletions.
30 changes: 22 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ val recommendedVersion: String by project
val apiAdventureVersion: String by project
val apiConfigurateVersion: String by project
val apiGsonVersion: String by project
val apiCheckerVersion: String by project
val guavaVersion: String by project
val apiPluginSpiVersion: String by project
val asmVersion: String by project
Expand All @@ -30,7 +31,6 @@ val modlauncherVersion: String by project
val mixinVersion: String by project
val junitVersion: String by project
val mockitoVersion: String by project
val checkerVersion: String by project

val commonManifest = java.manifest {
attributes(
Expand Down Expand Up @@ -150,7 +150,9 @@ dependencies {
api("org.spongepowered:spongeapi:$apiVersion")

// Database stuffs... likely needs to be looked at
implementation("com.zaxxer:HikariCP:2.6.3")
implementation("com.zaxxer:HikariCP:2.6.3") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("org.mariadb.jdbc:mariadb-java-client:2.0.3")
implementation("com.h2database:h2:1.4.196")
implementation("org.xerial:sqlite-jdbc:3.20.0")
Expand All @@ -162,13 +164,20 @@ dependencies {

// Implementation-only Adventure
implementation(platform("net.kyori:adventure-bom:$apiAdventureVersion"))
implementation("net.kyori:adventure-serializer-configurate4")
implementation("net.kyori:adventure-serializer-configurate4") {
exclude(group = "org.jetbrains", module = "annotations")
exclude(group = "org.checkerframework", module = "checker-qual")
}

// Launch Dependencies - Needed to bootstrap the engine(s)
launchConfig("org.spongepowered:spongeapi:$apiVersion")
launchConfig("org.spongepowered:plugin-spi:$apiPluginSpiVersion")
launchConfig("org.spongepowered:plugin-spi:$apiPluginSpiVersion") {
exclude(group = "org.checkerframework", module = "checker-qual")
exclude(group = "com.google.code.gson", module = "gson")
exclude(group = "org.apache.logging.log4j", module = "log4j-api")
}
launchConfig("org.spongepowered:mixin:$mixinVersion")
launchConfig("org.checkerframework:checker-qual:$checkerVersion")
launchConfig("org.checkerframework:checker-qual:$apiCheckerVersion")
launchConfig("com.google.guava:guava:$guavaVersion") {
exclude(group = "com.google.code.findbugs", module = "jsr305") // We don't want to use jsr305, use checkerframework
exclude(group = "org.checkerframework", module = "checker-qual") // We use our own version
Expand All @@ -181,9 +190,12 @@ dependencies {
launchConfig("org.ow2.asm:asm-util:$asmVersion")

// Applaunch -- initialization that needs to occur without game access
applaunchConfig("org.checkerframework:checker-qual:$checkerVersion")
applaunchConfig("org.checkerframework:checker-qual:$apiCheckerVersion")
applaunchConfig("org.apache.logging.log4j:log4j-api:$log4jVersion")
applaunchConfig("com.google.guava:guava:$guavaVersion")
applaunchConfig("com.google.guava:guava:$guavaVersion"){
exclude(group = "com.google.errorprone", module = "error_prone_annotations")
exclude(group = "org.checkerframework", module = "checker-qual")
}
applaunchConfig(platform("org.spongepowered:configurate-bom:$apiConfigurateVersion"))
applaunchConfig("org.spongepowered:configurate-core") {
exclude(group = "org.checkerframework", module = "checker-qual") // We use our own version
Expand All @@ -208,7 +220,9 @@ dependencies {
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")

testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion")
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion") {
exclude(group = "org.junit.jupiter", module = "junit-jupiter-api")
}
testImplementation("org.mockito:mockito-inline:$mockitoVersion")
}

Expand Down
6 changes: 5 additions & 1 deletion forge/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ dependencies {

val appLaunch = forgeBootstrapLibrariesConfig.name
appLaunch("org.spongepowered:spongeapi:$apiVersion") { isTransitive = false }
appLaunch("org.spongepowered:plugin-spi:$apiPluginSpiVersion")
appLaunch("org.spongepowered:plugin-spi:$apiPluginSpiVersion") {
exclude(group = "org.checkerframework", module = "checker-qual")
exclude(group = "com.google.code.gson", module = "gson")
exclude(group = "org.apache.logging.log4j", module = "log4j-api")
}
appLaunch(platform("org.spongepowered:configurate-bom:$apiConfigurateVersion"))
appLaunch("org.spongepowered:configurate-core") {
exclude(group = "org.checkerframework", module = "checker-qual")
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ junitVersion=5.9.1
mockitoVersion=4.8.0
jlineVersion=3.21.0
tinyLogVersion=2.5.0
checkerVersion=3.26.0
vineflowerVersion=1.9.1

org.gradle.jvmargs=-Xss4m
Expand Down
4 changes: 2 additions & 2 deletions modlauncher-transformers/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ indraSpotlessLicenser {

val apiConfigurateVersion: String by project
val asmVersion: String by project
val checkerVersion: String by project
val apiCheckerVersion: String by project
val log4jVersion: String by project
val modlauncherVersion: String by project

Expand Down Expand Up @@ -55,5 +55,5 @@ dependencies {
}

// And finally, compile only annotations
compileOnly("org.checkerframework:checker-qual:$checkerVersion")
compileOnly("org.checkerframework:checker-qual:$apiCheckerVersion")
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextColor;
import org.apache.logging.log4j.Logger;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.SystemSubject;
Expand Down Expand Up @@ -516,9 +516,9 @@ private void onRegisterSpongeCommand(final RegisterCommandEvent<Command.Paramete
Command.builder()
.addParameter(Parameter.enumValue(TestEnum.class).modifier(new ValueParameterModifier<TestEnum>() {
@Override
public @NotNull Optional<? extends TestEnum> modifyResult(final Parameter.@NotNull Key<? super TestEnum> parameterKey,
final ArgumentReader.@NotNull Immutable reader,
final CommandContext.@NotNull Builder context,
public @NonNull Optional<? extends TestEnum> modifyResult(final Parameter.@NonNull Key<? super TestEnum> parameterKey,
final ArgumentReader.@NonNull Immutable reader,
final CommandContext.@NonNull Builder context,
@Nullable final TestEnum value) throws ArgumentParseException {
if (value == TestEnum.THREE) {
throw reader.createException(Component.text("Can't select three!"));
Expand All @@ -527,8 +527,8 @@ private void onRegisterSpongeCommand(final RegisterCommandEvent<Command.Paramete
}

@Override
public List<CommandCompletion> modifyCompletion(@NotNull final CommandContext context,
@NotNull final String currentInput,
public List<CommandCompletion> modifyCompletion(@NonNull final CommandContext context,
@NonNull final String currentInput,
final List<CommandCompletion> completions) {
return completions.stream().filter(x -> !x.completion().equalsIgnoreCase(TestEnum.THREE.name())).collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import net.kyori.adventure.identity.Identity;
import net.kyori.adventure.text.Component;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.api.command.Command;
import org.spongepowered.api.command.CommandCause;
import org.spongepowered.api.command.CommandCompletion;
Expand All @@ -45,7 +44,7 @@
public class ClientSuggestionsRawCommand implements Command.Raw {

@Override
public @NonNull CommandResult process(@NotNull final CommandCause cause, final ArgumentReader.@NonNull Mutable arguments) throws CommandException {
public @NonNull CommandResult process(@NonNull final CommandCause cause, final ArgumentReader.@NonNull Mutable arguments) throws CommandException {
cause.sendMessage(Identity.nil(), Component.text(arguments.remaining()));
return CommandResult.success();
}
Expand Down
10 changes: 8 additions & 2 deletions vanilla/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ dependencies {

libraries("org.spongepowered:spongeapi:$apiVersion")
libraries(platform("net.kyori:adventure-bom:$apiAdventureVersion"))
libraries("net.kyori:adventure-serializer-configurate4")
libraries("net.kyori:adventure-serializer-configurate4") {
exclude(group = "org.checkerframework", module = "checker-qual")
}
libraries("javax.inject:javax.inject:1")
libraries("org.spongepowered:configurate-jackson") {
exclude(group = "org.spongepowered", module = "configurate-core")
Expand Down Expand Up @@ -335,7 +337,11 @@ dependencies {
appLaunch("cpw.mods:grossjava9hacks:1.3.3") {
exclude(group = "org.apache.logging.log4j")
}
appLaunch("org.spongepowered:plugin-spi:$apiPluginSpiVersion")
appLaunch("org.spongepowered:plugin-spi:$apiPluginSpiVersion") {
exclude(group = "org.checkerframework", module = "checker-qual")
exclude(group = "com.google.code.gson", module = "gson")
exclude(group = "org.apache.logging.log4j", module = "log4j-api")
}
appLaunch("com.lmax:disruptor:3.4.4")
"applaunchCompileOnly"("org.jetbrains:annotations:23.1.0")

Expand Down

0 comments on commit 323fab8

Please sign in to comment.