Merge "Move SdkExtensions/proto to packages/modules/common." am: be3d2306cb am: 3ea6243022 am: 970e1928b4
Original change: https://android-review.googlesource.com/c/platform/packages/modules/SdkExtensions/+/1700072
Change-Id: I02ddae9f76e353c37e439917e36529c1148b1fbd
diff --git a/Android.bp b/Android.bp
index 87a811e..4ce6646 100644
--- a/Android.bp
+++ b/Android.bp
@@ -56,31 +56,6 @@
certificate: "com.android.sdkext",
}
-python_binary_host {
- name: "gen_sdkinfo",
- srcs: ["gen_sdkinfo.py"],
- libs: ["sdk_proto_python"],
- version: {
- py3: {
- embedded_launcher: true,
- },
- },
-}
-
-gensrcs {
- name: "cur_sdkinfo_src",
- srcs: [""],
- tools: [ "gen_sdkinfo" ],
- cmd: "$(location) -v 0 -o $(out)",
-}
-
-prebuilt_etc {
- name: "cur_sdkinfo",
- src: ":cur_sdkinfo_src",
- filename: "sdkinfo.binarypb",
- installable: false,
-}
-
sdk {
name: "sdkextensions-sdk",
java_sdk_libs: ["framework-sdkextensions"],
diff --git a/derive_classpath/derive_classpath.cpp b/derive_classpath/derive_classpath.cpp
index 68998cc..debd913 100644
--- a/derive_classpath/derive_classpath.cpp
+++ b/derive_classpath/derive_classpath.cpp
@@ -22,7 +22,7 @@
#include <regex>
#include <sstream>
-#include "packages/modules/SdkExtensions/proto/classpaths.pb.h"
+#include "packages/modules/common/proto/classpaths.pb.h"
namespace android {
namespace derive_classpath {
diff --git a/derive_classpath/derive_classpath_test.cpp b/derive_classpath/derive_classpath_test.cpp
index 186bd9a..d34d720 100644
--- a/derive_classpath/derive_classpath_test.cpp
+++ b/derive_classpath/derive_classpath_test.cpp
@@ -31,7 +31,7 @@
#include <string_view>
#include "android-base/unique_fd.h"
-#include "packages/modules/SdkExtensions/proto/classpaths.pb.h"
+#include "packages/modules/common/proto/classpaths.pb.h"
namespace android {
namespace derive_classpath {
diff --git a/derive_sdk/derive_sdk.cpp b/derive_sdk/derive_sdk.cpp
index d87dfee..839cc30 100644
--- a/derive_sdk/derive_sdk.cpp
+++ b/derive_sdk/derive_sdk.cpp
@@ -29,7 +29,7 @@
#include <iostream>
#include <vector>
-#include "packages/modules/SdkExtensions/proto/sdk.pb.h"
+#include "packages/modules/common/proto/sdk.pb.h"
namespace android {
namespace derivesdk {
diff --git a/derive_sdk/derive_sdk_test.cpp b/derive_sdk/derive_sdk_test.cpp
index 8dd7265..8507b5f 100644
--- a/derive_sdk/derive_sdk_test.cpp
+++ b/derive_sdk/derive_sdk_test.cpp
@@ -28,7 +28,7 @@
#include <cstdlib>
-#include "packages/modules/SdkExtensions/proto/sdk.pb.h"
+#include "packages/modules/common/proto/sdk.pb.h"
class DeriveSdkTest : public ::testing::Test {
protected:
diff --git a/gen_sdkinfo.py b/gen_sdkinfo.py
deleted file mode 100644
index 5af478b..0000000
--- a/gen_sdkinfo.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import sdk_pb2
-import sys
-
-if __name__ == '__main__':
- argv = sys.argv[1:]
- if not len(argv) == 4 or sorted([argv[0], argv[2]]) != ['-o', '-v']:
- print('usage: gen_sdkinfo -v <version> -o <output-file>')
- sys.exit(1)
-
- for i in range(len(argv)):
- if sys.argv[i] == '-o':
- filename = sys.argv[i+1]
- if sys.argv[i] == '-v':
- version = int(sys.argv[i+1])
-
- proto = sdk_pb2.SdkVersion()
- proto.version = version
- with open(filename, 'wb') as f:
- f.write(proto.SerializeToString())
diff --git a/proto/Android.bp b/proto/Android.bp
deleted file mode 100644
index 9e9b707..0000000
--- a/proto/Android.bp
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (C) 2021 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.
-
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-python_defaults {
- name: "sdkextensions-proto-python-defaults",
- version: {
- py2: {
- enabled: true,
- },
- py3: {
- enabled: true,
- },
- },
-}
-
-python_library_host {
- name: "sdk_proto_python",
- defaults: ["sdkextensions-proto-python-defaults"],
- srcs: ["sdk.proto"],
- proto: {
- canonical_path_from_root: false,
- },
-}
-
-cc_library_static {
- name: "libsdk_proto",
- proto: {
- export_proto_headers: true,
- type: "lite",
- },
- srcs: ["sdk.proto"],
- min_sdk_version: "30",
- apex_available: ["com.android.sdkext"],
-}
-
-python_library_host {
- name: "classpaths_proto_python",
- defaults: ["sdkextensions-proto-python-defaults"],
- srcs: [
- "classpaths.proto",
- ],
- proto: {
- canonical_path_from_root: false,
- },
- visibility: ["//build/soong/scripts"],
-}
-
-cc_library_static {
- name: "libclasspaths_proto",
- proto: {
- export_proto_headers: true,
- type: "lite",
- },
- srcs: ["classpaths.proto"],
- min_sdk_version: "30",
- apex_available: ["com.android.sdkext"],
-}
diff --git a/proto/classpaths.proto b/proto/classpaths.proto
deleted file mode 100644
index bbecdcb..0000000
--- a/proto/classpaths.proto
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-syntax = "proto3";
-
-enum Classpath {
- UNKNOWN = 0;
- BOOTCLASSPATH = 1;
- SYSTEMSERVERCLASSPATH = 2;
- DEX2OATBOOTCLASSPATH = 3;
-}
-
-// Individual entry in a classpath variable.
-message Jar {
-
- // Path on the filesystem for the jar, relative to the partition.
- // For example, for APEX "com.android.myapex", relative_path of
- // `javalib/myjar.jar` would correspond to an absolute path of
- // `/apex/com.android.myapex/javalib/myjar.jar` at runtime.
- string relative_path = 1;
-
- // Environ classpath variable this jar belongs to.
- // Must be set to a known classpath.
- Classpath classpath = 2;
-
- // Minimum API level required for the jar to be included on the classpath.
- // If the system's API level is lower than the value specified in this
- // attribute, the jar will not be included in the classpath.
- // Not setting this attribute, defaults the value to zero and implies the jar
- // can be used on all API levels.
- int32 min_sdk_version = 3;
-
- // Maximum API level that the jar file supports.
- // Not setting this attribute implies unbound maximum; otherwise set value
- // must be greater or equal to min_sdk value.
- // If the system's API level is higher that the value specified in this
- // attribute, the jar will not be included in the classpath.
- int32 max_sdk_version = 4;
-}
-
-// Jars exported by a single partition.
-message ExportedClasspathsJars {
-
- // All jars that are exported as part of any classpath environ variable
- // (according to API level restrictions).
- // The relative order of the jars is preserved upon final merging.
- repeated Jar jars = 1;
-
-}
diff --git a/proto/sdk.proto b/proto/sdk.proto
deleted file mode 100644
index 1e37dbc..0000000
--- a/proto/sdk.proto
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2019 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.
- */
-
-syntax = "proto3";
-
-// The version of a single module.
-message SdkVersion {
- int32 version = 1;
-}
-
-// All the modules that can be used for version requirements.
-enum SdkModule {
- UNKNOWN = 0;
-
- // R modules
- IPSEC = 1;
- MEDIA = 2;
- MEDIA_PROVIDER = 3;
- PERMISSIONS = 4;
- SDK_EXTENSIONS = 5;
- STATSD = 6;
- TETHERING = 7;
-
- // S modules
- ART = 8;
-}
-
-// A single extension version.
-message ExtensionVersion {
- message ModuleRequirement {
- SdkModule module = 1;
- SdkVersion version = 2;
- }
-
- // The extension version.
- int32 version = 1;
-
- // The modules required for this extension version.
- repeated ModuleRequirement requirements = 2;
-}
-
-// All the defined extension versions.
-message ExtensionDatabase {
- repeated ExtensionVersion versions = 1;
-}