Skip to content

Commit 21edbdf

Browse files
committed
README.md: Add a section about reproducible builds
1 parent 372dc48 commit 21edbdf

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

+18
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,24 @@ Building with Apache Ant
3232
* Type `ant doc` to build the javadoc HTML documentation.
3333
* Type `ant -projecthelp` to see all available targets.
3434

35+
### Reproducible builds
36+
37+
Reproducible builds should be possible. A timestamp needs to be
38+
specified which will be used for file modification times in the
39+
JAR metadata. The timestamps are stored using the local timezone,
40+
thus it's good to override it to GMT/UTC. On POSIX systems, the
41+
following commands are equivalent:
42+
43+
$ ANT_OPTS=-Duser.timezone=GMT \
44+
ant -Dant.tstamp.now.iso=2024-07-29T14:10:26Z
45+
46+
$ SOURCE_DATE_EPOCH=1722262226 TZ=UTC0 ant
47+
48+
When the Git repository is available, using the committer date
49+
is one way to get a reasonable value:
50+
51+
$ SOURCE_DATE_EPOCH=$(git log -n1 --pretty=%ct) TZ=UTC0 ant
52+
3553
### Old build environments
3654

3755
* If you are using Ant older than 1.10.2:

0 commit comments

Comments
 (0)