Bug 975152 - Part 1: Include CrashReporter resources in Android Eclipse projects. r=bnicholson
authorNick Alexander <nalexander@mozilla.com>
Mon, 24 Feb 2014 18:14:04 -0800
changeset 170849 2270c5490879fa12a4393f59e51c940e82fe8167
parent 170848 d5ac8e460f2e3431d96803ad97c837830fe884df
child 170850 97cedf504412852d21aa51632076adc80b2155ae
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersbnicholson
bugs975152
milestone30.0a1
Bug 975152 - Part 1: Include CrashReporter resources in Android Eclipse projects. r=bnicholson The set of resources of all the Android library projects are processed at once. That means that the bi-directional dependency between the main project resources and the crash reporter resources causes no build time problems. Therefore, this patch moves all the main project resources into a library project (FennecResources) and adds an optional additional library project (FennecCrashReporterResources).
mobile/android/base/moz.build
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -490,31 +490,50 @@ generated.package_name = 'org.mozilla.fe
 generated.res = OBJDIR + '/res'
 
 branding = add_android_eclipse_library_project('FennecBrandingResources')
 branding.package_name = 'org.mozilla.fennec.brandingresources'
 branding.res = TOPSRCDIR + '/' + CONFIG['MOZ_BRANDING_DIRECTORY'] + '/res'
 
 main = add_android_eclipse_project('Fennec', OBJDIR + '/AndroidManifest.xml')
 main.package_name = 'org.mozilla.gecko'
-main.res = SRCDIR + '/resources'
 
 main.recursive_make_targets += ['.aapt.deps'] # Captures dependencies on Android manifest and all resources.
 main.recursive_make_targets += [OBJDIR + '/generated/' + f for f in mgjar.generated_sources]
 main.recursive_make_targets += [OBJDIR + '/generated/' + f for f in gbjar.generated_sources]
 
 main.included_projects += ['../' + generated.name, '../' + branding.name]
 main.referenced_projects += [generated.name, branding.name]
 main.extra_jars += [CONFIG['ANDROID_COMPAT_LIB']]
 main.assets = TOPOBJDIR + '/dist/fennec/assets'
 main.libs = TOPOBJDIR + '/dist/fennec/lib'
+main.res = None
 
 cpe = main.add_classpathentry('src', SRCDIR,
     dstdir='src/org/mozilla/gecko',
     exclude_patterns=['org/mozilla/gecko/tests/**',
         'org/mozilla/gecko/resources/**'])
 if not CONFIG['MOZ_CRASHREPORTER']:
     cpe.exclude_patterns += ['org/mozilla/gecko/CrashReporter.java']
 main.add_classpathentry('generated', OBJDIR + '/generated',
     dstdir='generated')
 main.add_classpathentry('thirdparty', TOPSRCDIR + '/mobile/android/thirdparty',
     dstdir='thirdparty',
     ignore_warnings=True)
+
+resources = add_android_eclipse_library_project('FennecResources')
+resources.package_name = 'org.mozilla.fennec.resources'
+resources.res = SRCDIR + '/resources'
+resources.included_projects += ['../' + generated.name, '../' + branding.name]
+resources.referenced_projects += [generated.name, branding.name]
+
+main.included_projects += ['../' + resources.name]
+main.referenced_projects += [resources.name]
+
+if CONFIG['MOZ_CRASHREPORTER']:
+    crashreporter = add_android_eclipse_library_project('FennecCrashReporterResources')
+    crashreporter.package_name = 'org.mozilla.fennec.crashreporterresources'
+    crashreporter.res = SRCDIR + '/crashreporter/res'
+    crashreporter.included_projects += ['../' + resources.name]
+    crashreporter.referenced_projects += [resources.name]
+
+    main.included_projects += ['../' + crashreporter.name]
+    main.referenced_projects += [crashreporter.name]