diff options
author | Colin Cross <ccross@android.com> | 2018-09-13 17:41:57 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-09-13 17:41:57 -0700 |
commit | 7e3aa1f8629765fa856d9a5c869ec715da520507 (patch) | |
tree | 810f9a15ceef20299414b0c606daf674b719e22a | |
parent | a832464f59a84433669fa67ebefdfc18ae158186 (diff) | |
parent | b4eabc79090118eab459db6137460404d23c07bf (diff) | |
download | caliper-7e3aa1f8629765fa856d9a5c869ec715da520507.tar.gz |
Convert external/caliper to Android.bp am: b2679aeb30
am: b4eabc7909
Change-Id: I551ef9354753dc8461b56a078896735e4f02214a
-rw-r--r-- | Android.bp | 123 | ||||
-rw-r--r-- | Android.mk | 130 | ||||
-rw-r--r-- | README.android | 7 |
3 files changed, 123 insertions, 137 deletions
diff --git a/Android.bp b/Android.bp new file mode 100644 index 0000000..b70b996 --- /dev/null +++ b/Android.bp @@ -0,0 +1,123 @@ +// Copyright (C) 2015 The Android Open Source Project +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// build caliper host jar +// ============================================================ + +java_library_host { + name: "caliper", + + srcs: ["caliper/src/main/java/**/*.java"], + java_resource_dirs: ["caliper/src/main/resources"], + // Required for use of javax.annotation.Generated per http://b/62050818 + javacflags: ["-J--add-modules=java.xml.ws.annotation"], + + static_libs: [ + "apache-commons-math", + "caliper-prebuilts", + "dagger2", + "dagger2-inject", + "guava", + ], + + // Use Dagger2 annotation processor + annotation_processors: ["dagger2-compiler"], + annotation_processor_classes: ["dagger.internal.codegen.ComponentProcessor"], + + java_version: "1.7", +} + +// build caliper target api jar +// ============================================================ +// This contains just those classes needed for benchmarks to compile. + +java_library { + name: "caliper-api-target", + installable: true, + + srcs: [ + "caliper/src/main/java/com/google/caliper/AfterExperiment.java", + "caliper/src/main/java/com/google/caliper/BeforeExperiment.java", + "caliper/src/main/java/com/google/caliper/Param.java", + "caliper/src/main/java/com/google/caliper/All.java", + "caliper/src/main/java/com/google/caliper/Benchmark.java", + ], + + java_version: "1.7", +} + +// build caliper tests +// ============================================================ +// vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \ +// --test-only \ +// --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \ +// com.google.caliper + +java_test_host { + name: "caliper-tests", + + srcs: ["caliper/src/test/java/**/*.java"], + java_resource_dirs: ["caliper/src/test/resources"], + // Required for use of javax.annotation.Generated per http://b/62050818 + javacflags: ["-J--add-modules=java.xml.ws.annotation"], + + static_libs: [ + "caliper", + "junit", + "mockito", + ], + + // Use Dagger2 annotation processor + annotation_processors: ["dagger2-compiler"], + annotation_processor_classes: ["dagger.internal.codegen.ComponentProcessor"], + + java_version: "1.7", +} + +// build caliper examples +// ============================================================ + +java_library_host { + name: "caliper-examples", + + srcs: ["examples/src/main/java/**/*.java"], + + static_libs: [ + "caliper", + "junit", + "mockito", + ], + + java_version: "1.7", +} + +// Build host dependencies. +// ============================================================ + +java_import_host { + name: "caliper-gson", + jars: ["lib/gson-2.2.2.jar"], +} + +java_import_host { + name: "caliper-prebuilts", + jars: [ + "lib/gson-2.2.2.jar", + "lib/java-allocation-instrumenter-2.0.jar", + "lib/jersey-client-1.11.jar", + "lib/jersey-core-1.11.jar", + "lib/joda-time-2.1.jar", + "lib/jsr311-api-1.1.1.jar", + ], +} diff --git a/Android.mk b/Android.mk deleted file mode 100644 index f07f534..0000000 --- a/Android.mk +++ /dev/null @@ -1,130 +0,0 @@ -# Copyright (C) 2015 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) - -# build caliper host jar -# ============================================================ - -include $(CLEAR_VARS) - -LOCAL_MODULE := caliper-host -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := JAVA_LIBRARIES -LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/main/java/) -LOCAL_JAVA_RESOURCE_DIRS := caliper/src/main/resources -# Required for use of javax.annotation.Generated per http://b/62050818 -LOCAL_JAVACFLAGS := $(if $(USE_OPENJDK9),-J--add-modules=java.xml.ws.annotation) -LOCAL_IS_HOST_MODULE := true - -LOCAL_STATIC_JAVA_LIBRARIES := \ - apache-commons-math-host \ - caliper-gson-host \ - caliper-java-allocation-instrumenter-host \ - caliper-jersey-client-host \ - caliper-jersey-core-host \ - caliper-joda-time-host \ - caliper-jsr311-api-host \ - dagger2-host \ - dagger2-inject-host \ - guavalib - -# Use Dagger2 annotation processor -LOCAL_ANNOTATION_PROCESSORS := dagger2-compiler-host -LOCAL_ANNOTATION_PROCESSOR_CLASSES := dagger.internal.codegen.ComponentProcessor - -LOCAL_JAVA_LANGUAGE_VERSION := 1.7 -include $(BUILD_HOST_JAVA_LIBRARY) - -# build caliper target api jar -# ============================================================ -# This contains just those classes needed for benchmarks to compile. - -include $(CLEAR_VARS) - -LOCAL_MODULE := caliper-api-target -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := JAVA_LIBRARIES -LOCAL_SRC_FILES := \ - caliper/src/main/java/com/google/caliper/AfterExperiment.java \ - caliper/src/main/java/com/google/caliper/BeforeExperiment.java \ - caliper/src/main/java/com/google/caliper/Param.java \ - caliper/src/main/java/com/google/caliper/All.java \ - caliper/src/main/java/com/google/caliper/Benchmark.java - -LOCAL_JAVA_LANGUAGE_VERSION := 1.7 -include $(BUILD_JAVA_LIBRARY) - -# build caliper tests -# ============================================================ -# vogar --expectations $ANDROID_BUILD_TOP/external/caliper/expectations/knownfailures.txt \ - --test-only \ - --classpath $ANDROID_BUILD_TOP/out/host/common/obj/JAVA_LIBRARIES/caliper-tests_intermediates/javalib.jar \ - com.google.caliper - -include $(CLEAR_VARS) - -LOCAL_MODULE := caliper-tests -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := JAVA_LIBRARIES -LOCAL_SRC_FILES := $(call all-java-files-under, caliper/src/test/java/) -LOCAL_JAVA_RESOURCE_DIRS := caliper/src/test/resources -# Required for use of javax.annotation.Generated per http://b/62050818 -LOCAL_JAVACFLAGS := $(if $(USE_OPENJDK9),-J--add-modules=java.xml.ws.annotation,) -LOCAL_IS_HOST_MODULE := true - -LOCAL_STATIC_JAVA_LIBRARIES := \ - caliper-host \ - junit-host \ - mockito-host - -# Use Dagger2 annotation processor -LOCAL_ANNOTATION_PROCESSORS := dagger2-compiler-host -LOCAL_ANNOTATION_PROCESSOR_CLASSES := dagger.internal.codegen.ComponentProcessor - -LOCAL_JAVA_LANGUAGE_VERSION := 1.7 -include $(BUILD_HOST_JAVA_LIBRARY) - -# build caliper examples -# ============================================================ - -include $(CLEAR_VARS) - -LOCAL_MODULE := caliper-examples -LOCAL_MODULE_TAGS := optional -LOCAL_MODULE_CLASS := JAVA_LIBRARIES -LOCAL_SRC_FILES := $(call all-java-files-under, examples/src/main/java/) -LOCAL_IS_HOST_MODULE := true - -LOCAL_STATIC_JAVA_LIBRARIES := \ - caliper-host \ - junit-host \ - mockito-host - -LOCAL_JAVA_LANGUAGE_VERSION := 1.7 -include $(BUILD_HOST_JAVA_LIBRARY) - -# Build host dependencies. -# ============================================================ -include $(CLEAR_VARS) - -LOCAL_PREBUILT_JAVA_LIBRARIES := \ - caliper-gson-host:lib/gson-2.2.2$(COMMON_JAVA_PACKAGE_SUFFIX) \ - caliper-java-allocation-instrumenter-host:lib/java-allocation-instrumenter-2.0$(COMMON_JAVA_PACKAGE_SUFFIX) \ - caliper-jersey-client-host:lib/jersey-client-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \ - caliper-jersey-core-host:lib/jersey-core-1.11$(COMMON_JAVA_PACKAGE_SUFFIX) \ - caliper-joda-time-host:lib/joda-time-2.1$(COMMON_JAVA_PACKAGE_SUFFIX) \ - caliper-jsr311-api-host:lib/jsr311-api-1.1.1$(COMMON_JAVA_PACKAGE_SUFFIX) - -include $(BUILD_HOST_PREBUILT) diff --git a/README.android b/README.android index 850d2ee..046a566 100644 --- a/README.android +++ b/README.android @@ -4,12 +4,5 @@ Description: "Google's Caliper Benchmarking And Measuring Tool" Version: 73efbe138dafba57d6a890257961ba83f41b89f2 -This uses the Dagger2 dependency injection framework which runs as an annotation -processor and generates the dependency injecting code. At the moment the -generated code for the caliper-host target can be found at: - out/host/common/gen/JAVA_LIBRARIES/caliper-host_intermediates/annotation_processor_output/ -For the caliper-tests target it can be found at: - out/host/common/gen/JAVA_LIBRARIES/caliper-tests_intermediates/annotation_processor_output/ - Local Patches: None |