Skip to content

Commit 0fdaa5a

Browse files
authored
Reproducible builds: use a fixed mtime for all entries in the source tarball (#2823)
This change makes generated source-tarballs binary-comparable, so that locally built one (via `./gradlew sourceTarball`) should be exactly the same as a staged one.
1 parent 75e2698 commit 0fdaa5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

build-logic/src/main/kotlin/publishing/rootProject.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ internal fun configureOnRootProject(project: Project) =
5555
"archive",
5656
"--prefix=${e.baseName.get()}/",
5757
"--format=tar.gz",
58+
// use a fixed mtime for reproducible tarballs, using the same timestamp as jars do
59+
"--mtime=1980-02-01 00:00:00",
5860
"--output=${e.sourceTarball.get().asFile.relativeTo(projectDir)}",
5961
"HEAD",
6062
)

0 commit comments

Comments
 (0)