about summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks/strip-java-archives.sh
blob: 22322468f76dd89a52ce9d72b6989223ab249d18 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# This setup hook makes the fixup phase to repack all java archives in a
# deterministic fashion. The most important change being done is the resetting
# of the modification times of the archive entries

fixupOutputHooks+=('stripJavaArchivesIn $prefix')

stripJavaArchivesIn() {
    local dir="$1"
    echo "stripping java archives in $dir"
    find $dir -type f -regextype posix-egrep -regex ".*\.(jar|war|hpi|apk)$" -print0 |
    while IFS= read -rd '' f; do
        echo "stripping java archive $f"
        strip-nondeterminism --type jar "$f"
    done
}