Skip to content

Commit

Permalink
Moved graldeApi() exclusion to the task configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjulianotq committed May 24, 2021
1 parent 7eaffb7 commit 2f94a25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ class ShadowJavaPlugin implements Plugin<Project> {
shadow.configurations = [project.configurations.findByName('runtimeClasspath') ?
project.configurations.runtimeClasspath : project.configurations.runtime]
shadow.exclude('META-INF/INDEX.LIST', 'META-INF/*.SF', 'META-INF/*.DSA', 'META-INF/*.RSA', 'module-info.class')
shadow.dependencies {
exclude(dependency(project.dependencies.gradleApi()))
}
}
project.artifacts.add(ShadowBasePlugin.CONFIGURATION_NAME, project.tasks.named(SHADOW_JAR_TASK_NAME))
configureShadowUpload()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ class ShadowPlugin implements Plugin<Project> {
}
}
}

afterEvaluate {
plugins.withId('java-gradle-plugin') {
// needed to prevent inclusion of gradle-api into shadow JAR
configurations.named(JavaPlugin.API_CONFIGURATION_NAME) {
dependencies.remove(project.dependencies.gradleApi())
}
}
}
}
}
}

0 comments on commit 2f94a25

Please sign in to comment.