This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new cbf0e27 Reproducible builds: Make non-bnd processed JARs reproducible
cbf0e27 is described below
commit cbf0e272e068225533cff04306d2a62f6b88869b
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Mar 18 12:23:35 2021 +0000
Reproducible builds: Make non-bnd processed JARs reproducible
---
build.properties.default | 4 ++++
build.xml | 15 +++++++++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/build.properties.default b/build.properties.default
index e45fe99..5cc548d 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -29,6 +29,10 @@ version.build=65
version.patch=0
version.suffix=-dev
+# ----- Reproducible builds -----
+# Uncomment and set to current time for reproducible builds
+#ant.tstamp.now.iso=2021-03-18T06:00:00Z
+
# ----- Source control flags -----
git.branch=8.5.x
diff --git a/build.xml b/build.xml
index 3486a26..4560387 100644
--- a/build.xml
+++ b/build.xml
@@ -260,6 +260,7 @@
<format property="today" pattern="MMM d yyyy" locale="en" timezone="UTC"/>
<format property="today-iso-8601" pattern="yyyy-MM-dd" locale="en"
timezone="UTC"/>
<format property="tstamp" pattern="HH:mm:ss" locale="en" timezone="UTC"/>
+ <format property="tstamp.file" pattern="MM/dd/yyyy hh:mm:ss aa"/>
</tstamp>
<filterset id="version.filters">
<filter token="YEAR" value="${year}"/>
@@ -732,6 +733,11 @@
<native2ascii src="java" dest="${tomcat.classes}"
includes="**/LocalStrings.properties,**/Messages*.properties" encoding="UTF-8"/>
<native2ascii src="java" dest="${tomcat.i18n}"
includes="**/LocalStrings_*.properties" encoding="UTF-8"/>
+ <!-- Reproducible builds: consistent timestamps for class files and other
+ files placed in JARs -->
+ <touch datetime="${tstamp.file}" pattern="MM/dd/yyyy hh:mm:ss aa">
+ <fileset dir="${tomcat.classes}"/>
+ </touch>
</target>
<target name="build-manifests" unless="manifests.uptodate"
@@ -753,6 +759,10 @@
<fileset dir="${tomcat.home}/res/META-INF" />
</copy>
+ <!-- Reproducible builds: consistent timestamps for files in META-INF -->
+ <touch datetime="${tstamp.file}" pattern="MM/dd/yyyy hh:mm:ss aa">
+ <fileset dir="${tomcat.manifests}"/>
+ </touch>
</target>
<target name="package" depends="compile,build-manifests" >
@@ -3291,7 +3301,7 @@ Read the Building page on the Apache Tomcat documentation
site for details on ho
<srcfiles file="@{license}" />
</uptodate>
<sequential unless:true="${jar.uptodate}">
- <jar jarfile="@{jarfile}" manifest="@{manifest}" >
+ <zip destfile="@{jarfile}" filesonly="true" >
<fileset dir="@{filesDir}">
<patternset refid="@{filesId}"/>
<!-- Javadoc exclusions -->
@@ -3299,9 +3309,10 @@ Read the Building page on the Apache Tomcat
documentation site for details on ho
</fileset>
<zipfileset dir="@{meta-inf}" prefix="META-INF/"
excludes=".gitignore" />
+ <zipfileset file="@{manifest}" fullpath="META-INF/MANIFEST.MF" />
<zipfileset file="@{notice}" fullpath="META-INF/NOTICE" />
<zipfileset file="@{license}" fullpath="META-INF/LICENSE" />
- </jar>
+ </zip>
</sequential>
</sequential>
</macrodef>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]