blob: 6d4619bf10ec60f444089f3da7a648dbbed12b07 [file] [log] [blame]
Colin Crossb2679ae2018-09-11 22:39:33 -07001// 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 Badoure2309a42021-02-12 20:14:05 -080018package {
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
41license {
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 Crossb2679ae2018-09-11 22:39:33 -070058java_library_host {
59 name: "caliper",
60
61 srcs: ["caliper/src/main/java/**/*.java"],
62 java_resource_dirs: ["caliper/src/main/resources"],
Colin Crossb2679ae2018-09-11 22:39:33 -070063
64 static_libs: [
65 "apache-commons-math",
66 "caliper-prebuilts",
67 "dagger2",
Colin Crossb2679ae2018-09-11 22:39:33 -070068 "guava",
Colin Crossf0a3eaf2020-06-25 23:17:29 -070069 "jsr330",
Colin Crossb2679ae2018-09-11 22:39:33 -070070 ],
71
72 // Use Dagger2 annotation processor
Colin Cross7b011292019-01-21 21:42:47 -080073 plugins: ["dagger2-compiler"],
Colin Crossb2679ae2018-09-11 22:39:33 -070074
Colin Cross4d25eea2019-04-11 14:26:19 -070075 java_version: "1.8",
Colin Crossb2679ae2018-09-11 22:39:33 -070076}
77
78// build caliper target api jar
79// ============================================================
80// This contains just those classes needed for benchmarks to compile.
81
82java_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 Fuller03996ba2018-10-10 15:30:52 +010093 sdk_version: "core_current",
Colin Crossb2679ae2018-09-11 22:39:33 -070094
Colin Cross4d25eea2019-04-11 14:26:19 -070095 java_version: "1.8",
Colin Crossb2679ae2018-09-11 22:39:33 -070096}
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
105java_test_host {
106 name: "caliper-tests",
107
108 srcs: ["caliper/src/test/java/**/*.java"],
109 java_resource_dirs: ["caliper/src/test/resources"],
Colin Crossb2679ae2018-09-11 22:39:33 -0700110
111 static_libs: [
112 "caliper",
113 "junit",
114 "mockito",
115 ],
Julien Desprezc584a572021-02-24 17:03:17 +0000116 // 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 Crossb2679ae2018-09-11 22:39:33 -0700121
122 // Use Dagger2 annotation processor
Colin Cross7b011292019-01-21 21:42:47 -0800123 plugins: ["dagger2-compiler"],
Colin Crossb2679ae2018-09-11 22:39:33 -0700124
Colin Cross4d25eea2019-04-11 14:26:19 -0700125 java_version: "1.8",
Colin Crossb2679ae2018-09-11 22:39:33 -0700126}
127
128// build caliper examples
129// ============================================================
130
131java_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 Cross4d25eea2019-04-11 14:26:19 -0700142 java_version: "1.8",
Colin Crossb2679ae2018-09-11 22:39:33 -0700143}
144
145// Build host dependencies.
146// ============================================================
147
148java_import_host {
149 name: "caliper-gson",
150 jars: ["lib/gson-2.2.2.jar"],
151}
152
153java_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}