File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
src/main/groovy/com/github/jengelman/gradle/plugins/shadow Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -12,10 +12,12 @@ class ShadowExtension {
12
12
13
13
CopySpec applicationDistribution
14
14
Project project
15
+ boolean addJavaVariants
15
16
16
17
ShadowExtension (Project project ) {
17
18
this . project = project
18
19
applicationDistribution = project. copySpec {}
20
+ addJavaVariants = true
19
21
}
20
22
21
23
void component (MavenPublication publication ) {
Original file line number Diff line number Diff line change @@ -53,9 +53,13 @@ class ShadowJavaPlugin implements Plugin<Project> {
53
53
54
54
project. configurations. shadowRuntimeElements. extendsFrom project. configurations. shadow
55
55
56
- project. components. java {
57
- addVariantsFromConfiguration(project. configurations. shadowRuntimeElements) {
58
- mapToOptional() // make it a Maven optional dependency
56
+ project. afterEvaluate {
57
+ if (project. extensions. findByName(ShadowBasePlugin . EXTENSION_NAME ). addJavaVariants) {
58
+ project. components. java {
59
+ addVariantsFromConfiguration(project. configurations. shadowRuntimeElements) {
60
+ mapToOptional() // make it a Maven optional dependency
61
+ }
62
+ }
59
63
}
60
64
}
61
65
}
You can’t perform that action at this time.
0 commit comments