From c338f0c7a4586535678e2a02a19e5e1b35e3eb02 Mon Sep 17 00:00:00 2001 From: Mumfrey Date: Fri, 10 Jan 2020 18:08:17 +0000 Subject: [PATCH] Update build with POM exclusions for older builds and maven repo switch --- build.gradle | 37 ++++++++++++++++--- .../asm/mixin/transformer/MixinConfig.java | 2 +- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index b923cde9..91a8252b 100644 --- a/build.gradle +++ b/build.gradle @@ -107,8 +107,8 @@ dependencies { def guava = 'com.google.guava:guava:21.0' // from mc1.12 onwards def log4j2 = 'org.apache.logging.log4j:log4j-core:2.0-beta9' - implementation guava - implementation log4j2 + compile guava + compile log4j2 compile 'com.google.code.gson:gson:2.2.4' if (Float.parseFloat(asmVersion) < 6) { compile "org.ow2.asm:asm-debug-all:$asmVersion" @@ -357,15 +357,28 @@ artifacts { archives javadocJar } +ext.excludePomDeps = [ + 'asm-tree', + 'asm-commons', + 'asm-util', + 'log4j-core', + 'guava', + 'gson', +] + uploadArchives { repositories { mavenDeployer { configuration = configurations.deployerJars - if (project.hasProperty("spongeRepo")) { - repository(url: project.spongeRepo) { - authentication(userName: project.spongeUsername, password: project.spongePassword) + if (buildType == 'RELEASE' && project.hasProperty("releaseRepo")) { + repository(url: project.releaseRepo) { + authentication(userName: project.releaseRepoUsername, password: project.releaseRepoPassword) + } + } else if (buildType == 'SNAPSHOT' && project.hasProperty("snapshotRepo")) { + repository(url: project.snapshotRepo) { + authentication(userName: project.snapshotRepoUsername, password: project.snapshotRepoPassword) } } @@ -398,7 +411,21 @@ uploadArchives { } } } + whenConfigured { + dependencies = dependencies.findAll { + !it.artifactId.matches(excludePomDeps.join('|')) + } + } } } } } + +install.repositories.mavenInstaller.pom { + whenConfigured { + dependencies = dependencies.findAll { + !it.artifactId.matches(excludePomDeps.join('|')) + } + } +} + \ No newline at end of file diff --git a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java index d62c4b24..b178d87c 100644 --- a/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java +++ b/src/main/java/org/spongepowered/asm/mixin/transformer/MixinConfig.java @@ -906,7 +906,7 @@ final class MixinConfig implements Comparable, IMixinConfig { /** * Get the list of mixin classes we will be applying */ - @SuppressWarnings("unchecked") + @SuppressWarnings({"unchecked", "rawtypes"}) public List getClasses() { Builder list = ImmutableList.builder(); for (List classes : new List[] { this.mixinClasses, this.mixinClassesClient, this.mixinClassesServer} ) {