File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed
Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -299,19 +299,25 @@ tasks.withType(JavaExec).configureEach {
299299 }
300300}
301301
302- if (project. plugins. hasPlugin(' com.gradleup.shadow' )) {
302+ // Helps for reproducible builds
303+ tasks. withType(AbstractArchiveTask ). configureEach {
304+ preserveFileTimestamps = false
305+ reproducibleFileOrder = true
306+ }
307+
308+ project. pluginManager. withPlugin(' com.gradleup.shadow' ) {
303309 // Remove the no-deps jar from the archives to prevent publication
304- configurations. archives. with {
305- artifacts. remove artifacts. find {
310+ configurations. named( ' archives' ) { Configuration c ->
311+ c . artifacts. remove(c . artifacts. find {
306312 if (it. hasProperty(" delegate" )) {
307313 it. delegate. archiveTask. is jar
308314 } else {
309315 it. archiveTask. is jar
310316 }
311317 }
312- }
313- artifacts {
314- archives( shadowJar)
318+ )
319+
320+ c . artifacts . add(tasks . named( " shadowJar" ) )
315321 }
316322}
317323
You can’t perform that action at this time.
0 commit comments