Skip to content

Commit

Permalink
README.md: Add a section about reproducible builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Larhzu committed Jul 29, 2024
1 parent 372dc48 commit 21edbdf
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@ Building with Apache Ant
* Type `ant doc` to build the javadoc HTML documentation.
* Type `ant -projecthelp` to see all available targets.

### Reproducible builds

Reproducible builds should be possible. A timestamp needs to be
specified which will be used for file modification times in the
JAR metadata. The timestamps are stored using the local timezone,
thus it's good to override it to GMT/UTC. On POSIX systems, the
following commands are equivalent:

$ ANT_OPTS=-Duser.timezone=GMT \
ant -Dant.tstamp.now.iso=2024-07-29T14:10:26Z

$ SOURCE_DATE_EPOCH=1722262226 TZ=UTC0 ant

When the Git repository is available, using the committer date
is one way to get a reasonable value:

$ SOURCE_DATE_EPOCH=$(git log -n1 --pretty=%ct) TZ=UTC0 ant

### Old build environments

* If you are using Ant older than 1.10.2:
Expand Down

0 comments on commit 21edbdf

Please sign in to comment.