aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryangbill <yangbill@google.com>2024-03-12 08:13:34 +0000
committeryangbill <yangbill@google.com>2024-03-14 02:39:05 +0000
commit3cb4fdb3221c7fbada565fe2aa31cdb5bf6455fa (patch)
tree92db54d9ef1f8ba268080d3c668d97db525e095c
parent164d8a8eafc055ebb2bc960caad4a14efdda2b17 (diff)
downloadvogar-3cb4fdb3221c7fbada565fe2aa31cdb5bf6455fa.tar.gz
Convert vogar and vogar-tests to Android.bp
Bug: 329011980 Test: m run-vogar-tests Test: m vogar vogar-tests Change-Id: I1c068fe43c7dbdd925a30df390ef9de37dd7bcb1
-rw-r--r--Android.bp32
-rw-r--r--Android.mk53
2 files changed, 33 insertions, 52 deletions
diff --git a/Android.bp b/Android.bp
index 4d94783..8e22d91 100644
--- a/Android.bp
+++ b/Android.bp
@@ -54,3 +54,35 @@ java_import_host {
name: "vogar-kxml-libcore-20110123",
jars: ["lib/kxml-libcore-20110123.jar"],
}
+
+// build vogar jar
+java_library_host {
+ name: "vogar",
+ srcs: ["src/**/*.java"],
+ java_resource_dirs: ["resources"],
+ static_libs: [
+ "caliper",
+ "gson",
+ "guava",
+ "junit",
+ "testng",
+ "vogar-jsr305",
+ "vogar-kxml-libcore-20110123",
+ ],
+ // Vogar uses android.jar.
+ libs: [
+ "android_current",
+ ],
+}
+
+// build vogar tests jar
+java_library_host {
+ name: "vogar-tests",
+ srcs: ["test/**/*.java"],
+ static_libs: [
+ "junit",
+ "mockito",
+ "objenesis",
+ "vogar",
+ ],
+}
diff --git a/Android.mk b/Android.mk
index 3cff243..d4398c9 100644
--- a/Android.mk
+++ b/Android.mk
@@ -14,65 +14,14 @@
LOCAL_PATH := $(call my-dir)
-# build vogar jar
-# ============================================================
-
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := vogar
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_SRC_FILES := $(call all-java-files-under, src/)
-LOCAL_JAVA_RESOURCE_DIRS := resources
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- caliper \
- gson \
- guava \
- junit \
- testng \
- vogar-jsr305 \
- vogar-kxml-libcore-20110123
-
-LOCAL_ADDITIONAL_DEPENDENCIES := \
- $(HOST_OUT_EXECUTABLES)/d8 \
- $(HOST_OUT_JAVA_LIBRARIES)/desugar.jar
-
-# Vogar uses android.jar.
-LOCAL_CLASSPATH := $(call resolve-prebuilt-sdk-jar-path,current)
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# build vogar tests jar
-# ============================================================
# Run the tests using using the following target.
+# ============================================================
.PHONY: run-vogar-tests
run-vogar-tests: vogar-tests
ANDROID_BUILD_TOP=$$(pwd) \
java -cp ./out/host/linux-x86/framework/vogar-tests.jar \
org.junit.runner.JUnitCore vogar.AllTests
-include $(CLEAR_VARS)
-
-LOCAL_MODULE := vogar-tests
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD
-LOCAL_LICENSE_CONDITIONS := notice
-LOCAL_NOTICE_FILE := $(LOCAL_PATH)/LICENSE
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_SRC_FILES := $(call all-java-files-under, test/)
-
-LOCAL_STATIC_JAVA_LIBRARIES := \
- junit \
- mockito \
- objenesis \
- vogar
-
-include $(BUILD_HOST_JAVA_LIBRARY)
-
# copy vogar script
# ============================================================
include $(CLEAR_VARS)