Skip to content

Commit

Permalink
disable gmm when using shadow plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Apr 12, 2021
1 parent d88e174 commit 0035583
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
package nebula.plugin.netflixossproject.publishing

import nebula.plugin.publishing.NebulaOssPublishingPlugin
import org.gradle.api.Action
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.publish.tasks.GenerateModuleMetadata

class PublishingPlugin implements Plugin<Project> {

Expand All @@ -34,5 +36,18 @@ class PublishingPlugin implements Plugin<Project> {
project.rootProject.tasks.named('postRelease').configure {
it.dependsOn( project.tasks.withType(PublishToMavenRepository))
}

project.plugins.withId('com.github.johnrengelman.shadow') {
disableGradleModuleMetadataTask(project)
}
}

private void disableGradleModuleMetadataTask(Project project) {
project.tasks.withType(GenerateModuleMetadata).configureEach(new Action<GenerateModuleMetadata>() {
@Override
void execute(GenerateModuleMetadata generateModuleMetadataTask) {
generateModuleMetadataTask.enabled = false
}
})
}
}

0 comments on commit 0035583

Please sign in to comment.