Merge "Exclude test_com.android.tethering from R snapshot" am: 9113931152

Original change: https://android-review.googlesource.com/c/platform/packages/modules/common/+/2251415

Change-Id: Ib953643f5f7af0fa0854e75e8b04c0c627c03e4b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-10-12 19:54:49 +00:00
committed by Automerger Merge Worker
3 changed files with 69 additions and 2 deletions

View File

@@ -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"],

View File

@@ -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")

View File

@@ -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",
},
}