xref: /aosp_15_r20/external/junit-params/Android.bp (revision b2c653efad15baf736c94ef04454e05088f2cbb7)
1// Copyright (C) 2016 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15//
16
17//-------------------------------
18// build a target jar
19
20package {
21    default_applicable_licenses: ["external_junit-params_license"],
22}
23
24// Added automatically by a large-scale-change
25// See: http://go/android-license-faq
26license {
27    name: "external_junit-params_license",
28    visibility: [":__subpackages__"],
29    license_kinds: [
30        "SPDX-license-identifier-Apache-2.0",
31    ],
32    license_text: [
33        "LICENSE.txt",
34    ],
35}
36
37java_library {
38    name: "junit-params",
39    host_supported: true,
40    hostdex: true,
41    srcs: ["src/main/java/**/*.java"],
42    sdk_version: "core_current",
43    static_libs: ["junit"],
44    // b/267831518: Pin tradefed and dependencies to Java 11.
45    java_version: "11",
46}
47
48// compatibility host library with old name
49java_library_host {
50    name: "junit-params-host",
51    static_libs: ["junit-params"],
52}
53
54//-------------------------------
55// build test jars
56//
57// Run the target test jar as follows:
58//   vogar --classpath \
59//     ${ANDROID_PRODUCT_OUT}/obj/JAVA_LIBRARIES/junit-params-test_intermediates/javalib.jar \
60//     junitparams
61
62java_test {
63    name: "junit-params-test",
64    host_supported: true,
65    // Don't consider those unit tests, they would be hard to maintain since they are
66    // from external, and have dependencies on the junit version.
67    test_options: {
68        unit_test: false,
69    },
70    srcs: ["src/test/java/**/*.java"],
71    java_resource_dirs: ["src/test/resources"],
72    sdk_version: "core_current",
73    static_libs: [
74        "junit-params",
75        "junit-params-assertj-core",
76    ],
77    errorprone: {
78        javacflags: [
79            "-Xep:JUnitParameterMethodNotFound:WARN",
80        ],
81    },
82}
83
84//-------------------------------
85// prebuilt dependencies
86
87java_import {
88    name: "junit-params-assertj-core",
89    jars: ["lib/assertj-core-1.7.1.jar"],
90    host_supported: true,
91}
92