blob: d65a1984e7a764ff3291bb8fa4d25145f01e33b7 [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 Duffine2363012015-11-30 16:20:41 +000017# Include definitions of DAGGER2_PROCESSOR_CLASSES/LIBRARIES
18include external/dagger2/dagger2_annotation_processor.mk
19
Paul Duffin5b4f7282015-11-20 11:11:31 +000020# build caliper host jar
Paul Duffin7fc0b452015-11-10 17:45:15 +000021# ============================================================
22
23include $(CLEAR_VARS)
24
Paul Duffin5b4f7282015-11-20 11:11:31 +000025LOCAL_MODULE := caliper-host
Paul Duffin7fc0b452015-11-10 17:45:15 +000026LOCAL_MODULE_TAGS := optional
27LOCAL_MODULE_CLASS := JAVA_LIBRARIES
28LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/main/java/)
29LOCAL_JAVA_RESOURCE_DIRS := caliper/src/main/resources
Paul Duffine2363012015-11-30 16:20:41 +000030LOCAL_IS_HOST_MODULE := true
Paul Duffin7fc0b452015-11-10 17:45:15 +000031
32LOCAL_STATIC_JAVA_LIBRARIES := \
Paul Duffine2363012015-11-30 16:20:41 +000033 apache-commons-math-host \
Paul Duffin5b4f7282015-11-20 11:11:31 +000034 caliper-gson-host \
35 caliper-java-allocation-instrumenter-host \
Paul Duffine2363012015-11-30 16:20:41 +000036 caliper-jersey-client-host \
37 caliper-jersey-core-host \
38 caliper-joda-time-host \
39 caliper-jsr311-api-host \
40 dagger2-host \
41 dagger2-inject-host \
Paul Duffin5b4f7282015-11-20 11:11:31 +000042 guavalib
Paul Duffin7fc0b452015-11-10 17:45:15 +000043
Paul Duffine2363012015-11-30 16:20:41 +000044# Use Dagger2 annotation processor
45PROCESSOR_LIBRARIES := $(DAGGER2_PROCESSOR_LIBRARIES)
46PROCESSOR_CLASSES := $(DAGGER2_PROCESSOR_CLASSES)
47include external/dagger2/java_annotation_processors.mk
48
Neil Fuller6a664122016-02-23 16:55:13 +000049LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffin5b4f7282015-11-20 11:11:31 +000050include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffin7fc0b452015-11-10 17:45:15 +000051
Paul Duffine2363012015-11-30 16:20:41 +000052# Remember the location of the generated files, this is needed for when
53# building for target
54caliper_host_generated_sources_dir := $(local-generated-sources-dir)/annotation_processor_output
55
56# build caliper target api jar
57# ============================================================
58# This contains just those classes needed for benchmarks to compile.
59
60include $(CLEAR_VARS)
61
62LOCAL_MODULE := caliper-api-target
63LOCAL_MODULE_TAGS := optional
64LOCAL_MODULE_CLASS := JAVA_LIBRARIES
65LOCAL_SRC_FILES := \
66 caliper/src/main/java/com/google/caliper/AfterExperiment.java \
67 caliper/src/main/java/com/google/caliper/BeforeExperiment.java \
68 caliper/src/main/java/com/google/caliper/Param.java \
69 caliper/src/main/java/com/google/caliper/All.java \
70 caliper/src/main/java/com/google/caliper/Benchmark.java
71
Neil Fuller6a664122016-02-23 16:55:13 +000072LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffine2363012015-11-30 16:20:41 +000073include $(BUILD_JAVA_LIBRARY)
74
Paul Duffinfb58c0d2015-11-11 14:37:37 +000075# build caliper tests
76# ============================================================
Paul Duffine2363012015-11-30 16:20:41 +000077# vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \
78 --test-only \
79 --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \
80 com.google.caliper
Paul Duffinfb58c0d2015-11-11 14:37:37 +000081
82include $(CLEAR_VARS)
83
84LOCAL_MODULE := caliper-tests
85LOCAL_MODULE_TAGS := optional
86LOCAL_MODULE_CLASS := JAVA_LIBRARIES
87LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/test/java/)
Paul Duffine2363012015-11-30 16:20:41 +000088LOCAL_JAVA_RESOURCE_DIRS := caliper/src/test/resources
89LOCAL_IS_HOST_MODULE := true
Paul Duffinfb58c0d2015-11-11 14:37:37 +000090
91LOCAL_STATIC_JAVA_LIBRARIES := \
Paul Duffin5b4f7282015-11-20 11:11:31 +000092 caliper-host \
Paul Duffin361540c2016-11-29 12:39:42 +000093 junit-host \
Paul Duffine2363012015-11-30 16:20:41 +000094 mockito-host
95
96# Use Dagger2 annotation processor
97PROCESSOR_LIBRARIES := $(DAGGER2_PROCESSOR_LIBRARIES)
98PROCESSOR_CLASSES := $(DAGGER2_PROCESSOR_CLASSES)
99include external/dagger2/java_annotation_processors.mk
Paul Duffinfb58c0d2015-11-11 14:37:37 +0000100
Neil Fuller6a664122016-02-23 16:55:13 +0000101LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffin5b4f7282015-11-20 11:11:31 +0000102include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffinfb58c0d2015-11-11 14:37:37 +0000103
Paul Duffine2363012015-11-30 16:20:41 +0000104# build caliper examples
105# ============================================================
106
107include $(CLEAR_VARS)
108
109LOCAL_MODULE := caliper-examples
110LOCAL_MODULE_TAGS := optional
111LOCAL_MODULE_CLASS := JAVA_LIBRARIES
112LOCAL_SRC_FILES := $(call all-java-files-under, examples/src/main/java/)
113LOCAL_IS_HOST_MODULE := true
114
115LOCAL_STATIC_JAVA_LIBRARIES := \
116 caliper-host \
Paul Duffin361540c2016-11-29 12:39:42 +0000117 junit-host \
Paul Duffine2363012015-11-30 16:20:41 +0000118 mockito-host
119
Neil Fuller6a664122016-02-23 16:55:13 +0000120LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffine2363012015-11-30 16:20:41 +0000121include $(BUILD_HOST_JAVA_LIBRARY)
122
123# Build host dependencies.
Paul Duffin7fc0b452015-11-10 17:45:15 +0000124# ============================================================
125include $(CLEAR_VARS)
126
Paul Duffin5b4f7282015-11-20 11:11:31 +0000127LOCAL_PREBUILT_JAVA_LIBRARIES := \
Paul Duffine2363012015-11-30 16:20:41 +0000128 caliper-gson-host:lib/gson-2.2.2$(COMMON_JAVA_PACKAGE_SUFFIX) \
129 caliper-java-allocation-instrumenter-host:lib/java-allocation-instrumenter-2.0$(COMMON_JAVA_PACKAGE_SUFFIX) \
130 caliper-jersey-client-host:lib/jersey-client-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
131 caliper-jersey-core-host:lib/jersey-core-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
132 caliper-joda-time-host:lib/joda-time-2.1$(COMMON_JAVA_PACKAGE_SUFFIX) \
133 caliper-jsr311-api-host:lib/jsr311-api-1.1.1$(COMMON_JAVA_PACKAGE_SUFFIX)
Paul Duffin7fc0b452015-11-10 17:45:15 +0000134
Paul Duffin5b4f7282015-11-20 11:11:31 +0000135include $(BUILD_HOST_PREBUILT)