summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PREUPLOAD.cfg2
-rwxr-xr-xtools/check-bpfmt.sh7
2 files changed, 5 insertions, 4 deletions
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index 24292c1b61..dfb0bc72d3 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -10,4 +10,4 @@ checkstyle-luni-json-xml = java -jar ${REPO_ROOT}/prebuilts/checkstyle/checkstyl
checkstyle-ojluni = java -jar ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.jar -c tools/checkstyle/checkstyle-forbid-apache.xml ojluni/src/main/java
# Ensure that bp files are correctly formatted:
-bpfmt-check = tools/check-bpfmt.sh ${PREUPLOAD_COMMIT}
+bpfmt-check = tools/check-bpfmt.sh ${REPO_ROOT}/prebuilts/build-tools/${BUILD_OS}/bin/bpfmt ${PREUPLOAD_COMMIT}
diff --git a/tools/check-bpfmt.sh b/tools/check-bpfmt.sh
index 8ca1df51fa..91dae79f9a 100755
--- a/tools/check-bpfmt.sh
+++ b/tools/check-bpfmt.sh
@@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-SHA=$1
+BPFMT=$1
+SHA=$2
FIX=
for file in $(git show --name-only --pretty=format: $SHA | grep -E "\.bp$"); do
- if [[ -n "$(bpfmt -d <(git show $SHA:$file))" ]]; then
+ if [[ -n "$(${BPFMT} -d <(git show $SHA:$file))" ]]; then
FIX="$FIX $file"
fi
done
@@ -27,6 +28,6 @@ if [[ -n "$FIX" ]]; then
# Remove leading space.
FIX=$(echo $FIX)
echo -e "\e[1m\e[31mSome .bp files are incorrectly formatted, run the following commands to fix them:\e[0m"
- echo -e "\e[1m\e[31m bpfmt -w $FIX\e[0m"
+ echo -e "\e[1m\e[31m ${BPFMT} -w $FIX\e[0m"
exit 1
fi