@@ -6,6 +6,7 @@ package net.minecraftforge.gradleutils
66
77import groovy.transform.CompileStatic
88import groovy.transform.PackageScope
9+ import org.codehaus.groovy.runtime.InvokerHelper
910import org.gradle.api.Action
1011import org.gradle.api.Project
1112import org.gradle.api.artifacts.repositories.MavenArtifactRepository
@@ -75,6 +76,10 @@ import static net.minecraftforge.gradleutils.GradleUtilsPlugin.LOGGER
7576 }
7677 }
7778
79+ def methodMissing (String name , def args ) {
80+ InvokerHelper . invokeStaticMethod(GradleUtilsProblems , name, args)
81+ }
82+
7883 @Override
7984 Action<MavenArtifactRepository > getPublishingForgeMaven (String fallbackPublishingEndpoint ) {
8085 this . getPublishingForgeMaven(fallbackPublishingEndpoint, this . rootDirectory. dir(' repo' ))
@@ -148,19 +153,22 @@ import static net.minecraftforge.gradleutils.GradleUtilsPlugin.LOGGER
148153
149154 project. tasks. register(GenerateActionsWorkflow . NAME , GenerateActionsWorkflowImpl )
150155
156+ // NOTE: Gradle#projectsEvaluates ensures that this runs after everything else, including other plugins.
157+ project. gradle. projectsEvaluated {
158+ // Removes local Gradle API from compileOnly. This is a workaround for bugged plugins.
159+ // Publish Plugin: https://github.com/gradle/plugin-portal-requests/issues/260
160+ // Shadow: https://github.com/GradleUp/shadow/pull/1422
161+ if (this . providers. systemProperty(' org.gradle.unsafe.suppress-gradle-api' ). map(Boolean . &parseBoolean). getOrElse(false )) {
162+ project. configurations. named(JavaPlugin . COMPILE_ONLY_CONFIGURATION_NAME ) { compileOnly ->
163+ compileOnly. dependencies. remove(project. dependencies. gradleApi())
164+ }
165+ }
166+ }
167+
151168 project. afterEvaluate { this . finish(it) }
152169 }
153170
154171 private void finish (Project project ) {
155- // Removes local Gradle API from compileOnly. This is a workaround for bugged plugins.
156- // Publish Plugin: https://github.com/gradle/plugin-portal-requests/issues/260
157- // Shadow: https://github.com/GradleUp/shadow/pull/1422
158- if (this . providers. systemProperty(' org.gradle.unsafe.suppress-gradle-api' ). map(Boolean . &parseBoolean). getOrElse(false )) {
159- project. configurations. named(JavaPlugin . COMPILE_ONLY_CONFIGURATION_NAME ) { compileOnly ->
160- compileOnly. dependencies. remove(project. dependencies. gradleApi())
161- }
162- }
163-
164172 if (this . problems. test(' net.minecraftforge.gradleutils.publishing.use-base-archives-name' )) {
165173 project. extensions. getByType(PublishingExtension ). publications. withType(MavenPublication ). configureEach {
166174 it. artifactId = project. extensions. getByType(BasePluginExtension ). archivesName
0 commit comments