aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-02 23:14:38 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2024-04-02 23:14:38 +0000
commit56e5191c9c63245fa33ad53a062a8911b1682502 (patch)
treef8a6754ce67abf8cc982f64cabf4ef77e303bb05
parentb3c4b14d446e8aa801cec7ef5b76ef9478275f10 (diff)
parent379eda1b281a9f61ad38a815120869077612bbb7 (diff)
downloadvogar-sdk-release.tar.gz
Snap for 11662267 from 379eda1b281a9f61ad38a815120869077612bbb7 to sdk-releasesdk-release
Change-Id: I298992df76f6f6d7f5b6444117f1593d16a5418e
-rw-r--r--Android.bp44
-rw-r--r--Android.mk35
2 files changed, 42 insertions, 37 deletions
diff --git a/Android.bp b/Android.bp
index 8e22d91..c7c981f 100644
--- a/Android.bp
+++ b/Android.bp
@@ -57,8 +57,11 @@ java_import_host {
// build vogar jar
java_library_host {
- name: "vogar",
+ name: "vogar-host-jar",
srcs: ["src/**/*.java"],
+ // Make the host jar file name to be vogar.jar due to in vogar-script it
+ // expect the jar to be vogar.jar.
+ stem: "vogar",
java_resource_dirs: ["resources"],
static_libs: [
"caliper",
@@ -75,6 +78,26 @@ java_library_host {
],
}
+// copy vogar script
+sh_binary_host {
+ // Set filename to the same name as the stem of vogar-host-jar to align with
+ // original make behavior.
+ name: "vogar-script",
+ src: "bin/vogar-android",
+ filename: "vogar",
+}
+
+// User can build both vogar-host-jar and vogar-script just use vogar as target
+// name. This could be replace after soong has implemented the wrapper function
+// for java_library_host.
+phony_rule {
+ name: "vogar",
+ phony_deps: [
+ "vogar-host-jar",
+ "vogar-script",
+ ],
+}
+
// build vogar tests jar
java_library_host {
name: "vogar-tests",
@@ -83,6 +106,23 @@ java_library_host {
"junit",
"mockito",
"objenesis",
- "vogar",
+ "vogar-host-jar",
+ ],
+}
+
+// Run the tests using using run-vogar-tests.
+java_genrule_host {
+ name: "vogar-tests-result",
+ srcs: [
+ ":vogar-tests",
+ ],
+ cmd: "ANDROID_BUILD_TOP=$$(pwd) java -cp $(in) org.junit.runner.JUnitCore vogar.AllTests 2>&1 | tee $(out)",
+ out: ["vogar-tests-result.txt"],
+}
+
+phony_rule {
+ name: "run-vogar-tests",
+ phony_deps: [
+ "vogar-tests-result",
],
}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index d4398c9..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright (C) 2014 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)
-
-# 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
-
-# copy vogar script
-# ============================================================
-include $(CLEAR_VARS)
-LOCAL_IS_HOST_MODULE := true
-LOCAL_MODULE_CLASS := EXECUTABLES
-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_SRC_FILES := bin/vogar-android
-include $(BUILD_PREBUILT)