Skip to content

Commit 9947aa8

Browse files
marko-bekhtasebersole
authored andcommitted
#92 Add archive task configuration to make the build reproducible
1 parent 21d4741 commit 9947aa8

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

build.gradle

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ dependencies {
3636
// Java handling
3737
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3838

39+
// To force the build produce the same byte-for-byte archives and hence make Hibernate Models build reproducible.
40+
// See also https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives
41+
tasks.withType(AbstractArchiveTask).configureEach {
42+
preserveFileTimestamps = false
43+
reproducibleFileOrder = true
44+
}
45+
3946
java {
4047
sourceCompatibility = jdks.versions.baseline.get() as int
4148
targetCompatibility = jdks.versions.baseline.get() as int
@@ -108,4 +115,4 @@ jacocoTestReport {
108115

109116
tasks.named( "check" ) {
110117
dependsOn jacocoReportTask
111-
}
118+
}

0 commit comments

Comments
 (0)