aboutsummaryrefslogtreecommitdiffstats
path: root/Android.mk
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2015-05-05 17:37:05 -0700
committerAdnan Begovic <adnan@cyngn.com>2015-05-12 17:40:49 -0700
commit37fc76fe96174402cdfbf02cf228639083c26bf7 (patch)
treeee77e9ce89f57e6e9f2f75a78f944d2336b92efd /Android.mk
parent8206b1352b28f06b451d7db58879b28bead547c4 (diff)
downloadvendor_cmsdk-37fc76fe96174402cdfbf02cf228639083c26bf7.zip
vendor_cmsdk-37fc76fe96174402cdfbf02cf228639083c26bf7.tar.gz
vendor_cmsdk-37fc76fe96174402cdfbf02cf228639083c26bf7.tar.bz2
CMSDK: Create cyanogenmod platform resource package.
org.cyanogenmod.platform-res provides resources that, if public, are globally accessible. This allows us to declare public and internal permissions as well as reference permissions declared by the android framework core Change-Id: Ia7d541f4b403585f7479ecd87895987b8471005b
Diffstat (limited to 'Android.mk')
-rw-r--r--Android.mk39
1 files changed, 32 insertions, 7 deletions
diff --git a/Android.mk b/Android.mk
index 8806a7c..7d7cffa 100644
--- a/Android.mk
+++ b/Android.mk
@@ -11,9 +11,18 @@
# 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.
-
LOCAL_PATH := $(call my-dir)
+# We have a special case here where we build the library's resources
+# independently from its code, so we need to find where the resource
+# class source got placed in the course of building the resources.
+# Thus, the magic here.
+# Also, this module cannot depend directly on the R.java file; if it
+# did, the PRIVATE_* vars for R.java wouldn't be guaranteed to be correct.
+# Instead, it depends on the R.stamp file, which lists the corresponding
+# R.java file as a prerequisite.
+cm_platform_res := APPS/org.cyanogenmod.platform-res_intermediates/src
+
# The CyanogenMod Platform Framework Library
# ============================================================
include $(CLEAR_VARS)
@@ -23,12 +32,13 @@ library_src := cm/lib/main/java
LOCAL_MODULE := org.cyanogenmod.platform
LOCAL_MODULE_TAGS := optional
-LOCAL_JAVA_LIBRARIES := services
-LOCAL_REQUIRED_MODULES := services
+
+LOCAL_JAVA_LIBRARIES := \
+ services
LOCAL_SRC_FILES := \
- $(call all-java-files-under, $(cyanogenmod_app_src)) \
- $(call all-java-files-under, $(library_src))
+ $(call all-java-files-under, $(cyanogenmod_app_src)) \
+ $(call all-java-files-under, $(library_src))
## READ ME: ########################################################
##
@@ -41,13 +51,26 @@ LOCAL_SRC_FILES := \
##
## READ ME: ########################################################
LOCAL_SRC_FILES += \
- $(call all-Iaidl-files-under, $(cyanogemod_app_src))
+ $(call all-Iaidl-files-under, $(cyanogenmod_app_src))
+
+LOCAL_INTERMEDIATE_SOURCES := \
+ $(cm_platform_res)/cyanogenmod/R.java \
+ $(cm_platform_res)/cyanogenmod/Manifest.java \
+ $(cm_platform_res)/org/cyanogenmod/platform/internal/R.java
# Include aidl files from cyanogenmod.app namespace as well as internal src aidl files
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/src/java
include $(BUILD_JAVA_LIBRARY)
-framework_module := $(LOCAL_INSTALLED_MODULE)
+cm_framework_module := $(LOCAL_INSTALLED_MODULE)
+
+# Make sure that R.java and Manifest.java are built before we build
+# the source for this library.
+cm_framework_res_R_stamp := \
+ $(call intermediates-dir-for,APPS,org.cyanogenmod.platform-res,,COMMON)/src/R.stamp
+$(full_classes_compiled_jar): $(cm_framework_res_R_stamp)
+
+$(cm_framework_module): | $(dir $(cm_framework_module))org.cyanogenmod.platform-res.apk
cm_framework_built := $(call java-lib-deps, org.cyanogenmod.platform)
@@ -122,6 +145,8 @@ LOCAL_DROIDDOC_OPTIONS := \
$(full_target): $(cm_framework_built) $(gen)
include $(BUILD_DROIDDOC)
+include $(call first-makefiles-under,$(LOCAL_PATH))
+
# Cleanup temp vars
# ===========================================================
cmplat.docs.src_files :=