File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ dependencies {
4
4
shadow gradleApi()
5
5
shadow ' org.codehaus.groovy:groovy-backports-compat23:3.0.7'
6
6
7
+ implementation " com.gradle.publish:plugin-publish-plugin:0.14.0"
7
8
implementation ' org.jdom:jdom2:2.0.6'
8
9
implementation ' org.ow2.asm:asm:9.1'
9
10
implementation ' org.ow2.asm:asm-commons:9.1'
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ artifactory {
56
56
repoKey = ' oss-snapshot-local'
57
57
}
58
58
defaults {
59
- publications ' plugin '
59
+ publications ' pluginMaven '
60
60
}
61
61
}
62
62
}
@@ -116,6 +116,34 @@ bintray {
116
116
}
117
117
}
118
118
119
+ // Workaround for configuring the artifact that publish-plugins uses: https://github.com/JLLeitschuh/ktlint-gradle/blob/master/plugin/build.gradle.kts
120
+ // Need to move publishing configuration into afterEvaluate {}
121
+ // to override changes done by "com.gradle.plugin-publish" plugin in afterEvaluate {} block
122
+ // See PublishPlugin class for details
123
+ afterEvaluate {
124
+ publishing {
125
+ publications {
126
+ withType(MavenPublication ) {
127
+ // Special workaround to publish shadow jar instead of normal one. Name to override peeked here:
128
+ // https://github.com/gradle/gradle/blob/master/subprojects/plugin-development/src/main/java/org/gradle/plugin/devel/plugins/MavenPluginPublishPlugin.java#L73
129
+ if (name == " pluginMaven" ) {
130
+ setArtifacts([
131
+ tasks. shadowJar,
132
+ tasks. sourcesJar,
133
+ tasks. javadocJar
134
+ ])
135
+ }
136
+ }
137
+ }
138
+ }
139
+ }
140
+
141
+ tasks. whenTaskAdded {
142
+ if (name == " publishPluginJar" || name == " generateMetadataFileForPluginMavenPublication" ) {
143
+ dependsOn(tasks. named(" shadowJar" ))
144
+ }
145
+ }
146
+
119
147
pluginBundle {
120
148
website = ' https://github.com/johnrengelman/shadow'
121
149
vcsUrl = ' https://github.com/johnrengelman/shadow'
You can’t perform that action at this time.
0 commit comments