Remove sdk.proto copy in derive_sdk dir
Make a separate dir for proto files and define libraries there.
Also remove some unnecessary options:
- Two were java-specific, and this proto is only used in cpp code
- The package name is not necessary as this proto is internal to this
module.
Bug: 173188089
Test: presubmit
Change-Id: I1bfd29741898832e776aaf45ccf17eed598be267
diff --git a/derive_sdk/Android.bp b/derive_sdk/Android.bp
index dc4e352..ca80b9b 100644
--- a/derive_sdk/Android.bp
+++ b/derive_sdk/Android.bp
@@ -14,10 +14,6 @@
cc_defaults {
name: "derive_sdk-defaults",
- proto: {
- type: "lite",
- static: true,
- },
min_sdk_version: "30",
shared_libs: ["liblog"],
// static c++/libbase for smaller size
@@ -26,15 +22,13 @@
"libbase",
"libmodules-utils-build",
"libprotobuf-cpp-lite",
+ "libsdk_proto"
],
}
cc_library {
name: "libderive_sdk",
- srcs: [
- "derive_sdk.cpp",
- "sdk.proto",
- ],
+ srcs: ["derive_sdk.cpp"],
defaults: ["derive_sdk-defaults"],
apex_available: ["com.android.sdkext"],
}
@@ -66,10 +60,7 @@
cc_test {
name: "derive_sdk_test",
defaults: ["derive_sdk-defaults"],
- srcs: [
- "derive_sdk_test.cpp",
- "sdk.proto",
- ],
+ srcs: ["derive_sdk_test.cpp"],
require_root: true,
static_libs: ["libderive_sdk"],
test_suites: ["device-tests"],
diff --git a/derive_sdk/derive_sdk.cpp b/derive_sdk/derive_sdk.cpp
index fb5f1f5..c117120 100644
--- a/derive_sdk/derive_sdk.cpp
+++ b/derive_sdk/derive_sdk.cpp
@@ -29,9 +29,7 @@
#include <iostream>
#include <vector>
-#include "packages/modules/SdkExtensions/derive_sdk/sdk.pb.h"
-
-using com::android::sdkext::proto::SdkVersion;
+#include "packages/modules/SdkExtensions/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 72ff9ab..a0eb2a9 100644
--- a/derive_sdk/derive_sdk_test.cpp
+++ b/derive_sdk/derive_sdk_test.cpp
@@ -26,9 +26,7 @@
#include <cstdlib>
-#include "packages/modules/SdkExtensions/derive_sdk/sdk.pb.h"
-
-using com::android::sdkext::proto::SdkVersion;
+#include "packages/modules/SdkExtensions/proto/sdk.pb.h"
class DeriveSdkTest : public ::testing::Test {
protected:
diff --git a/derive_sdk/sdk.proto b/derive_sdk/sdk.proto
deleted file mode 100644
index d15b935..0000000
--- a/derive_sdk/sdk.proto
+++ /dev/null
@@ -1,25 +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";
-package com.android.sdkext.proto;
-
-option java_outer_classname = "SdkProto";
-option optimize_for = LITE_RUNTIME;
-
-message SdkVersion {
- int32 version = 1;
-}