Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 1 | // Copyright (C) 2015 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 | // build caliper host jar |
| 16 | // ============================================================ |
| 17 | |
Bob Badour | e2309a4 | 2021-02-12 20:14:05 -0800 | [diff] [blame] | 18 | package { |
| 19 | default_applicable_licenses: ["external_caliper_license"], |
| 20 | } |
| 21 | |
| 22 | // Added automatically by a large-scale-change that took the approach of |
| 23 | // 'apply every license found to every target'. While this makes sure we respect |
| 24 | // every license restriction, it may not be entirely correct. |
| 25 | // |
| 26 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 27 | // |
| 28 | // Please consider splitting the single license below into multiple licenses, |
| 29 | // taking care not to lose any license_kind information, and overriding the |
| 30 | // default license using the 'licenses: [...]' property on targets as needed. |
| 31 | // |
| 32 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 33 | // to attach the license to, and including a comment whether the files may be |
| 34 | // used in the current project. |
| 35 | // |
| 36 | // large-scale-change included anything that looked like it might be a license |
| 37 | // text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. |
| 38 | // |
| 39 | // Please consider removing redundant or irrelevant files from 'license_text:'. |
| 40 | // See: http://go/android-license-faq |
| 41 | license { |
| 42 | name: "external_caliper_license", |
| 43 | visibility: [":__subpackages__"], |
| 44 | license_kinds: [ |
| 45 | "SPDX-license-identifier-Apache-2.0", |
| 46 | "SPDX-license-identifier-CDDL", |
| 47 | "SPDX-license-identifier-CDDL-1.0", |
| 48 | "SPDX-license-identifier-GPL", |
| 49 | "SPDX-license-identifier-GPL-2.0", |
| 50 | "SPDX-license-identifier-LGPL", |
| 51 | ], |
| 52 | license_text: [ |
| 53 | "COPYING", |
| 54 | "NOTICE", |
| 55 | ], |
| 56 | } |
| 57 | |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 58 | java_library_host { |
| 59 | name: "caliper", |
| 60 | |
| 61 | srcs: ["caliper/src/main/java/**/*.java"], |
| 62 | java_resource_dirs: ["caliper/src/main/resources"], |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 63 | |
| 64 | static_libs: [ |
| 65 | "apache-commons-math", |
| 66 | "caliper-prebuilts", |
| 67 | "dagger2", |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 68 | "guava", |
Colin Cross | f0a3eaf | 2020-06-25 23:17:29 -0700 | [diff] [blame] | 69 | "jsr330", |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 70 | ], |
| 71 | |
| 72 | // Use Dagger2 annotation processor |
Colin Cross | 7b01129 | 2019-01-21 21:42:47 -0800 | [diff] [blame] | 73 | plugins: ["dagger2-compiler"], |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 74 | |
Colin Cross | 4d25eea | 2019-04-11 14:26:19 -0700 | [diff] [blame] | 75 | java_version: "1.8", |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | // build caliper target api jar |
| 79 | // ============================================================ |
| 80 | // This contains just those classes needed for benchmarks to compile. |
| 81 | |
| 82 | java_library { |
| 83 | name: "caliper-api-target", |
| 84 | installable: true, |
| 85 | |
| 86 | srcs: [ |
| 87 | "caliper/src/main/java/com/google/caliper/AfterExperiment.java", |
| 88 | "caliper/src/main/java/com/google/caliper/BeforeExperiment.java", |
| 89 | "caliper/src/main/java/com/google/caliper/Param.java", |
| 90 | "caliper/src/main/java/com/google/caliper/All.java", |
| 91 | "caliper/src/main/java/com/google/caliper/Benchmark.java", |
| 92 | ], |
Neil Fuller | 03996ba | 2018-10-10 15:30:52 +0100 | [diff] [blame] | 93 | sdk_version: "core_current", |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 94 | |
Colin Cross | 4d25eea | 2019-04-11 14:26:19 -0700 | [diff] [blame] | 95 | java_version: "1.8", |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | // build caliper tests |
| 99 | // ============================================================ |
| 100 | // vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \ |
| 101 | // --test-only \ |
| 102 | // --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \ |
| 103 | // com.google.caliper |
| 104 | |
| 105 | java_test_host { |
| 106 | name: "caliper-tests", |
| 107 | |
| 108 | srcs: ["caliper/src/test/java/**/*.java"], |
| 109 | java_resource_dirs: ["caliper/src/test/resources"], |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 110 | |
| 111 | static_libs: [ |
| 112 | "caliper", |
| 113 | "junit", |
| 114 | "mockito", |
| 115 | ], |
Julien Desprez | c584a57 | 2021-02-24 17:03:17 +0000 | [diff] [blame] | 116 | // Avoid the tests running as unit tests. They have some jar requirement that doesn't currently |
| 117 | // quite work in CI. |
| 118 | test_options: { |
| 119 | unit_test: false, |
| 120 | }, |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 121 | |
| 122 | // Use Dagger2 annotation processor |
Colin Cross | 7b01129 | 2019-01-21 21:42:47 -0800 | [diff] [blame] | 123 | plugins: ["dagger2-compiler"], |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 124 | |
Colin Cross | 4d25eea | 2019-04-11 14:26:19 -0700 | [diff] [blame] | 125 | java_version: "1.8", |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | // build caliper examples |
| 129 | // ============================================================ |
| 130 | |
| 131 | java_library_host { |
| 132 | name: "caliper-examples", |
| 133 | |
| 134 | srcs: ["examples/src/main/java/**/*.java"], |
| 135 | |
| 136 | static_libs: [ |
| 137 | "caliper", |
| 138 | "junit", |
| 139 | "mockito", |
| 140 | ], |
| 141 | |
Colin Cross | 4d25eea | 2019-04-11 14:26:19 -0700 | [diff] [blame] | 142 | java_version: "1.8", |
Colin Cross | b2679ae | 2018-09-11 22:39:33 -0700 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | // Build host dependencies. |
| 146 | // ============================================================ |
| 147 | |
| 148 | java_import_host { |
| 149 | name: "caliper-gson", |
| 150 | jars: ["lib/gson-2.2.2.jar"], |
| 151 | } |
| 152 | |
| 153 | java_import_host { |
| 154 | name: "caliper-prebuilts", |
| 155 | jars: [ |
| 156 | "lib/gson-2.2.2.jar", |
| 157 | "lib/java-allocation-instrumenter-2.0.jar", |
| 158 | "lib/jersey-client-1.11.jar", |
| 159 | "lib/jersey-core-1.11.jar", |
| 160 | "lib/joda-time-2.1.jar", |
| 161 | "lib/jsr311-api-1.1.1.jar", |
| 162 | ], |
| 163 | } |