blob: f07f53486f05aa0cf180b169cef76f4e7922a95f [file] [log] [blame]
Paul Duffinfb58c0d2015-11-11 14:37:37 +00001# Copyright (C) 2015 The Android Open Source Project
Paul Duffin7fc0b452015-11-10 17:45:15 +00002#
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
15LOCAL_PATH := $(call my-dir)
16
Paul Duffin5b4f7282015-11-20 11:11:31 +000017# build caliper host jar
Paul Duffin7fc0b452015-11-10 17:45:15 +000018# ============================================================
19
20include $(CLEAR_VARS)
21
Paul Duffin5b4f7282015-11-20 11:11:31 +000022LOCAL_MODULE := caliper-host
Paul Duffin7fc0b452015-11-10 17:45:15 +000023LOCAL_MODULE_TAGS := optional
24LOCAL_MODULE_CLASS := JAVA_LIBRARIES
25LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/main/java/)
26LOCAL_JAVA_RESOURCE_DIRS := caliper/src/main/resources
Tobias Thierer55f01c32017-05-17 16:54:43 +010027# Required for use of javax.annotation.Generated per http://b/62050818
Tobias Thierer06f9aae2017-11-15 21:08:26 +000028LOCAL_JAVACFLAGS := $(if $(USE_OPENJDK9),-J--add-modules=java.xml.ws.annotation)
Paul Duffine2363012015-11-30 16:20:41 +000029LOCAL_IS_HOST_MODULE := true
Paul Duffin7fc0b452015-11-10 17:45:15 +000030
31LOCAL_STATIC_JAVA_LIBRARIES := \
Paul Duffine2363012015-11-30 16:20:41 +000032 apache-commons-math-host \
Paul Duffin5b4f7282015-11-20 11:11:31 +000033 caliper-gson-host \
34 caliper-java-allocation-instrumenter-host \
Paul Duffine2363012015-11-30 16:20:41 +000035 caliper-jersey-client-host \
36 caliper-jersey-core-host \
37 caliper-joda-time-host \
38 caliper-jsr311-api-host \
39 dagger2-host \
40 dagger2-inject-host \
Paul Duffin5b4f7282015-11-20 11:11:31 +000041 guavalib
Paul Duffin7fc0b452015-11-10 17:45:15 +000042
Paul Duffine2363012015-11-30 16:20:41 +000043# Use Dagger2 annotation processor
Colin Cross8e31c102017-04-07 16:31:28 -070044LOCAL_ANNOTATION_PROCESSORS := dagger2-compiler-host
45LOCAL_ANNOTATION_PROCESSOR_CLASSES := dagger.internal.codegen.ComponentProcessor
Paul Duffine2363012015-11-30 16:20:41 +000046
Neil Fuller6a664122016-02-23 16:55:13 +000047LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffin5b4f7282015-11-20 11:11:31 +000048include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffin7fc0b452015-11-10 17:45:15 +000049
Paul Duffine2363012015-11-30 16:20:41 +000050# build caliper target api jar
51# ============================================================
52# This contains just those classes needed for benchmarks to compile.
53
54include $(CLEAR_VARS)
55
56LOCAL_MODULE := caliper-api-target
57LOCAL_MODULE_TAGS := optional
58LOCAL_MODULE_CLASS := JAVA_LIBRARIES
59LOCAL_SRC_FILES := \
60 caliper/src/main/java/com/google/caliper/AfterExperiment.java \
61 caliper/src/main/java/com/google/caliper/BeforeExperiment.java \
62 caliper/src/main/java/com/google/caliper/Param.java \
63 caliper/src/main/java/com/google/caliper/All.java \
64 caliper/src/main/java/com/google/caliper/Benchmark.java
65
Neil Fuller6a664122016-02-23 16:55:13 +000066LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffine2363012015-11-30 16:20:41 +000067include $(BUILD_JAVA_LIBRARY)
68
Paul Duffinfb58c0d2015-11-11 14:37:37 +000069# build caliper tests
70# ============================================================
Paul Duffine2363012015-11-30 16:20:41 +000071# vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \
72 --test-only \
73 --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \
74 com.google.caliper
Paul Duffinfb58c0d2015-11-11 14:37:37 +000075
76include $(CLEAR_VARS)
77
78LOCAL_MODULE := caliper-tests
79LOCAL_MODULE_TAGS := optional
80LOCAL_MODULE_CLASS := JAVA_LIBRARIES
81LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/test/java/)
Paul Duffine2363012015-11-30 16:20:41 +000082LOCAL_JAVA_RESOURCE_DIRS := caliper/src/test/resources
Tobias Thierer55f01c32017-05-17 16:54:43 +010083# Required for use of javax.annotation.Generated per http://b/62050818
Tobias Thierer06f9aae2017-11-15 21:08:26 +000084LOCAL_JAVACFLAGS := $(if $(USE_OPENJDK9),-J--add-modules=java.xml.ws.annotation,)
Paul Duffine2363012015-11-30 16:20:41 +000085LOCAL_IS_HOST_MODULE := true
Paul Duffinfb58c0d2015-11-11 14:37:37 +000086
87LOCAL_STATIC_JAVA_LIBRARIES := \
Paul Duffin5b4f7282015-11-20 11:11:31 +000088 caliper-host \
Paul Duffin361540c2016-11-29 12:39:42 +000089 junit-host \
Paul Duffine2363012015-11-30 16:20:41 +000090 mockito-host
91
92# Use Dagger2 annotation processor
Colin Cross8e31c102017-04-07 16:31:28 -070093LOCAL_ANNOTATION_PROCESSORS := dagger2-compiler-host
94LOCAL_ANNOTATION_PROCESSOR_CLASSES := dagger.internal.codegen.ComponentProcessor
Paul Duffinfb58c0d2015-11-11 14:37:37 +000095
Neil Fuller6a664122016-02-23 16:55:13 +000096LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffin5b4f7282015-11-20 11:11:31 +000097include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffinfb58c0d2015-11-11 14:37:37 +000098
Paul Duffine2363012015-11-30 16:20:41 +000099# build caliper examples
100# ============================================================
101
102include $(CLEAR_VARS)
103
104LOCAL_MODULE := caliper-examples
105LOCAL_MODULE_TAGS := optional
106LOCAL_MODULE_CLASS := JAVA_LIBRARIES
107LOCAL_SRC_FILES := $(call all-java-files-under, examples/src/main/java/)
108LOCAL_IS_HOST_MODULE := true
109
110LOCAL_STATIC_JAVA_LIBRARIES := \
111 caliper-host \
Paul Duffin361540c2016-11-29 12:39:42 +0000112 junit-host \
Paul Duffine2363012015-11-30 16:20:41 +0000113 mockito-host
114
Neil Fuller6a664122016-02-23 16:55:13 +0000115LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffine2363012015-11-30 16:20:41 +0000116include $(BUILD_HOST_JAVA_LIBRARY)
117
118# Build host dependencies.
Paul Duffin7fc0b452015-11-10 17:45:15 +0000119# ============================================================
120include $(CLEAR_VARS)
121
Paul Duffin5b4f7282015-11-20 11:11:31 +0000122LOCAL_PREBUILT_JAVA_LIBRARIES := \
Paul Duffine2363012015-11-30 16:20:41 +0000123 caliper-gson-host:lib/gson-2.2.2$(COMMON_JAVA_PACKAGE_SUFFIX) \
124 caliper-java-allocation-instrumenter-host:lib/java-allocation-instrumenter-2.0$(COMMON_JAVA_PACKAGE_SUFFIX) \
125 caliper-jersey-client-host:lib/jersey-client-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
126 caliper-jersey-core-host:lib/jersey-core-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
127 caliper-joda-time-host:lib/joda-time-2.1$(COMMON_JAVA_PACKAGE_SUFFIX) \
128 caliper-jsr311-api-host:lib/jsr311-api-1.1.1$(COMMON_JAVA_PACKAGE_SUFFIX)
Paul Duffin7fc0b452015-11-10 17:45:15 +0000129
Paul Duffin5b4f7282015-11-20 11:11:31 +0000130include $(BUILD_HOST_PREBUILT)