summaryrefslogtreecommitdiff
path: root/Android.bp
blob: 0598d5dcc55bf0fe4a21ad1288c0ef11739d3f4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package {
    // See: http://go/android-license-faq
    default_applicable_licenses: ["Android-Apache-2.0"],
}

java_defaults {
    name: "cts_error_prone_rules",
    errorprone: {
        javacflags: [
            // Set of error prone rules to ensure code quality
            // When updating this list, also update error_prone_rules.mk
            "-Xep:ArrayToString:ERROR",
            "-Xep:BoxedPrimitiveConstructor:ERROR",
            "-Xep:ConstantField:ERROR",
            "-Xep:EqualsIncompatibleType:ERROR",
            "-Xep:FormatString:ERROR",
            "-Xep:GetClassOnClass:ERROR",
            "-Xep:IdentityBinaryExpression:ERROR",
            "-Xep:JUnit3TestNotRun:ERROR",
            "-Xep:JUnit4ClassUsedInJUnit3:ERROR",
            "-Xep:JUnitAmbiguousTestClass:ERROR",
            "-Xep:MissingFail:ERROR",
            "-Xep:MissingOverride:ERROR",
            "-Xep:Overrides:ERROR",
            "-Xep:ReferenceEquality:ERROR",
            "-Xep:RemoveUnusedImports:ERROR",
            "-Xep:ReturnValueIgnored:ERROR",
            "-Xep:SelfEquals:ERROR",
            "-Xep:SizeGreaterThanOrEqualsZero:ERROR",
            "-Xep:TryFailThrowable:ERROR",
        ],
    },
}

java_defaults {
    name: "cts_error_prone_rules_tests",
    errorprone: {
        javacflags: [
            // Set of error prone rules to ensure code quality of tests
            // Goal is to eventually merge with cts_error_prone_rules
            // When updating this list, also update error_prone_rules_tests.mk
            "-Xep:ArrayToString:ERROR",
            "-Xep:CollectionIncompatibleType:ERROR",
            "-Xep:EqualsIncompatibleType:ERROR",
            "-Xep:EqualsNaN:ERROR",
            "-Xep:FormatString:ERROR",
            "-Xep:IdentityBinaryExpression:ERROR",
            "-Xep:JUnit3TestNotRun:ERROR",
            "-Xep:JUnit4ClassUsedInJUnit3:ERROR",
            "-Xep:JUnitAmbiguousTestClass:ERROR",
            "-Xep:MissingFail:ERROR",
            "-Xep:SizeGreaterThanOrEqualsZero:ERROR",
            "-Xep:TryFailThrowable:ERROR",
        ],
    },
}

// Used with an android_test / android_test_helper_app, this is equivalent to
// BUILD_CTS_SUPPORT_PACKAGE
java_defaults {
    name: "cts_support_defaults",
    defaults: ["cts_error_prone_rules_tests"],
    dex_preopt: {
        enabled: false,
    },
    optimize: {
        enabled: false,
    },
}

// Used with different module types, this is equivalent to:
//   android_test: BUILD_CTS_PACKAGE
//   java_library: BUILD_CTS_TARGET_JAVA_LIBRARY
//   java_library_host: BUILD_CTS_HOST_JAVA_LIBRARY
java_defaults {
    name: "cts_defaults",
    defaults: ["cts_support_defaults"],
    target: {
        android: {
            static_libs: ["platform-test-annotations"],
        },
    },
}

java_defaults {
    name: "mts-target-sdk-version-current",
    target_sdk_version: "10000",
}