Bug 924133 - Remove Android WebApps preprocessing. r=wesj

The existing code complicates the build system and IDE integration.
This keeps most of the flexibility while simplifying the build system.
This commit is contained in:
Nick Alexander 2013-10-09 17:05:36 -07:00
parent a8e0db8b42
commit db01c057a1
4 changed files with 316 additions and 23 deletions

View File

@ -172,7 +172,13 @@
</intent-filter>
</activity>
#include @OBJDIR@/WebAppManifestFragment.xml.in
<!-- Declare a predefined number of WebApp<num> activities. These are
used so that each web app can launch in its own process. Keep
this number in sync with the total number of web apps handled in
WebAppAllocator. -->
#define FRAGMENT WebAppManifestFragment.xml.frag
#include WebAppFragmentRepeater.inc
<!-- Masquerade as the Resolver so that we can be opened from the Marketplace. -->
<activity-alias

View File

@ -1348,29 +1348,11 @@ android-preqs = \
$(call mkdir_deps,$(sort $(dir $(FENNEC_PP_JAVA_FILES)))) \
$(call mkdir_deps,$(sort $(dir $(SYNC_PP_JAVA_FILES)))) \
$(SERVICES_MANIFEST_FRAGMENTS) \
WebAppManifestFragment.xml.in \
WebAppsFragments.java \
$(NULL)
$(android-tgts): % : %.in $(android-preqs)
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
$(AUTOMATION_PPARGS) -DOBJDIR="`pwd`" $(DEFINES) $(ACDEFINES) $< > $@
# Add a predefined number of WebApp<num> classes to the WebApps class.
# These are used so that each webapp can launch in its own process
# Keep this number in sync with the max web apps in WebAppAllocator.java
NUM_WEB_APPS=100
WebAppManifestFragment.xml.in: WebAppManifestFragment.xml.frag
@rm -f $@
@for n in `$(PYTHON) -c "for x in range($(NUM_WEB_APPS)): print x"`; do \
cat $< | sed s,@APPNUM@,$$n,g >> $@ ; \
done
WebAppsFragments.java: WebAppsFragment.java.frag
@rm -f $@
@for n in `$(PYTHON) -c "for x in range($(NUM_WEB_APPS)): print x"`; do \
cat $< | sed s,@APPNUM@,$$n,g >> $@ ; \
done
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
# Replace @VIEWTYPE@ with different View names.
$(FENNEC_PP_JAVA_VIEW_FILES): GeckoView.java.frag

View File

@ -0,0 +1,301 @@
#define APPNUM 0
#include @FRAGMENT@
#define APPNUM 1
#include @FRAGMENT@
#define APPNUM 2
#include @FRAGMENT@
#define APPNUM 3
#include @FRAGMENT@
#define APPNUM 4
#include @FRAGMENT@
#define APPNUM 5
#include @FRAGMENT@
#define APPNUM 6
#include @FRAGMENT@
#define APPNUM 7
#include @FRAGMENT@
#define APPNUM 8
#include @FRAGMENT@
#define APPNUM 9
#include @FRAGMENT@
#define APPNUM 10
#include @FRAGMENT@
#define APPNUM 11
#include @FRAGMENT@
#define APPNUM 12
#include @FRAGMENT@
#define APPNUM 13
#include @FRAGMENT@
#define APPNUM 14
#include @FRAGMENT@
#define APPNUM 15
#include @FRAGMENT@
#define APPNUM 16
#include @FRAGMENT@
#define APPNUM 17
#include @FRAGMENT@
#define APPNUM 18
#include @FRAGMENT@
#define APPNUM 19
#include @FRAGMENT@
#define APPNUM 20
#include @FRAGMENT@
#define APPNUM 21
#include @FRAGMENT@
#define APPNUM 22
#include @FRAGMENT@
#define APPNUM 23
#include @FRAGMENT@
#define APPNUM 24
#include @FRAGMENT@
#define APPNUM 25
#include @FRAGMENT@
#define APPNUM 26
#include @FRAGMENT@
#define APPNUM 27
#include @FRAGMENT@
#define APPNUM 28
#include @FRAGMENT@
#define APPNUM 29
#include @FRAGMENT@
#define APPNUM 30
#include @FRAGMENT@
#define APPNUM 31
#include @FRAGMENT@
#define APPNUM 32
#include @FRAGMENT@
#define APPNUM 33
#include @FRAGMENT@
#define APPNUM 34
#include @FRAGMENT@
#define APPNUM 35
#include @FRAGMENT@
#define APPNUM 36
#include @FRAGMENT@
#define APPNUM 37
#include @FRAGMENT@
#define APPNUM 38
#include @FRAGMENT@
#define APPNUM 39
#include @FRAGMENT@
#define APPNUM 40
#include @FRAGMENT@
#define APPNUM 41
#include @FRAGMENT@
#define APPNUM 42
#include @FRAGMENT@
#define APPNUM 43
#include @FRAGMENT@
#define APPNUM 44
#include @FRAGMENT@
#define APPNUM 45
#include @FRAGMENT@
#define APPNUM 46
#include @FRAGMENT@
#define APPNUM 47
#include @FRAGMENT@
#define APPNUM 48
#include @FRAGMENT@
#define APPNUM 49
#include @FRAGMENT@
#define APPNUM 50
#include @FRAGMENT@
#define APPNUM 51
#include @FRAGMENT@
#define APPNUM 52
#include @FRAGMENT@
#define APPNUM 53
#include @FRAGMENT@
#define APPNUM 54
#include @FRAGMENT@
#define APPNUM 55
#include @FRAGMENT@
#define APPNUM 56
#include @FRAGMENT@
#define APPNUM 57
#include @FRAGMENT@
#define APPNUM 58
#include @FRAGMENT@
#define APPNUM 59
#include @FRAGMENT@
#define APPNUM 60
#include @FRAGMENT@
#define APPNUM 61
#include @FRAGMENT@
#define APPNUM 62
#include @FRAGMENT@
#define APPNUM 63
#include @FRAGMENT@
#define APPNUM 64
#include @FRAGMENT@
#define APPNUM 65
#include @FRAGMENT@
#define APPNUM 66
#include @FRAGMENT@
#define APPNUM 67
#include @FRAGMENT@
#define APPNUM 68
#include @FRAGMENT@
#define APPNUM 69
#include @FRAGMENT@
#define APPNUM 70
#include @FRAGMENT@
#define APPNUM 71
#include @FRAGMENT@
#define APPNUM 72
#include @FRAGMENT@
#define APPNUM 73
#include @FRAGMENT@
#define APPNUM 74
#include @FRAGMENT@
#define APPNUM 75
#include @FRAGMENT@
#define APPNUM 76
#include @FRAGMENT@
#define APPNUM 77
#include @FRAGMENT@
#define APPNUM 78
#include @FRAGMENT@
#define APPNUM 79
#include @FRAGMENT@
#define APPNUM 80
#include @FRAGMENT@
#define APPNUM 81
#include @FRAGMENT@
#define APPNUM 82
#include @FRAGMENT@
#define APPNUM 83
#include @FRAGMENT@
#define APPNUM 84
#include @FRAGMENT@
#define APPNUM 85
#include @FRAGMENT@
#define APPNUM 86
#include @FRAGMENT@
#define APPNUM 87
#include @FRAGMENT@
#define APPNUM 88
#include @FRAGMENT@
#define APPNUM 89
#include @FRAGMENT@
#define APPNUM 90
#include @FRAGMENT@
#define APPNUM 91
#include @FRAGMENT@
#define APPNUM 92
#include @FRAGMENT@
#define APPNUM 93
#include @FRAGMENT@
#define APPNUM 94
#include @FRAGMENT@
#define APPNUM 95
#include @FRAGMENT@
#define APPNUM 96
#include @FRAGMENT@
#define APPNUM 97
#include @FRAGMENT@
#define APPNUM 98
#include @FRAGMENT@
#define APPNUM 99
#include @FRAGMENT@
#undef APPNUM
#undef FRAGMENT

View File

@ -6,8 +6,12 @@
#filter substitution
package @ANDROID_PACKAGE_NAME@;
/**
* Declare a predefined number of WebApp<num> classes to the WebApps class.
* These are used so that each web app can launch in its own process. Keep this
* number in sync with the number of web apps handled in WebAppAllocator.
*/
public final class WebApps {
#include @OBJDIR@/WebAppsFragments.java
#define FRAGMENT WebAppsFragment.java.frag
#include WebAppFragmentRepeater.inc
}