@@ -153,22 +153,20 @@ import static net.minecraftforge.gradleutils.GradleUtilsPlugin.LOGGER
153153
154154 project. tasks. register(GenerateActionsWorkflow . NAME , GenerateActionsWorkflowImpl )
155155
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-
168156 project. afterEvaluate { this . finish(it) }
169157 }
170158
171159 private void finish (Project project ) {
160+ // Removes local Gradle API from compileOnly. This is a workaround for bugged plugins.
161+ // Publish Plugin: https://github.com/gradle/plugin-portal-requests/issues/260
162+ // Shadow: https://github.com/GradleUp/shadow/pull/1422
163+ if (this . providers. systemProperty(' org.gradle.unsafe.suppress-gradle-api' ). map(Boolean . &parseBoolean). getOrElse(false )) {
164+ final gradleApi = project. dependencies. gradleApi()
165+ project. configurations. named(JavaPlugin . COMPILE_ONLY_CONFIGURATION_NAME ) { compileOnly ->
166+ compileOnly. withDependencies { it. remove(gradleApi) }
167+ }
168+ }
169+
172170 if (this . problems. test(' net.minecraftforge.gradleutils.publishing.use-base-archives-name' )) {
173171 project. extensions. getByType(PublishingExtension ). publications. withType(MavenPublication ). configureEach {
174172 it. artifactId = project. extensions. getByType(BasePluginExtension ). archivesName
0 commit comments