From 23eb8de80d8b2ec7e77e03058ade11ba798ccf0e Mon Sep 17 00:00:00 2001 From: juyeop Date: Mon, 11 Aug 2025 16:05:26 +0900 Subject: [PATCH] build: Allow overriding 'Created-By' for reproducible builds In order to support bit-for-bit reproducible builds, this commit introduces a Gradle property 'manifest.createdBy'. This property allows rebuilders to override the 'Created-By' attribute in the JAR manifest files. If the property is not set, the build falls back to using the current JVM's details, preserving the existing behavior. This directly addresses the problem of non-reproducible builds due to different JDK vendor information in the manifest. Fixes #3563 --- .../kotlin/mockito.java-library-conventions.gradle.kts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildSrc/src/main/kotlin/mockito.java-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/mockito.java-library-conventions.gradle.kts index 40633ea36d..607d681844 100644 --- a/buildSrc/src/main/kotlin/mockito.java-library-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/mockito.java-library-conventions.gradle.kts @@ -33,4 +33,14 @@ tasks { unix("rw-r--r--") // 0644 } } + + withType().configureEach { + manifest { + val createdByProperty = project.findProperty("manifest.createdBy") as? String + attributes( + "Created-By" to (createdByProperty + ?: "${System.getProperty("java.version")} (${System.getProperty("java.vendor")})") + ) + } + } }