From f07254b52fd3734b7405eafc2406777b595a7fa8 Mon Sep 17 00:00:00 2001 From: Octavia Togami Date: Sat, 17 Feb 2024 19:28:02 -0800 Subject: [PATCH] Fix Artifactory interfering with Fabric publications --- buildSrc/src/main/kotlin/ArtifactoryConfig.kt | 7 +++++-- settings.gradle.kts | 10 ++++++++++ worldedit-fabric/build.gradle.kts | 17 +++-------------- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/buildSrc/src/main/kotlin/ArtifactoryConfig.kt b/buildSrc/src/main/kotlin/ArtifactoryConfig.kt index 929bab7af5..fade874543 100644 --- a/buildSrc/src/main/kotlin/ArtifactoryConfig.kt +++ b/buildSrc/src/main/kotlin/ArtifactoryConfig.kt @@ -34,7 +34,10 @@ fun Project.applyRootArtifactoryConfig() { } fun Project.applyCommonArtifactoryConfig() { - tasks.named("artifactoryPublish") { - publications("maven") + // Artifactory eagerly evaluates publications, so this must run after all changes to artifacts are done + afterEvaluate { + tasks.named("artifactoryPublish") { + publications("maven") + } } } diff --git a/settings.gradle.kts b/settings.gradle.kts index aa5a0b0601..e74bf3f98e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,13 @@ +pluginManagement { + repositories { + mavenCentral() + gradlePluginPortal() + maven { + name = "Fabric" + url = uri("https://maven.fabricmc.net/") + } + } +} plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" } diff --git a/worldedit-fabric/build.gradle.kts b/worldedit-fabric/build.gradle.kts index 27c0160431..e3b0486fde 100644 --- a/worldedit-fabric/build.gradle.kts +++ b/worldedit-fabric/build.gradle.kts @@ -3,25 +3,14 @@ import net.fabricmc.loom.api.LoomGradleExtensionAPI import net.fabricmc.loom.configuration.FabricApiExtension import net.fabricmc.loom.task.RemapJarTask -buildscript { - repositories { - mavenCentral() - maven { - name = "Fabric" - url = uri("https://maven.fabricmc.net/") - } - } - dependencies { - classpath("net.fabricmc:fabric-loom:${versions.loom}") - } +plugins { + id("fabric-loom") + `java-library` } applyPlatformAndCoreConfiguration(javaRelease = 17) applyShadowConfiguration() -apply(plugin = "fabric-loom") -apply(plugin = "java-library") - val minecraftVersion = "1.20.4" val loaderVersion = "0.15.1"