Skip to content

Commit e3cee24

Browse files
committed
Enforce consistent formatting of .bp files
Test: attempt to checking in badly formatted .bp file Change-Id: I38bdbb478cf3d2ee2e724b7d73000a000e9a6e5c
1 parent dc9e306 commit e3cee24

File tree

3 files changed

+54
-46
lines changed

3 files changed

+54
-46
lines changed

Android.bp

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ cc_library {
6767
export_include_dirs: [
6868
"include",
6969
"header_only_include",
70-
"platform_include"
70+
"platform_include",
7171
],
7272
stubs: {
7373
symbol_file: "libnativehelper.map.txt",

PREUPLOAD.cfg

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[Builtin Hooks]
2+
bpfmt = true

tests/Android.bp

+51-45
Original file line numberDiff line numberDiff line change
@@ -5,70 +5,76 @@ cc_test {
55
test_suites: ["device-tests"],
66
host_supported: true,
77
srcs: ["JniInvocation_test.cpp"],
8-
cflags: ["-Wall", "-Werror"],
8+
cflags: [
9+
"-Wall",
10+
"-Werror",
11+
],
912
// Link to the non-stub version of the library to access some internal
1013
// functions.
1114
bootstrap: true,
1215
shared_libs: ["libnativehelper"],
1316
}
1417

1518
cc_test {
16-
name: "JniSafeRegisterNativeMethods_test",
17-
host_supported: true,
18-
srcs: ["JniSafeRegisterNativeMethods_test.cpp"],
19+
name: "JniSafeRegisterNativeMethods_test",
20+
host_supported: true,
21+
srcs: ["JniSafeRegisterNativeMethods_test.cpp"],
1922

20-
cflags: [
21-
// Base set of cflags used by all things ART.
22-
"-fno-rtti",
23-
"-ggdb3",
24-
"-Wall",
25-
"-Werror",
26-
"-Wextra",
27-
"-Wstrict-aliasing",
28-
"-fstrict-aliasing",
29-
"-Wunreachable-code",
30-
"-Wredundant-decls",
31-
"-Wshadow",
32-
"-Wunused",
33-
"-fvisibility=protected",
23+
cflags: [
24+
// Base set of cflags used by all things ART.
25+
"-fno-rtti",
26+
"-ggdb3",
27+
"-Wall",
28+
"-Werror",
29+
"-Wextra",
30+
"-Wstrict-aliasing",
31+
"-fstrict-aliasing",
32+
"-Wunreachable-code",
33+
"-Wredundant-decls",
34+
"-Wshadow",
35+
"-Wunused",
36+
"-fvisibility=protected",
3437

35-
// Warn about thread safety violations with clang.
36-
"-Wthread-safety",
37-
"-Wthread-safety-negative",
38+
// Warn about thread safety violations with clang.
39+
"-Wthread-safety",
40+
"-Wthread-safety-negative",
3841

39-
// Warn if switch fallthroughs aren't annotated.
40-
"-Wimplicit-fallthrough",
42+
// Warn if switch fallthroughs aren't annotated.
43+
"-Wimplicit-fallthrough",
4144

42-
// Enable float equality warnings.
43-
"-Wfloat-equal",
45+
// Enable float equality warnings.
46+
"-Wfloat-equal",
4447

45-
// Enable warning of converting ints to void*.
46-
"-Wint-to-void-pointer-cast",
48+
// Enable warning of converting ints to void*.
49+
"-Wint-to-void-pointer-cast",
4750

48-
// Enable warning of wrong unused annotations.
49-
"-Wused-but-marked-unused",
51+
// Enable warning of wrong unused annotations.
52+
"-Wused-but-marked-unused",
5053

51-
// Enable warning for deprecated language features.
52-
"-Wdeprecated",
54+
// Enable warning for deprecated language features.
55+
"-Wdeprecated",
5356

54-
// Enable warning for unreachable break & return.
55-
"-Wunreachable-code-break",
56-
"-Wunreachable-code-return",
57+
// Enable warning for unreachable break & return.
58+
"-Wunreachable-code-break",
59+
"-Wunreachable-code-return",
5760

58-
// Enable thread annotations for std::mutex, etc.
59-
"-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
60-
],
61+
// Enable thread annotations for std::mutex, etc.
62+
"-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS",
63+
],
6164

62-
tidy: true,
65+
tidy: true,
6366

64-
shared_libs: ["libnativehelper"],
67+
shared_libs: ["libnativehelper"],
6568
}
6669

6770
cc_test {
68-
name: "libnativehelper_api_test",
69-
host_supported: true,
70-
cflags: ["-Wall", "-Werror"],
71-
srcs: ["libnativehelper_api_test.c"], // C Compilation test.
72-
tidy: true,
73-
shared_libs: ["libnativehelper"],
71+
name: "libnativehelper_api_test",
72+
host_supported: true,
73+
cflags: [
74+
"-Wall",
75+
"-Werror",
76+
],
77+
srcs: ["libnativehelper_api_test.c"], // C Compilation test.
78+
tidy: true,
79+
shared_libs: ["libnativehelper"],
7480
}

0 commit comments

Comments
 (0)