blob: 8c5c5eeb3d0acd2bb746f0667f0386b6f446a820 [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
Paul Duffine2363012015-11-30 16:20:41 +000027LOCAL_IS_HOST_MODULE := true
Paul Duffin7fc0b452015-11-10 17:45:15 +000028
29LOCAL_STATIC_JAVA_LIBRARIES := \
Paul Duffine2363012015-11-30 16:20:41 +000030 apache-commons-math-host \
Paul Duffin5b4f7282015-11-20 11:11:31 +000031 caliper-gson-host \
32 caliper-java-allocation-instrumenter-host \
Paul Duffine2363012015-11-30 16:20:41 +000033 caliper-jersey-client-host \
34 caliper-jersey-core-host \
35 caliper-joda-time-host \
36 caliper-jsr311-api-host \
37 dagger2-host \
38 dagger2-inject-host \
Paul Duffin5b4f7282015-11-20 11:11:31 +000039 guavalib
Paul Duffin7fc0b452015-11-10 17:45:15 +000040
Paul Duffine2363012015-11-30 16:20:41 +000041# Use Dagger2 annotation processor
Colin Cross8e31c102017-04-07 16:31:28 -070042LOCAL_ANNOTATION_PROCESSORS := dagger2-compiler-host
43LOCAL_ANNOTATION_PROCESSOR_CLASSES := dagger.internal.codegen.ComponentProcessor
Paul Duffine2363012015-11-30 16:20:41 +000044
Neil Fuller6a664122016-02-23 16:55:13 +000045LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffin5b4f7282015-11-20 11:11:31 +000046include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffin7fc0b452015-11-10 17:45:15 +000047
Paul Duffine2363012015-11-30 16:20:41 +000048# build caliper target api jar
49# ============================================================
50# This contains just those classes needed for benchmarks to compile.
51
52include $(CLEAR_VARS)
53
54LOCAL_MODULE := caliper-api-target
55LOCAL_MODULE_TAGS := optional
56LOCAL_MODULE_CLASS := JAVA_LIBRARIES
57LOCAL_SRC_FILES := \
58 caliper/src/main/java/com/google/caliper/AfterExperiment.java \
59 caliper/src/main/java/com/google/caliper/BeforeExperiment.java \
60 caliper/src/main/java/com/google/caliper/Param.java \
61 caliper/src/main/java/com/google/caliper/All.java \
62 caliper/src/main/java/com/google/caliper/Benchmark.java
63
Neil Fuller6a664122016-02-23 16:55:13 +000064LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffine2363012015-11-30 16:20:41 +000065include $(BUILD_JAVA_LIBRARY)
66
Paul Duffinfb58c0d2015-11-11 14:37:37 +000067# build caliper tests
68# ============================================================
Paul Duffine2363012015-11-30 16:20:41 +000069# vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \
70 --test-only \
71 --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \
72 com.google.caliper
Paul Duffinfb58c0d2015-11-11 14:37:37 +000073
74include $(CLEAR_VARS)
75
76LOCAL_MODULE := caliper-tests
77LOCAL_MODULE_TAGS := optional
78LOCAL_MODULE_CLASS := JAVA_LIBRARIES
79LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/test/java/)
Paul Duffine2363012015-11-30 16:20:41 +000080LOCAL_JAVA_RESOURCE_DIRS := caliper/src/test/resources
81LOCAL_IS_HOST_MODULE := true
Paul Duffinfb58c0d2015-11-11 14:37:37 +000082
83LOCAL_STATIC_JAVA_LIBRARIES := \
Paul Duffin5b4f7282015-11-20 11:11:31 +000084 caliper-host \
Paul Duffin361540c2016-11-29 12:39:42 +000085 junit-host \
Paul Duffine2363012015-11-30 16:20:41 +000086 mockito-host
87
88# Use Dagger2 annotation processor
Colin Cross8e31c102017-04-07 16:31:28 -070089LOCAL_ANNOTATION_PROCESSORS := dagger2-compiler-host
90LOCAL_ANNOTATION_PROCESSOR_CLASSES := dagger.internal.codegen.ComponentProcessor
Paul Duffinfb58c0d2015-11-11 14:37:37 +000091
Neil Fuller6a664122016-02-23 16:55:13 +000092LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffin5b4f7282015-11-20 11:11:31 +000093include $(BUILD_HOST_JAVA_LIBRARY)
Paul Duffinfb58c0d2015-11-11 14:37:37 +000094
Paul Duffine2363012015-11-30 16:20:41 +000095# build caliper examples
96# ============================================================
97
98include $(CLEAR_VARS)
99
100LOCAL_MODULE := caliper-examples
101LOCAL_MODULE_TAGS := optional
102LOCAL_MODULE_CLASS := JAVA_LIBRARIES
103LOCAL_SRC_FILES := $(call all-java-files-under, examples/src/main/java/)
104LOCAL_IS_HOST_MODULE := true
105
106LOCAL_STATIC_JAVA_LIBRARIES := \
107 caliper-host \
Paul Duffin361540c2016-11-29 12:39:42 +0000108 junit-host \
Paul Duffine2363012015-11-30 16:20:41 +0000109 mockito-host
110
Neil Fuller6a664122016-02-23 16:55:13 +0000111LOCAL_JAVA_LANGUAGE_VERSION := 1.7
Paul Duffine2363012015-11-30 16:20:41 +0000112include $(BUILD_HOST_JAVA_LIBRARY)
113
114# Build host dependencies.
Paul Duffin7fc0b452015-11-10 17:45:15 +0000115# ============================================================
116include $(CLEAR_VARS)
117
Paul Duffin5b4f7282015-11-20 11:11:31 +0000118LOCAL_PREBUILT_JAVA_LIBRARIES := \
Paul Duffine2363012015-11-30 16:20:41 +0000119 caliper-gson-host:lib/gson-2.2.2$(COMMON_JAVA_PACKAGE_SUFFIX) \
120 caliper-java-allocation-instrumenter-host:lib/java-allocation-instrumenter-2.0$(COMMON_JAVA_PACKAGE_SUFFIX) \
121 caliper-jersey-client-host:lib/jersey-client-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
122 caliper-jersey-core-host:lib/jersey-core-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \
123 caliper-joda-time-host:lib/joda-time-2.1$(COMMON_JAVA_PACKAGE_SUFFIX) \
124 caliper-jsr311-api-host:lib/jsr311-api-1.1.1$(COMMON_JAVA_PACKAGE_SUFFIX)
Paul Duffin7fc0b452015-11-10 17:45:15 +0000125
Paul Duffin5b4f7282015-11-20 11:11:31 +0000126include $(BUILD_HOST_PREBUILT)