• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2013 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// Builds the Mockito source code, but does not include any run-time
18// dependencies. Most projects should use mockito-target instead, which includes
19// everything needed to run Mockito tests.
20java_library_static {
21    name: "mockito",
22    host_supported: true,
23    hostdex: true,
24    srcs: ["src/main/java/**/*.java"],
25
26    libs: [
27        "junit",
28        "objenesis",
29    ],
30
31    target: {
32        android: {
33            // Exclude source used to dynamically create classes since target builds use
34            // dexmaker instead and including it causes conflicts.
35            exclude_srcs: [
36                "src/main/java/org/mockito/internal/creation/bytebuddy/**/*.java",
37            ],
38        },
39        host: {
40            static_libs: [
41                "mockito-byte-buddy",
42                "mockito-byte-buddy-agent",
43            ],
44        },
45    },
46    sdk_version: "core_current",
47    java_version: "1.7",
48
49    errorprone: {
50        javacflags: [
51            "-Xep:CollectionIncompatibleType:WARN",  // b/74213384
52        ],
53    }
54}
55
56// Compatibility library for old name of host target
57java_library_host {
58    name: "mockito-host",
59    static_libs: ["mockito"],
60}
61
62// Compatibility library for old name of api target
63java_library_static {
64    name: "mockito-api",
65    hostdex: true,
66    static_libs: ["mockito"],
67    sdk_version: "core_current",
68}
69
70// Compatibility library for old name of host target
71java_library_host {
72    name: "mockito-inline",
73    static_libs: ["mockito"],
74    java_resource_dirs: ["subprojects/inline/src/main/resources"],
75}
76
77// Host prebuilt dependencies.
78// ============================================================
79java_import_host {
80    name: "mockito-byte-buddy",
81    jars: ["lib/byte-buddy-1.8.15.jar"],
82}
83
84java_import_host {
85    name: "mockito-byte-buddy-agent",
86    jars: ["lib/byte-buddy-agent-1.8.15.jar"],
87}
88
89