blob: ee45b62673b376608a4f5a2da9a2b02b2d341465 [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
Paul Duffin5b4f7282015-11-20 11:11:31 +000049include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffin7fc0b452015-11-10 17:45:15 +000050
Paul Duffine2363012015-11-30 16:20:41 +000051# Remember the location of the generated files, this is needed for when
52# building for target
53caliper_host_generated_sources_dir := $(local-generated-sources-dir)/annotation_processor_output
54
55# build caliper target api jar
56# ============================================================
57# This contains just those classes needed for benchmarks to compile.
58
59include $(CLEAR_VARS)
60
61LOCAL_MODULE := caliper-api-target
62LOCAL_MODULE_TAGS := optional
63LOCAL_MODULE_CLASS := JAVA_LIBRARIES
64LOCAL_SRC_FILES := \
65 caliper/src/main/java/com/google/caliper/AfterExperiment.java \
66 caliper/src/main/java/com/google/caliper/BeforeExperiment.java \
67 caliper/src/main/java/com/google/caliper/Param.java \
68 caliper/src/main/java/com/google/caliper/All.java \
69 caliper/src/main/java/com/google/caliper/Benchmark.java
70
71include $(BUILD_JAVA_LIBRARY)
72
Paul Duffinfb58c0d2015-11-11 14:37:37 +000073# build caliper tests
74# ============================================================
Paul Duffine2363012015-11-30 16:20:41 +000075# vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \
76 --test-only \
77 --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \
78 com.google.caliper
Paul Duffinfb58c0d2015-11-11 14:37:37 +000079
80include $(CLEAR_VARS)
81
82LOCAL_MODULE := caliper-tests
83LOCAL_MODULE_TAGS := optional
84LOCAL_MODULE_CLASS := JAVA_LIBRARIES
85LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/test/java/)
Paul Duffine2363012015-11-30 16:20:41 +000086LOCAL_JAVA_RESOURCE_DIRS := caliper/src/test/resources
87LOCAL_IS_HOST_MODULE := true
Paul Duffinfb58c0d2015-11-11 14:37:37 +000088
89LOCAL_STATIC_JAVA_LIBRARIES := \
Paul Duffin5b4f7282015-11-20 11:11:31 +000090 caliper-host \
Paul Duffine2363012015-11-30 16:20:41 +000091 junit \
92 mockito-host
93
94# Use Dagger2 annotation processor
95PROCESSOR_LIBRARIES := $(DAGGER2_PROCESSOR_LIBRARIES)
96PROCESSOR_CLASSES := $(DAGGER2_PROCESSOR_CLASSES)
97include external/dagger2/java_annotation_processors.mk
Paul Duffinfb58c0d2015-11-11 14:37:37 +000098
Paul Duffin5b4f7282015-11-20 11:11:31 +000099include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffinfb58c0d2015-11-11 14:37:37 +0000100
Paul Duffine2363012015-11-30 16:20:41 +0000101# build caliper examples
102# ============================================================
103
104include $(CLEAR_VARS)
105
106LOCAL_MODULE := caliper-examples
107LOCAL_MODULE_TAGS := optional
108LOCAL_MODULE_CLASS := JAVA_LIBRARIES
109LOCAL_SRC_FILES := $(call all-java-files-under, examples/src/main/java/)
110LOCAL_IS_HOST_MODULE := true
111
112LOCAL_STATIC_JAVA_LIBRARIES := \
113 caliper-host \
114 junit \
115 mockito-host
116
117include $(BUILD_HOST_JAVA_LIBRARY)
118
119# Build host dependencies.
Paul Duffin7fc0b452015-11-10 17:45:15 +0000120# ============================================================
121include $(CLEAR_VARS)
122
Paul Duffin5b4f7282015-11-20 11:11:31 +0000123LOCAL_PREBUILT_JAVA_LIBRARIES := \
Paul Duffine2363012015-11-30 16:20:41 +0000124 caliper-gson-host:lib/gson-2.2.2$(COMMON_JAVA_PACKAGE_SUFFIX) \
125 caliper-java-allocation-instrumenter-host:lib/java-allocation-instrumenter-2.0$(COMMON_JAVA_PACKAGE_SUFFIX) \
126 caliper-jersey-client-host:lib/jersey-client-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
127 caliper-jersey-core-host:lib/jersey-core-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
128 caliper-joda-time-host:lib/joda-time-2.1$(COMMON_JAVA_PACKAGE_SUFFIX) \
129 caliper-jsr311-api-host:lib/jsr311-api-1.1.1$(COMMON_JAVA_PACKAGE_SUFFIX)
Paul Duffin7fc0b452015-11-10 17:45:15 +0000130
Paul Duffin5b4f7282015-11-20 11:11:31 +0000131include $(BUILD_HOST_PREBUILT)