blob: 8590039da18e6b1eec73a171c9c742dded1bcbfd [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
18java_library_host {
19 name: "caliper",
20
21 srcs: ["caliper/src/main/java/**/*.java"],
22 java_resource_dirs: ["caliper/src/main/resources"],
23 // Required for use of javax.annotation.Generated per http://b/62050818
24 javacflags: ["-J--add-modules=java.xml.ws.annotation"],
25
26 static_libs: [
27 "apache-commons-math",
28 "caliper-prebuilts",
29 "dagger2",
30 "dagger2-inject",
31 "guava",
32 ],
33
34 // Use Dagger2 annotation processor
35 annotation_processors: ["dagger2-compiler"],
36 annotation_processor_classes: ["dagger.internal.codegen.ComponentProcessor"],
37
38 java_version: "1.7",
39}
40
41// build caliper target api jar
42// ============================================================
43// This contains just those classes needed for benchmarks to compile.
44
45java_library {
46 name: "caliper-api-target",
47 installable: true,
48
49 srcs: [
50 "caliper/src/main/java/com/google/caliper/AfterExperiment.java",
51 "caliper/src/main/java/com/google/caliper/BeforeExperiment.java",
52 "caliper/src/main/java/com/google/caliper/Param.java",
53 "caliper/src/main/java/com/google/caliper/All.java",
54 "caliper/src/main/java/com/google/caliper/Benchmark.java",
55 ],
Neil Fuller03996ba2018-10-10 15:30:52 +010056 sdk_version: "core_current",
Colin Crossb2679ae2018-09-11 22:39:33 -070057
58 java_version: "1.7",
59}
60
61// build caliper tests
62// ============================================================
63// vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \
64// --test-only \
65// --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \
66// com.google.caliper
67
68java_test_host {
69 name: "caliper-tests",
70
71 srcs: ["caliper/src/test/java/**/*.java"],
72 java_resource_dirs: ["caliper/src/test/resources"],
73 // Required for use of javax.annotation.Generated per http://b/62050818
74 javacflags: ["-J--add-modules=java.xml.ws.annotation"],
75
76 static_libs: [
77 "caliper",
78 "junit",
79 "mockito",
80 ],
81
82 // Use Dagger2 annotation processor
83 annotation_processors: ["dagger2-compiler"],
84 annotation_processor_classes: ["dagger.internal.codegen.ComponentProcessor"],
85
86 java_version: "1.7",
87}
88
89// build caliper examples
90// ============================================================
91
92java_library_host {
93 name: "caliper-examples",
94
95 srcs: ["examples/src/main/java/**/*.java"],
96
97 static_libs: [
98 "caliper",
99 "junit",
100 "mockito",
101 ],
102
103 java_version: "1.7",
104}
105
106// Build host dependencies.
107// ============================================================
108
109java_import_host {
110 name: "caliper-gson",
111 jars: ["lib/gson-2.2.2.jar"],
112}
113
114java_import_host {
115 name: "caliper-prebuilts",
116 jars: [
117 "lib/gson-2.2.2.jar",
118 "lib/java-allocation-instrumenter-2.0.jar",
119 "lib/jersey-client-1.11.jar",
120 "lib/jersey-core-1.11.jar",
121 "lib/joda-time-2.1.jar",
122 "lib/jsr311-api-1.1.1.jar",
123 ],
124}