gerrit/Documentation/check_licenses_test.sh
Han-Wen Nienhuys 0a6495efc9 Documentation: check in (js_)licenses.txt
Add a test that ensures that the checked in version is up to date.

The license generation is tied closely to the Bazel build and the
layout of the Gerrit source tree.

By checking in the license files, alternative builds (such as the
Google internal build) do not have to replicate the license
generation step, or rerun the upstream Gerrit bazel build.

Change-Id: I500717e38de6c337ce552815e46562648df48b2f
2019-03-28 15:45:58 +00:00

16 lines
399 B
Bash
Executable File

#!/bin/sh
hook=$(pwd)/resources/com/google/gerrit/server/tools/root/hooks/commit-msg
for f in js_licenses licenses ; do
if ! diff -u Documentation/${f}.txt Documentation/${f}.gen.txt ; then
echo ""
echo "FAIL: ${f}.txt out of date"
echo "to fix: "
echo ""
echo " cp bazel-genfiles/Documentation/${f}.gen.txt Documentation/${f}.txt"
echo ""
exit 1
fi
done