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