Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 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. |
| 20 | java_library_static { |
| 21 | name: "mockito", |
| 22 | host_supported: true, |
| 23 | hostdex: true, |
| 24 | no_framework_libs: true, |
| 25 | srcs: ["src/main/java/**/*.java"], |
| 26 | |
| 27 | libs: [ |
| 28 | "junit", |
| 29 | "objenesis", |
| 30 | ], |
| 31 | |
| 32 | target: { |
| 33 | android: { |
| 34 | // Exclude source used to dynamically create classes since target builds use |
| 35 | // dexmaker instead and including it causes conflicts. |
Philip P. Moltmann | 3604852 | 2017-11-20 15:13:48 -0800 | [diff] [blame] | 36 | exclude_srcs: [ |
| 37 | "src/main/java/org/mockito/internal/creation/bytebuddy/**/*.java", |
| 38 | ], |
Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 39 | }, |
| 40 | host: { |
| 41 | static_libs: [ |
| 42 | "mockito-byte-buddy", |
| 43 | "mockito-byte-buddy-agent", |
| 44 | ], |
| 45 | }, |
| 46 | }, |
Neil Fuller | fa42ce4 | 2018-10-09 17:33:22 +0100 | [diff] [blame] | 47 | sdk_version: "core_current", |
Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 48 | java_version: "1.7", |
Andreas Gampe | 42004bd | 2018-03-05 18:40:12 -0800 | [diff] [blame] | 49 | |
| 50 | errorprone: { |
| 51 | javacflags: [ |
| 52 | "-Xep:CollectionIncompatibleType:WARN", // b/74213384 |
| 53 | ], |
| 54 | } |
Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 55 | } |
| 56 | |
| 57 | // Compatibility library for old name of host target |
| 58 | java_library_host { |
| 59 | name: "mockito-host", |
| 60 | static_libs: ["mockito"], |
| 61 | } |
| 62 | |
| 63 | // Compatibility library for old name of api target |
| 64 | java_library_static { |
| 65 | name: "mockito-api", |
| 66 | hostdex: true, |
| 67 | no_framework_libs: true, |
| 68 | static_libs: ["mockito"], |
Neil Fuller | fa42ce4 | 2018-10-09 17:33:22 +0100 | [diff] [blame] | 69 | sdk_version: "core_current", |
Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 70 | } |
| 71 | |
Philip P. Moltmann | 977c6af | 2017-12-14 13:21:55 -0800 | [diff] [blame] | 72 | // Compatibility library for old name of host target |
| 73 | java_library_host { |
| 74 | name: "mockito-inline", |
| 75 | static_libs: ["mockito"], |
| 76 | java_resource_dirs: ["subprojects/inline/src/main/resources"], |
| 77 | } |
| 78 | |
Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 79 | // Host prebuilt dependencies. |
| 80 | // ============================================================ |
| 81 | java_import_host { |
| 82 | name: "mockito-byte-buddy", |
Philip P. Moltmann | 5bee1de | 2018-09-06 15:11:17 -0700 | [diff] [blame] | 83 | jars: ["lib/byte-buddy-1.8.15.jar"], |
Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 84 | } |
| 85 | |
| 86 | java_import_host { |
| 87 | name: "mockito-byte-buddy-agent", |
Philip P. Moltmann | 5bee1de | 2018-09-06 15:11:17 -0700 | [diff] [blame] | 88 | jars: ["lib/byte-buddy-agent-1.8.15.jar"], |
Colin Cross | 56a9170 | 2017-10-18 13:00:38 -0700 | [diff] [blame] | 89 | } |
| 90 | |