From 8942f6beaadefc6546b3c99fc95879d29bd62826 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rner?= Date: Sat, 2 May 2015 03:39:11 +0200 Subject: [PATCH 1/3] use grade build in Android.mk --- Android.mk | 63 +++++++++++++++--------------------------------------- 1 file changed, 17 insertions(+), 46 deletions(-) diff --git a/Android.mk b/Android.mk index 40a0a5c5..c6b7d1bf 100644 --- a/Android.mk +++ b/Android.mk @@ -15,55 +15,26 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) +LOCAL_MODULE := GmsCore LOCAL_MODULE_TAGS := optional -unified_dir := ../UnifiedNlp -appcompat_dir := ../../../prebuilts/sdk/current/support/v7/appcompat -res_dir := play-services-core/src/main/res $(unified_dir)/unifiednlp-base/src/main/res $(appcompat_dir)/res - -LOCAL_SRC_FILES := $(call all-java-files-under, play-services-core/src/main/java) \ - $(call all-java-files-under, play-services-core/src/main/protos-java) \ - $(call all-java-files-under, $(unified_dir)/unifiednlp-base/src/main/java) - -LOCAL_MANIFEST_FILE := play-services-core/src/main/AndroidManifest.xml -LOCAL_RESOURCE_DIR := $(addprefix $(LOCAL_PATH)/, $(res_dir)) - -LOCAL_AAPT_FLAGS := --auto-add-overlay \ - --extra-packages android.support.v7.appcompat \ - --extra-packages org.microg.nlp - -# For some reason framework has to be added here else GeocoderParams is not found, -# this way everything else is duplicated, but atleast compiles... -LOCAL_JAVA_LIBRARIES := framework \ - com.android.location.provider - -# Include compat v9 files if necassary -ifeq ($(shell [ $(PLATFORM_SDK_VERSION) -ge 17 ] && echo true), true) -LOCAL_JAVA_LIBRARIES += UnifiedNlpCompatV9 -endif - -LOCAL_STATIC_JAVA_LIBRARIES := UnifiedNlpApi \ - GmsApi \ - android-support-v4 \ - android-support-v7-appcompat \ - wire-runtime \ - vtm vtm-themes vtm-extras vtm-android - LOCAL_PACKAGE_NAME := GmsCore -LOCAL_SDK_VERSION := current -LOCAL_PRIVILEGED_MODULE := true -LOCAL_PROGUARD_FLAG_FILES := proguard.flags +gmscore_dir := $(LOCAL_PATH) +#gmscore_apk := play-services-core/build/outputs/apk/play-services-core-release-unsigned.apk +gmscore_apk := play-services-core/build/outputs/apk/play-services-core-debug.apk -include $(BUILD_PACKAGE) +$(LOCAL_PATH)/$(gmscore_apk): + old_java_tool_options=$(JAVA_TOOL_OPTIONS) + export JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" + echo "sdk.dir=$(ANDROID_HOME)" > $(gmscore_dir)/local.properties + cd $(gmscore_dir) && git submodule update --recursive --init +# cd $(gmscore_dir) && gradle assembleRelease + cd $(gmscore_dir) && gradle assembleDebug + export JAVA_TOOL_OPTIONS=$(old_java_tool_options) -include $(CLEAR_VARS) +LOCAL_CERTIFICATE := platform +LOCAL_SRC_FILES := $(gmscore_apk) +LOCAL_MODULE_CLASS := APPS +LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX) -LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := \ - vtm:libs/vtm-0.6.0-SNAPSHOT.jar \ - vtm-extras:libs/vtm-extras-0.6.0-SNAPSHOT.jar \ - vtm-themes:libs/vtm-themes-0.6.0-SNAPSHOT.jar \ - vtm-android:libs/vtm-android-0.6.0-SNAPSHOT.aar - -include $(BUILD_MULTI_PREBUILT) - -$(warning Building GmsCore using Android.mk is not tested and might be broken. Consider compiling with gradle and using the prebuilt module feature of AOSP build system) +include $(BUILD_PREBUILT) From 8740cf3b2220315cff63af652a5ef671bc6abfb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rner?= Date: Sun, 3 May 2015 16:47:20 +0200 Subject: [PATCH 2/3] clean gradle build in Android.mk --- Android.mk | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Android.mk b/Android.mk index c6b7d1bf..690bd37d 100644 --- a/Android.mk +++ b/Android.mk @@ -24,13 +24,10 @@ gmscore_dir := $(LOCAL_PATH) gmscore_apk := play-services-core/build/outputs/apk/play-services-core-debug.apk $(LOCAL_PATH)/$(gmscore_apk): - old_java_tool_options=$(JAVA_TOOL_OPTIONS) - export JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" echo "sdk.dir=$(ANDROID_HOME)" > $(gmscore_dir)/local.properties cd $(gmscore_dir) && git submodule update --recursive --init -# cd $(gmscore_dir) && gradle assembleRelease - cd $(gmscore_dir) && gradle assembleDebug - export JAVA_TOOL_OPTIONS=$(old_java_tool_options) +# cd $(gmscore_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ./gradlew assembleRelease + cd $(gmscore_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ./gradlew assembleDebug LOCAL_CERTIFICATE := platform LOCAL_SRC_FILES := $(gmscore_apk) From 061fa27e3958d8efbddd3fe41ecde41c7d2d8b56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20W=C3=B6rner?= Date: Mon, 4 May 2015 15:19:11 +0200 Subject: [PATCH 3/3] added gradle clean --- Android.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/Android.mk b/Android.mk index 690bd37d..27900cc0 100644 --- a/Android.mk +++ b/Android.mk @@ -26,6 +26,7 @@ gmscore_apk := play-services-core/build/outputs/apk/play-services-core-debug.apk $(LOCAL_PATH)/$(gmscore_apk): echo "sdk.dir=$(ANDROID_HOME)" > $(gmscore_dir)/local.properties cd $(gmscore_dir) && git submodule update --recursive --init + cd $(gmscore_dir) && ./gradlew clean # cd $(gmscore_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ./gradlew assembleRelease cd $(gmscore_dir) && JAVA_TOOL_OPTIONS="$(JAVA_TOOL_OPTIONS) -Dfile.encoding=UTF8" ./gradlew assembleDebug