aboutsummaryrefslogtreecommitdiff
path: root/java/com/android/modules/utils/testing/Android.bp
blob: a9406d86923cd1ff245c5114e64eed64e93b14ed (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
//
// Copyright (C) 2021 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package {
    default_applicable_licenses: ["Android-Apache-2.0"],
}

java_library {
    name: "modules-utils-native-coverage-listener",
    srcs: ["NativeCoverageHackInstrumentationListener.java"],
    static_libs: [
        "androidx.test.rules",
    ],
    sdk_version: "test_current",
    min_sdk_version: "29",
    visibility: ["//visibility:public"],
}

// TODO(b/281577492): split in 2 (one for just ExtendedMockito stuff)
// NOTE: clients should depend on modules-utils-testable-device-config-defaults
// instead of using this library directly (so it sets the proper JNI dependencies)
java_library {
    name: "modules-utils-testable-device-config",
    srcs: [
        "AbstractExtendedMockitoRule.java",
        "StaticMockFixture.java",
        "ExtendedMockitoRule.java",
        "TestableDeviceConfig.java",
    ],
    static_libs: [
        "androidx.test.rules",
        "mockito-target-extended-minus-junit4",
        "modules-utils-build",
        "modules-utils-preconditions",
    ],
    libs: [
        "framework-configinfrastructure",
        "framework-annotations-lib",
    ],
    sdk_version: "module_current",
    min_sdk_version: "29",
    visibility: ["//visibility:public"],
}

// TODO(b/281577492): split in 2 (one for just ExtendedMockito stuff)
// Utility for mocking DeviceConfig and other device state.
// In order to use these utils successfully, both Java code and native libraries will be required.
// If your code is in a library, you will have to depend on these defaults both in the library as
// well as in the android_test that it gets linked into.
// You will also need to specify android:debuggable="true" in the test's manifest.
java_defaults {
    name: "modules-utils-testable-device-config-defaults",
    static_libs: ["modules-utils-testable-device-config"],
    compile_multilib: "both",
    jni_libs: [
        "libdexmakerjvmtiagent",
        "libstaticjvmtiagent",
    ],
    defaults_visibility: ["//visibility:public"],
}