gapps: Convert to bp
Change-Id: Iaf83c2b4832467e246d3ba26b9c51bd200fe8386
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..c42a92f
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,163 @@
+//
+// Copyright (C) 2024 The LeafOS 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.
+//
+
+genrule {
+ name: "gen_PrebuiltGmsCore_arm64",
+ defaults: ["7z_genrule_defaults"],
+ srcs: ["prebuilt/arm64/PrebuiltGmsCore.apk.*"],
+ out: ["PrebuiltGmsCore.apk"],
+}
+
+genrule {
+ name: "gen_PrebuiltGmsCore_x86_64",
+ defaults: ["7z_genrule_defaults"],
+ srcs: ["prebuilt/x86_64/PrebuiltGmsCore.apk.*"],
+ out: ["PrebuiltGmsCore.apk"],
+}
+
+android_app_import {
+ name: "GoogleCalendarSyncAdapter",
+ product_specific: true,
+ preprocessed: true,
+ presigned: true,
+ apk: "prebuilt/common/GoogleCalendarSyncAdapter.apk",
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "GoogleContactsSyncAdapter",
+ product_specific: true,
+ preprocessed: true,
+ presigned: true,
+ apk: "prebuilt/common/GoogleContactsSyncAdapter.apk",
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "GoogleRestorePrebuilt",
+ product_specific: true,
+ privileged: true,
+ preprocessed: true,
+ presigned: true,
+ apk: "prebuilt/common/GoogleRestorePrebuilt.apk",
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "GoogleServicesFramework",
+ system_ext_specific: true,
+ privileged: true,
+ preprocessed: true,
+ presigned: true,
+ apk: "prebuilt/common/GoogleServicesFramework.apk",
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "PartnerSetupPrebuilt",
+ product_specific: true,
+ privileged: true,
+ preprocessed: true,
+ presigned: true,
+ apk: "prebuilt/common/PartnerSetupPrebuilt.apk",
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "Phonesky",
+ product_specific: true,
+ privileged: true,
+ preprocessed: true,
+ presigned: true,
+ arch: {
+ arm64: {
+ apk: "prebuilt/arm64/Phonesky.apk",
+ },
+ x86_64: {
+ apk: "prebuilt/x86_64/Phonesky.apk",
+ },
+ },
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "PrebuiltGmsCore",
+ product_specific: true,
+ privileged: true,
+ preprocessed: true,
+ presigned: true,
+ arch: {
+ arm64: {
+ apk: ":gen_PrebuiltGmsCore_arm64",
+ },
+ x86_64: {
+ apk: ":gen_PrebuiltGmsCore_x86_64",
+ },
+ },
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "SetupWizardPrebuilt",
+ product_specific: true,
+ privileged: true,
+ overrides: ["Provision"],
+ preprocessed: true,
+ presigned: true,
+ arch: {
+ arm64: {
+ apk: "prebuilt/arm64/SetupWizardPrebuilt.apk",
+ },
+ x86_64: {
+ apk: "prebuilt/x86_64/SetupWizardPrebuilt.apk",
+ },
+ },
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+android_app_import {
+ name: "WellbeingPrebuilt",
+ product_specific: true,
+ privileged: true,
+ preprocessed: true,
+ presigned: true,
+ apk: "prebuilt/common/WellbeingPrebuilt.apk",
+ dex_preopt: {
+ enabled: false,
+ },
+}
+
+java_import {
+ name: "com.google.android.dialer.support",
+ product_specific: true,
+ jars: ["prebuilt/common/com.google.android.dialer.support.jar"],
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 13a8207..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# Copyright (C) 2022-2023 The LeafOS 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.
-#
-
-ifeq ($(WITH_GMS), true)
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := GoogleCalendarSyncAdapter
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := GoogleContactsSyncAdapter
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := GoogleRestorePrebuilt
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := GoogleServicesFramework
-LOCAL_MODULE_CLASS := APPS
-LOCAL_SYSTEM_EXT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := PartnerSetupPrebuilt
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := Phonesky
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := PrebuiltGmsCore
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := SetupWizardPrebuilt
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-LOCAL_OVERRIDES_PACKAGES := Provision
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := WellbeingPrebuilt
-LOCAL_MODULE_CLASS := APPS
-LOCAL_PRODUCT_MODULE := true
-LOCAL_PRIVILEGED_MODULE := true
-include vendor/gapps/build/gms_module.mk
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := com.google.android.dialer.support
-LOCAL_MODULE_CLASS := JAVA_LIBRARIES
-LOCAL_PRODUCT_MODULE := true
-include vendor/gapps/build/gms_module.mk
-endif # WITH_GMS
diff --git a/build/gms_module.mk b/build/gms_module.mk
deleted file mode 100644
index b98db9b..0000000
--- a/build/gms_module.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Copyright (C) 2022 The LeafOS 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.
-#
-
-ifeq ($(LOCAL_MODULE_CLASS), APPS)
-LOCAL_CERTIFICATE := PRESIGNED
-LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
-endif
-ifeq ($(LOCAL_MODULE_CLASS), JAVA_LIBRARIES)
-LOCAL_SRC_FILES := $(LOCAL_MODULE).jar
-endif
-
-LOCAL_ENFORCE_USES_LIBRARIES := false
-
-ifneq (,$(wildcard vendor/gapps/prebuilt/common/$(LOCAL_SRC_FILES)*))
-LOCAL_SRC_FILES := $(wildcard vendor/gapps/prebuilt/common/$(LOCAL_SRC_FILES)*)
-else
-LOCAL_SRC_FILES := $(wildcard vendor/gapps/prebuilt/$(TARGET_ARCH)/$(LOCAL_SRC_FILES)*)
-endif
-LOCAL_SRC_FILES := $(shell echo $(LOCAL_SRC_FILES) | sed 's|^vendor/gapps/||g')
-
-ifneq (,$(filter %.xz.001,$(LOCAL_SRC_FILES)))
-include vendor/leaf/build/core/7z_prebuilt.mk
-else
-include $(BUILD_PREBUILT)
-endif