diff options
author | Paul Duffin <paulduffin@google.com> | 2022-10-12 13:50:23 +0100 |
---|---|---|
committer | Paul Duffin <paulduffin@google.com> | 2022-10-12 18:47:30 +0100 |
commit | 378d990a95b4a3b49a870520f6a2f96b7b27a7ae (patch) | |
tree | a91daff9da9071aa908869bb2c65d161ace5cfc5 | |
parent | 5fc8511dffe2838eedde1da1418bae3d2611c03e (diff) | |
download | common-378d990a95b4a3b49a870520f6a2f96b7b27a7ae.tar.gz |
Exclude test_com.android.tethering from R snapshot
Bug: 218685706
Test: BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh --build-release=R
# Run before and after making this change and verify that the
# only difference is to remove test_com.android.tethering.
atest --no-bazel-mode --host mainline_modules_sdks_test
Change-Id: Ic24ce4afbe9f84b1afd65dca9cee2154dc436646
-rwxr-xr-x | build/mainline_modules_sdks.py | 8 | ||||
-rw-r--r-- | build/mainline_modules_sdks_test.py | 18 | ||||
-rw-r--r-- | build/mainline_modules_sdks_test_data/tethering_for_r_Android.bp | 45 |
3 files changed, 69 insertions, 2 deletions
diff --git a/build/mainline_modules_sdks.py b/build/mainline_modules_sdks.py index 4de99ec4..7c9b8531 100755 --- a/build/mainline_modules_sdks.py +++ b/build/mainline_modules_sdks.py @@ -422,6 +422,11 @@ class SnapshotBuilder: scope_pattern=r"(public|system|module-lib)", name_pattern=fr"({module_name}(-removed|-stubs)?)")) + available_apexes = [f'"{aosp_apex}"'] + if aosp_apex != "com.android.tethering": + available_apexes.append(f'"test_{aosp_apex}"') + apex_available = ",\n ".join(available_apexes) + bp.write(f""" java_sdk_library_import {{ name: "{module_name}", @@ -429,8 +434,7 @@ java_sdk_library_import {{ prefer: true, shared_library: {shared_library}, apex_available: [ - "{aosp_apex}", - "test_{aosp_apex}", + {apex_available}, ], public: {{ jars: ["public/{module_name}-stubs.jar"], diff --git a/build/mainline_modules_sdks_test.py b/build/mainline_modules_sdks_test.py index ffe84576..738ba78a 100644 --- a/build/mainline_modules_sdks_test.py +++ b/build/mainline_modules_sdks_test.py @@ -177,6 +177,7 @@ class TestProduceDist(unittest.TestCase): modules = [ MAINLINE_MODULES_BY_APEX["com.android.art"], MAINLINE_MODULES_BY_APEX["com.android.ipsec"], + MAINLINE_MODULES_BY_APEX["com.android.tethering"], # Create a google specific module. mm.aosp_to_google(MAINLINE_MODULES_BY_APEX["com.android.wifi"]), ] @@ -193,11 +194,13 @@ class TestProduceDist(unittest.TestCase): [ # Build specific snapshots. "mainline-sdks/for-R-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current.zip", + "mainline-sdks/for-R-build/current/com.android.tethering/sdk/tethering-module-sdk-current.zip", "mainline-sdks/for-R-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current.zip", "mainline-sdks/for-S-build/current/com.android.art/host-exports/art-module-host-exports-current.zip", "mainline-sdks/for-S-build/current/com.android.art/sdk/art-module-sdk-current.zip", "mainline-sdks/for-S-build/current/com.android.art/test-exports/art-module-test-exports-current.zip", "mainline-sdks/for-S-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current.zip", + "mainline-sdks/for-S-build/current/com.android.tethering/sdk/tethering-module-sdk-current.zip", "mainline-sdks/for-S-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current.zip", "mainline-sdks/for-latest-build/current/com.android.art/host-exports/art-module-host-exports-current.zip", "mainline-sdks/for-latest-build/current/com.android.art/sdk/art-module-sdk-current-api-diff.txt", @@ -205,6 +208,8 @@ class TestProduceDist(unittest.TestCase): "mainline-sdks/for-latest-build/current/com.android.art/test-exports/art-module-test-exports-current.zip", "mainline-sdks/for-latest-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current-api-diff.txt", "mainline-sdks/for-latest-build/current/com.android.ipsec/sdk/ipsec-module-sdk-current.zip", + "mainline-sdks/for-latest-build/current/com.android.tethering/sdk/tethering-module-sdk-current-api-diff.txt", + "mainline-sdks/for-latest-build/current/com.android.tethering/sdk/tethering-module-sdk-current.zip", "mainline-sdks/for-latest-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current-api-diff.txt", "mainline-sdks/for-latest-build/current/com.google.android.wifi/sdk/wifi-module-sdk-current.zip", ], @@ -213,6 +218,7 @@ class TestProduceDist(unittest.TestCase): r_snaphot_dir = os.path.join(self.tmp_out_dir, "soong/mainline-sdks/test/for-R-build") aosp_ipsec_r_bp_file = "com.android.ipsec/sdk_library/Android.bp" + aosp_tethering_r_bp_file = "com.android.tethering/sdk_library/Android.bp" google_wifi_android_bp = "com.google.android.wifi/sdk_library/Android.bp" self.assertEqual([ aosp_ipsec_r_bp_file, @@ -221,6 +227,12 @@ class TestProduceDist(unittest.TestCase): "com.android.ipsec/sdk_library/public/android.net.ipsec.ike.srcjar", "com.android.ipsec/sdk_library/public/android.net.ipsec.ike.txt", "com.android.ipsec/snapshot-creation-build-number.txt", + aosp_tethering_r_bp_file, + "com.android.tethering/sdk_library/public/framework-tethering-removed.txt", + "com.android.tethering/sdk_library/public/framework-tethering-stubs.jar", + "com.android.tethering/sdk_library/public/framework-tethering.srcjar", + "com.android.tethering/sdk_library/public/framework-tethering.txt", + "com.android.tethering/snapshot-creation-build-number.txt", google_wifi_android_bp, "com.google.android.wifi/sdk_library/public/framework-wifi-removed.txt", "com.google.android.wifi/sdk_library/public/framework-wifi-stubs.jar", @@ -228,6 +240,7 @@ class TestProduceDist(unittest.TestCase): "com.google.android.wifi/sdk_library/public/framework-wifi.txt", "com.google.android.wifi/snapshot-creation-build-number.txt", "ipsec-module-sdk-current.zip", + "tethering-module-sdk-current.zip", "wifi-module-sdk-current.zip", ], sorted(self.list_files_in_dir(r_snaphot_dir))) @@ -241,6 +254,11 @@ class TestProduceDist(unittest.TestCase): expected = read_test_data("ipsec_for_r_Android.bp") self.assertEqual(expected, ipsec_contents) + # Check the contents of the AOSP tethering module + tethering_contents = read_r_snapshot_contents(aosp_tethering_r_bp_file) + expected = read_test_data("tethering_for_r_Android.bp") + self.assertEqual(expected, tethering_contents) + # Check the contents of the Google ipsec module wifi_contents = read_r_snapshot_contents(google_wifi_android_bp) expected = read_test_data("google_wifi_for_r_Android.bp") diff --git a/build/mainline_modules_sdks_test_data/tethering_for_r_Android.bp b/build/mainline_modules_sdks_test_data/tethering_for_r_Android.bp new file mode 100644 index 00000000..4cf86f66 --- /dev/null +++ b/build/mainline_modules_sdks_test_data/tethering_for_r_Android.bp @@ -0,0 +1,45 @@ +// DO NOT EDIT. Auto-generated by the following: +// path/to/mainline_modules_sdks.sh +// +// Copyright (C) 2020 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. +// + +java_sdk_library_import { + name: "framework-tethering", + owner: "google", + prefer: true, + shared_library: false, + apex_available: [ + "com.android.tethering", + ], + public: { + jars: ["public/framework-tethering-stubs.jar"], + current_api: "public/framework-tethering.txt", + removed_api: "public/framework-tethering-removed.txt", + sdk_version: "module_current", + }, + system: { + jars: ["system/framework-tethering-stubs.jar"], + current_api: "system/framework-tethering.txt", + removed_api: "system/framework-tethering-removed.txt", + sdk_version: "module_current", + }, + module_lib: { + jars: ["module-lib/framework-tethering-stubs.jar"], + current_api: "module-lib/framework-tethering.txt", + removed_api: "module-lib/framework-tethering-removed.txt", + sdk_version: "module_current", + }, +} |