From 155bac1a455eb884d0cf8496433fd79f4578007a Mon Sep 17 00:00:00 2001 From: Robert Stupp Date: Wed, 15 Oct 2025 19:16:29 +0200 Subject: [PATCH] Reproducible builds: use a fixed mtime for all entries in the source tarball 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. --- build-logic/src/main/kotlin/publishing/rootProject.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build-logic/src/main/kotlin/publishing/rootProject.kt b/build-logic/src/main/kotlin/publishing/rootProject.kt index 663d3a26d8..001d9ccee7 100644 --- a/build-logic/src/main/kotlin/publishing/rootProject.kt +++ b/build-logic/src/main/kotlin/publishing/rootProject.kt @@ -55,6 +55,8 @@ internal fun configureOnRootProject(project: Project) = "archive", "--prefix=${e.baseName.get()}/", "--format=tar.gz", + // use a fixed mtime for reproducible tarballs, using the same timestamp as jars do + "--mtime=1980-02-01 00:00:00", "--output=${e.sourceTarball.get().asFile.relativeTo(projectDir)}", "HEAD", )