[Git][reproducible-builds/reproducible-website][master] Fix Gradle example for file permissions
Chris Lamb (@lamby)
gitlab at salsa.debian.org
Sat Dec 6 19:29:04 UTC 2025
Chris Lamb pushed to branch master at Reproducible Builds / reproducible-website
Commits:
5927908c by Robert Stupp at 2025-12-06T13:11:14+01:00
Fix Gradle example for file permissions
The existing example would (accidentally) lead to `644` POSIX permissions, although the comment says the opposite.
This change fixes the example.
- - - - -
1 changed file:
- _docs/jvm.md
Changes:
=====================================
_docs/jvm.md
=====================================
@@ -74,7 +74,7 @@ Gradle supports [reproducible archives](https://docs.gradle.org/current/userguid
Tasks which generate archives, such as ZIPs, JARs or Tarballs, can enforce preserved file timestamps and reproducible file order which fix two of the main sources of non-determinism in JVM artifacts.
Consider setting `dirPermissions` and `filePermissions` to adjust environment specific `umask` settings.
-### Gradle reproducible archives example
+#### Gradle reproducible archives example
```kotlin
// This is applied to all Jar, Zip and Tar tasks.
@@ -84,13 +84,12 @@ tasks.withType<AbstractArchiveTask>().configureEach {
// consistent directory permissions, ignoring system's umask
dirPermissions { unix("755") }
// consistent file permissions, ignoring system's umask, retaining the executable permission (either 644 or 755)
- filePermissions {
- user.read = true
- user.write = true
- group.read = true
- group.write = false
- other.read = true
- other.write = false
+ eachFile {
+ permissions {
+ val isExec =
+ Files.getPosixFilePermissions(file.toPath()).contains(PosixFilePermission.OWNER_EXECUTE)
+ unix(if (isExec) "755" else "644")
+ }
}
}
```
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/-/commit/5927908c714f892051549a3b100db09f286b3273
--
View it on GitLab: https://salsa.debian.org/reproducible-builds/reproducible-website/-/commit/5927908c714f892051549a3b100db09f286b3273
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20251206/cf5d4cf8/attachment.htm>
More information about the rb-commits
mailing list