blob: 14011171d71eda2c7e1cbeaec187f1f62acd3bac [file] [log] [blame]
Bob Badour36956682021-02-23 14:05:02 -08001package {
2 default_applicable_licenses: ["cts_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20 name: "cts_license",
21 visibility: [":__subpackages__"],
22 license_kinds: [
23 "SPDX-license-identifier-Apache-2.0",
24 "SPDX-license-identifier-BSD",
25 "SPDX-license-identifier-CC-BY",
26 "SPDX-license-identifier-MIT",
27 "SPDX-license-identifier-NCSA",
28 "legacy_unencumbered",
29 ],
30 // large-scale-change unable to identify any license_text files
31}
32
Colin Cross9db703b2018-08-10 14:11:59 -070033java_defaults {
34 name: "cts_error_prone_rules",
35 errorprone: {
36 javacflags: [
37 // Set of error prone rules to ensure code quality
38 // When updating this list, also update error_prone_rules.mk
39 "-Xep:ArrayToString:ERROR",
40 "-Xep:BoxedPrimitiveConstructor:ERROR",
41 "-Xep:ConstantField:ERROR",
42 "-Xep:EqualsIncompatibleType:ERROR",
43 "-Xep:FormatString:ERROR",
44 "-Xep:GetClassOnClass:ERROR",
45 "-Xep:IdentityBinaryExpression:ERROR",
46 "-Xep:JUnit3TestNotRun:ERROR",
47 "-Xep:JUnit4ClassUsedInJUnit3:ERROR",
48 "-Xep:JUnitAmbiguousTestClass:ERROR",
49 "-Xep:MissingFail:ERROR",
50 "-Xep:MissingOverride:ERROR",
51 "-Xep:Overrides:ERROR",
52 "-Xep:ReferenceEquality:ERROR",
53 "-Xep:RemoveUnusedImports:ERROR",
54 "-Xep:ReturnValueIgnored:ERROR",
55 "-Xep:SelfEquals:ERROR",
56 "-Xep:SizeGreaterThanOrEqualsZero:ERROR",
57 "-Xep:TryFailThrowable:ERROR",
58 ],
59 },
60}
61
62java_defaults {
63 name: "cts_error_prone_rules_tests",
64 errorprone: {
65 javacflags: [
66 // Set of error prone rules to ensure code quality of tests
67 // Goal is to eventually merge with cts_error_prone_rules
68 // When updating this list, also update error_prone_rules_tests.mk
69 "-Xep:ArrayToString:ERROR",
70 "-Xep:CollectionIncompatibleType:ERROR",
71 "-Xep:EqualsIncompatibleType:ERROR",
72 "-Xep:EqualsNaN:ERROR",
73 "-Xep:FormatString:ERROR",
74 "-Xep:IdentityBinaryExpression:ERROR",
75 "-Xep:JUnit3TestNotRun:ERROR",
76 "-Xep:JUnit4ClassUsedInJUnit3:ERROR",
77 "-Xep:JUnitAmbiguousTestClass:ERROR",
78 "-Xep:MissingFail:ERROR",
79 "-Xep:SizeGreaterThanOrEqualsZero:ERROR",
80 "-Xep:TryFailThrowable:ERROR",
81 ],
82 },
83}
Dan Willemsen168903e2019-01-15 14:29:19 -080084
85// Used with an android_test / android_test_helper_app, this is equivalent to
86// BUILD_CTS_SUPPORT_PACKAGE
87java_defaults {
88 name: "cts_support_defaults",
89 defaults: ["cts_error_prone_rules_tests"],
90 dex_preopt: {
91 enabled: false,
92 },
93 optimize: {
94 enabled: false,
95 },
96}
97
98// Used with different module types, this is equivalent to:
99// android_test: BUILD_CTS_PACKAGE
100// java_library: BUILD_CTS_TARGET_JAVA_LIBRARY
101// java_library_host: BUILD_CTS_HOST_JAVA_LIBRARY
102java_defaults {
103 name: "cts_defaults",
104 defaults: ["cts_support_defaults"],
105 target: {
106 android: {
107 static_libs: ["platform-test-annotations"],
108 },
109 },
110}