• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
18package {
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
58java_library_host {
59    name: "caliper",
60
61    srcs: ["caliper/src/main/java/**/*.java"],
62    java_resource_dirs: ["caliper/src/main/resources"],
63
64    static_libs: [
65        "apache-commons-math",
66        "caliper-prebuilts",
67        "dagger2",
68        "guava",
69        "jsr330",
70    ],
71
72    // Use Dagger2 annotation processor
73    plugins: ["dagger2-compiler"],
74
75    java_version: "1.8",
76}
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    ],
93    sdk_version: "core_current",
94
95    java_version: "1.8",
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
105java_test_host {
106    name: "caliper-tests",
107
108    srcs: ["caliper/src/test/java/**/*.java"],
109    java_resource_dirs: ["caliper/src/test/resources"],
110
111    static_libs: [
112        "caliper",
113        "junit",
114        "mockito",
115    ],
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    },
121
122    // Use Dagger2 annotation processor
123    plugins: ["dagger2-compiler"],
124
125    java_version: "1.8",
126}
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
142    java_version: "1.8",
143}
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}
164