Ability to generate SDK system-images for arm64 and x86_64
(Cherry-picked from 40c7126e7cfe4680cadd11b90774f9996a8e2d37)
Change-Id: I2715a668271ed88fcd0c8c97ac35d05fcdd34a06
diff --git a/build/Android.mk b/build/Android.mk
index 6d798de..f20a76e 100644
--- a/build/Android.mk
+++ b/build/Android.mk
@@ -18,18 +18,22 @@
$(HOST_OUT)/development/sdk/%_source.properties : $(TOPDIR)development/sdk/%_source.prop_template
@echo Generate $@
$(hide) mkdir -p $(dir $@)
- $(hide) sed -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \
- -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \
- -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \
- $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@
+ $(hide) sed \
+ -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \
+ -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \
+ -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \
+ -e 's/$${TARGET_ARCH}/$(TARGET_ARCH)/' \
+ -e 's/$${TARGET_CPU_ABI}/$(TARGET_CPU_ABI)/' \
+ $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@
$(HOST_OUT)/development/samples/%_source.properties : $(TOPDIR)development/samples/%_source.prop_template
@echo Generate $@
$(hide) mkdir -p $(dir $@)
- $(hide) sed -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \
- -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \
- -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \
- $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@
+ $(hide) sed\
+ -e 's/$${PLATFORM_VERSION}/$(PLATFORM_VERSION)/' \
+ -e 's/$${PLATFORM_SDK_VERSION}/$(PLATFORM_SDK_VERSION)/' \
+ -e 's/$${PLATFORM_VERSION_CODENAME}/$(subst REL,,$(PLATFORM_VERSION_CODENAME))/' \
+ $< > $@ && sed -i -e '/^AndroidVersion.CodeName=\s*$$/d' $@
# ===== Android Support/Compatibility Library =====
diff --git a/build/sdk-android-arm64-v8a.atree b/build/sdk-android-arm64-v8a.atree
new file mode 100644
index 0000000..aefbe9e
--- /dev/null
+++ b/build/sdk-android-arm64-v8a.atree
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2014 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.
+#
+
+# Copy the ARMv7 specific kernel image to .../kernel-qemu
+# TODO(RM) need a qemu-kernel/arm64? "arm" should be ${TARGET_ARCH}
+prebuilts/qemu-kernel/arm/kernel-qemu-armv7 system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
+
+# version files for the SDK updater, from development.git
+${HOST_OUT}/development/sdk/images_arm64-v8a_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties
diff --git a/build/sdk-android-x86.atree b/build/sdk-android-x86.atree
index 9adad9b..1eaf479 100644
--- a/build/sdk-android-x86.atree
+++ b/build/sdk-android-x86.atree
@@ -17,4 +17,4 @@
prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
# version files for the SDK updater, from development.git
-${HOST_OUT}/development/sdk/images_x86_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties
+${HOST_OUT}/development/sdk/images_${TARGET_ARCH}_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties
diff --git a/build/sdk-android-x86_64.atree b/build/sdk-android-x86_64.atree
new file mode 100644
index 0000000..bbe4bd6
--- /dev/null
+++ b/build/sdk-android-x86_64.atree
@@ -0,0 +1,20 @@
+#
+# Copyright (C) 2014 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.
+#
+
+prebuilts/qemu-kernel/${TARGET_ARCH}/kernel-qemu system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/kernel-qemu
+
+# version files for the SDK updater, from development.git
+${HOST_OUT}/development/sdk/images_${TARGET_ARCH}_source.properties system-images/${PLATFORM_NAME}/${TARGET_CPU_ABI}/source.properties
diff --git a/sdk/images_arm64-v8a_source.prop_template b/sdk/images_arm64-v8a_source.prop_template
new file mode 100644
index 0000000..1a18cf8
--- /dev/null
+++ b/sdk/images_arm64-v8a_source.prop_template
@@ -0,0 +1,9 @@
+Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
+Pkg.UserSrc=false
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
+SystemImage.Abi=${TARGET_CPU_ABI}
+SystemImage.GpuSupport=true
+SystemImage.TagId=default
+
diff --git a/sdk/images_x86_64_source.prop_template b/sdk/images_x86_64_source.prop_template
new file mode 100644
index 0000000..1a18cf8
--- /dev/null
+++ b/sdk/images_x86_64_source.prop_template
@@ -0,0 +1,9 @@
+Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
+Pkg.UserSrc=false
+Pkg.Revision=1
+AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
+AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
+SystemImage.Abi=${TARGET_CPU_ABI}
+SystemImage.GpuSupport=true
+SystemImage.TagId=default
+
diff --git a/sdk/images_x86_source.prop_template b/sdk/images_x86_source.prop_template
index cfbe180..1a18cf8 100644
--- a/sdk/images_x86_source.prop_template
+++ b/sdk/images_x86_source.prop_template
@@ -3,7 +3,7 @@
Pkg.Revision=1
AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
-SystemImage.Abi=x86
+SystemImage.Abi=${TARGET_CPU_ABI}
SystemImage.GpuSupport=true
SystemImage.TagId=default