File tree Expand file tree Collapse file tree
src/main/groovy/net/minecraftforge/gradleutils/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -403,18 +403,21 @@ import static net.minecraftforge.gradleutils.internal.GradleUtilsPlugin.LOGGER
403403
404404 @Override
405405 TaskProvider<? extends PromotePublication > promote (MavenPublication publication , @Nullable Action<? super PromotePublication > cfg ) {
406- this . project. tasks. register(" promote${ publication.name.capitalize()} Publication" , PromotePublicationImpl , publication). tap { promote ->
406+ var publicationName = publication. name
407+ project. tasks. register(" promote${ publicationName.capitalize()} Publication" , PromotePublicationImpl , publication). tap { promote ->
407408 if (cfg != = null )
408409 promote. configure { cfg. execute(it) }
409410
410- this . project. tasks. withType(PublishToMavenRepository ). configureEach { publish ->
411- // if the publish task's publication isn't this one and the repo name isn't 'forge', skip
412- // the name being 'forge' is enforced by gradle utils
413- if (publish. publication != = publication || publish. repository. name != ' forge' )
414- return
411+ project. afterEvaluate {
412+ it. tasks. withType(PublishToMavenRepository ). configureEach { publish ->
413+ // if the publish task's publication isn't this one and the repo name isn't 'forge', skip
414+ // the name being 'forge' is enforced by gradle utils
415+ if (publish. publication === null || publicationName != publish. publication. name || publish. repository. name != ' forge' )
416+ return
415417
416- publish. finalizedBy(promote)
417- promote. get(). mustRunAfter(publish)
418+ publish. finalizedBy(promote)
419+ promote. get(). mustRunAfter(publish)
420+ }
418421 }
419422 }
420423 }
You can’t perform that action at this time.
0 commit comments