Currently when a directory path is specified bpfmt only processes files
named "Blueprints" so change this to also process files with a `.bp`
suffix.
Test: Manual + bpfmt -d frameworks/base/services shows differences
Change-Id: I5a6356f387892934ee8e83362db13cda6156ed51
Signed-off-by: Rashid Zaman <rashidz@meta.com>
Previously, an incantation like `bpfmt -o <$BAD_BP` would print to
stderr as expected, but then it would exit with 0. This is different
than the behavior of `bpfmt -o $BAD_BP`, which correctly exits with a
non-zero status code (in addition to printing the issues to stderr).
Test: m bpfmt; out/soong/host/linux-x86/bin/bpfmt -o <$BAD_BP; echo $?
Change-Id: I0a970cddf94fbd818525f9167d9113086b023c81
bpfmt was always exiting with return code 0, make it use the
exitCode recorded when reporting errors.
Also use the usage function.
Test: bpfmt -o bpfmt.go
Test: bpfmt
Test: bpfmt -h
Fixes: 113069050
Change-Id: I717d524c5f43cd36f52e33964a37324cc04c5df0
This is partially in hopes of making it generally easier to use, and
partially in hopes of specifically making it less tempting to do
bpfmt Android.bp > Android.bp
which actually would just erase the contents of Android.bp
Test: bpfmt Android.bp 2>&1 | grep usage && echo ok
Bug: 67326589
Change-Id: I41c23aca6214f27dbdf55e5931f9392c318e82ed
Make integrating with go tools easier by putting the blueprint package
files in the top level directory of the git project instead of in a
subdirectory called blueprint.
Change-Id: I35c144c5fe7ddf34e478d0c47c50b2f6c92c2a03