Android: framework/Split off some packages to a new file

https://github.com/CyanogenMod/android_frameworks_base/commit/854f6f736b90d33b59b5a85bcecf72a416c43b7d

framework: Split off some packages to a new file

frameworks.jar is now hitting the maximum number of member classes
(65535), resulting in the build failing with...

 trouble writing output: Too many methods: 65641; max is 65536. By package:
     26 android
    145 android.accessibilityservice
    700 android.accounts
    436 android.animation
      8 android.annotation
   3787 android.app

As a workaround, split off some packages to a new jar.

This will probably need reviewing, the wiggle room left by moving
these packages is only about 1100 members

Change-Id: I470ac6833693676884747f9204f8238652c2b322
 
  
 
  
   
   
   
   

Showing 2 changed files with 40 additions and 2 deletions.Show Diff Stats

40  Android.mk
  • View file @ 854f6f7
... ...
@@ -28,10 +28,25 @@ framework_res_source_path := APPS/framework-res_intermediates/src
28 28
 
29 29
 # the library
30 30
 # ============================================================
  31
+#
  32
+# These will be included in framework2 to avoid issues with the limit
  33
+# on the number of classes/dex
  34
+SECONDARY_FRAMEWORKS_SUBDIRS := \
  35
+        core/java/android/test \
  36
+        core/java/android/gesture \
  37
+        core/java/android/speech/srec \
  38
+        media/java/android/media/videoeditor \
  39
+        media/java/android/media/audiofx \
  40
+        media/mca/effect/java/android/media/effect \
  41
+        media/mca/effect/java/android/media/effect/effects
  42
+
31 43
 include $(CLEAR_VARS)
32 44
 
33 45
 # FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
34 46
 LOCAL_SRC_FILES := $(call find-other-java-files,$(FRAMEWORKS_BASE_SUBDIRS))
  47
+SECONDARY_SRC_FILES := $(call find-other-java-files,$(SECONDARY_FRAMEWORKS_SUBDIRS))
  48
+
  49
+LOCAL_SRC_FILES := $(filter-out $(SECONDARY_SRC_FILES),$(LOCAL_SRC_FILES))
35 50
 
36 51
 # EventLogTags files.
37 52
 LOCAL_SRC_FILES += \
... ...
@@ -252,6 +267,7 @@ $(full_classes_compiled_jar): $(framework_res_R_stamp)
252 267
 $(LOCAL_INSTALLED_MODULE): | $(dir $(LOCAL_INSTALLED_MODULE))framework-res.apk
253 268
 
254 269
 framework_built := $(call java-lib-deps,framework)
  270
+framework_built += $(call java-lib-deps,framework2)
255 271
 
256 272
 # AIDL files to be preprocessed and included in the SDK,
257 273
 # relative to the root of the build tree.
... ...
@@ -390,6 +406,7 @@ framework_docs_LOCAL_JAVA_LIBRARIES := \
390 406
       core \
391 407
       ext \
392 408
       framework \
  409
+      framework2 \
393 410
 
394 411
 framework_docs_LOCAL_MODULE_CLASS := JAVA_LIBRARIES
395 412
 framework_docs_LOCAL_DROIDDOC_HTML_DIR := docs/html
... ...
@@ -664,7 +681,7 @@ include $(CLEAR_VARS)
664 681
 
665 682
 LOCAL_SRC_FILES:=$(framework_docs_LOCAL_SRC_FILES)
666 683
 LOCAL_INTERMEDIATE_SOURCES:=$(framework_docs_LOCAL_INTERMEDIATE_SOURCES)
667  
-LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES) framework
  684
+LOCAL_JAVA_LIBRARIES:=$(framework_docs_LOCAL_JAVA_LIBRARIES) framework framework2
668 685
 LOCAL_MODULE_CLASS:=$(framework_docs_LOCAL_MODULE_CLASS)
669 686
 LOCAL_DROIDDOC_SOURCE_PATH:=$(framework_docs_LOCAL_DROIDDOC_SOURCE_PATH)
670 687
 LOCAL_DROIDDOC_HTML_DIR:=$(framework_docs_LOCAL_DROIDDOC_HTML_DIR)
... ...
@@ -717,6 +734,26 @@ LOCAL_DX_FLAGS := --core-library
717 734
 
718 735
 include $(BUILD_JAVA_LIBRARY)
719 736
 
  737
+include $(CLEAR_VARS)
  738
+
  739
+# FRAMEWORKS_BASE_SUBDIRS comes from build/core/pathmap.mk
  740
+LOCAL_SRC_FILES := $(call find-other-java-files,$(SECONDARY_FRAMEWORKS_SUBDIRS))
  741
+
  742
+LOCAL_NO_STANDARD_LIBRARIES := true
  743
+LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit ext framework
  744
+
  745
+LOCAL_MODULE_TAGS := optional
  746
+LOCAL_MODULE := framework2
  747
+LOCAL_MODULE_CLASS := JAVA_LIBRARIES
  748
+
  749
+LOCAL_NO_EMMA_INSTRUMENT := true
  750
+LOCAL_NO_EMMA_COMPILE := true
  751
+
  752
+#LOCAL_JARJAR_RULES := $(LOCAL_PATH)/jarjar-rules.txt
  753
+
  754
+LOCAL_DX_FLAGS := --core-library
  755
+
  756
+include $(BUILD_JAVA_LIBRARY)
720 757
 
721 758
 # Include subdirectory makefiles
722 759
 # ============================================================
... ...
@@ -726,3 +763,4 @@ include $(BUILD_JAVA_LIBRARY)
726 763
 ifeq (,$(ONE_SHOT_MAKEFILE))
727 764
 include $(call first-makefiles-under,$(LOCAL_PATH))
728 765
 endif
  766
+
 test-runner/Android.mk
  • View file @ 854f6f7
... ...
@@ -20,7 +20,7 @@ include $(CLEAR_VARS)
20 20
 
21 21
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
22 22
 
23  
-LOCAL_JAVA_LIBRARIES := core core-junit framework
  23
+LOCAL_JAVA_LIBRARIES := core core-junit framework framework2
24 24
 
25 25
 LOCAL_MODULE:= android.test.runner
26 26
 

0 notes on commit 854f6f7


你可能感兴趣的:(java,android,Module,include,library,frameworks)