Bug 957241 - Don't package the full sdk when we don't need it r=gps

This commit is contained in:
Fabrice Desré 2014-01-09 16:32:19 -08:00
parent b48922f951
commit 28b89eeefb
2 changed files with 26 additions and 3 deletions

View File

@ -4,8 +4,14 @@
include $(topsrcdir)/config/config.mk
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
MOZ_B2G=1
else
MOZ_B2G=0
endif
libs::
$(PYTHON) $(srcdir)/copy_source.py $(topsrcdir) $(srcdir)/source/lib $(FINAL_TARGET)/modules/commonjs >copy_source.mk
$(PYTHON) $(srcdir)/copy_source.py $(topsrcdir) $(srcdir)/source/lib $(FINAL_TARGET)/modules/commonjs $(MOZ_B2G) >copy_source.mk
$(MAKE) -f copy_source.mk libs
include $(topsrcdir)/config/rules.mk

View File

@ -5,14 +5,15 @@
import os
import sys
if len(sys.argv) != 4:
if len(sys.argv) != 5:
print >> sys.stderr, "Usage: copy_source.py " \
"<topsrcdir> <source directory> <target directory>"
"<topsrcdir> <source directory> <target directory> <isb2g>"
sys.exit(1)
topsrcdir = sys.argv[1]
source_dir = sys.argv[2]
target_dir = sys.argv[3]
isB2G = sys.argv[4]
print """
DEPTH = ..
@ -35,6 +36,22 @@ for dirpath, dirnames, filenames in os.walk(real_source):
continue
dirpath = dirpath.replace(os.sep, '/')
relative = dirpath[len(source_dir):]
if isB2G and relative in [
'/method/test',
'/sdk/ui',
'/sdk/ui/button',
'/sdk/ui/sidebar',
'/sdk/places',
'/sdk/places/host',
'/sdk/tabs',
'/sdk/panel',
'/sdk/frame',
'/sdk/test',
'/sdk/window',
'/sdk/windows',
'/sdk/deprecated',
]:
continue
varname = "COMMONJS%s" % relative.replace('/', '_')
print "%s_FILES = \\" % varname
for name in filenames: