aboutsummaryrefslogtreecommitdiff
path: root/test/rules/android_binary_internal/r8_integration/java/com/basicapp/BUILD
blob: 47278877842deae4af2b3aad36e97d4a3d59c0d3 (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
load("//rules:rules.bzl", "android_binary", "android_library")

[
    android_binary(
        name = name,
        srcs = ["BasicActivity.java"],
        manifest = "AndroidManifest.xml",
        min_sdk_version = 27,
        proguard_specs = specs,
        resource_files = glob(["res/**"]),
        shrink_resources = shrink,
        visibility = ["//test/rules/android_binary_internal/r8_integration:__pkg__"],
        deps = [
            ":basic_lib",
            ":lib_with_specs",
        ],
        # Work around --java_runtime_version=17 and --java_language_version=11
        # set in the presubmit tests.
        javacopts = ["-target", "8", "-source", "8"],
    )
    for name, specs, shrink in [
        (
            "basic_app_R8_shrink",
            ["proguard.cfg"],
            True,
        ),
        (
            "basic_app_R8_no_shrink",
            ["proguard.cfg"],
            False,
        ),
        ("basic_app_no_R8", [], False),
    ]
]

android_library(
    name = "basic_lib",
    srcs = ["UnusedActivity.java"],
    manifest = "AndroidManifest_lib.xml",
    resource_files = glob(["res_lib/**"]),
)

android_library(
    name = "lib_with_specs",
    srcs = ["LibWithSpecsActivity.java"],
    manifest = "AndroidManifest_lib.xml",
    proguard_specs = ["lib_proguard.cfg"],
    deps = [":lib2_with_specs"],
)

android_library(
    name = "lib2_with_specs",
    srcs = ["Lib2WithSpecsActivity.java"],
    manifest = "AndroidManifest_lib.xml",
    proguard_specs = ["lib2_proguard.cfg"],
)