From 28b89eeefbf2ae002daef5c36e8e863efd2cbbc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Thu, 9 Jan 2014 16:32:19 -0800 Subject: [PATCH] Bug 957241 - Don't package the full sdk when we don't need it r=gps --- addon-sdk/Makefile.in | 8 +++++++- addon-sdk/copy_source.py | 21 +++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/addon-sdk/Makefile.in b/addon-sdk/Makefile.in index c4b3ee11d30..6e893381d28 100644 --- a/addon-sdk/Makefile.in +++ b/addon-sdk/Makefile.in @@ -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 diff --git a/addon-sdk/copy_source.py b/addon-sdk/copy_source.py index 2710eca103b..e504f556e9a 100644 --- a/addon-sdk/copy_source.py +++ b/addon-sdk/copy_source.py @@ -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 " \ - " " + " " 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: