Bug 957241 - Don't package the full sdk when we don't need it. r=gps
authorKan-Ru Chen (陳侃如) <kanru@kanru.info>
Mon, 24 Mar 2014 17:09:45 +0800
changeset 193836 060c0e5237701329bfeb07f012de7cf3c3be720c
parent 193835 5169ee8665c4469fe904bee91cdcf5a169b22aec
child 193837 59b7ec33cc3ad7f1720a5ce8f7c5a2aea3baa746
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps
bugs957241
milestone31.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 957241 - Don't package the full sdk when we don't need it. r=gps
addon-sdk/Makefile.in
addon-sdk/copy_source.py
--- a/addon-sdk/Makefile.in
+++ b/addon-sdk/Makefile.in
@@ -1,16 +1,22 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 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
 
 TEST_FILES = \
   source/app-extension \
   source/bin \
   source/python-lib \
--- a/addon-sdk/copy_source.py
+++ b/addon-sdk/copy_source.py
@@ -1,23 +1,24 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 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 = int(sys.argv[4])
 
 print """
 DEPTH     = ..
 topsrcdir = %(topsrcdir)s
 srcdir    = %(topsrcdir)s/addon-sdk
 VPATH     = %(topsrcdir)s/addon-sdk
 
 include $(topsrcdir)/config/config.mk
@@ -30,16 +31,32 @@ if not os.path.exists(real_source):
 elif not os.path.isdir(real_source):
     print >> sys.stderr, "Error: Source %s is not a directory" % real_source
     sys.exit(1)
 for dirpath, dirnames, filenames in os.walk(real_source):
     if not filenames:
         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:
         print "  %s/%s \\" % (dirpath, name)
     print "  $(NULL)"
     print "%s_DEST = %s%s" % (varname, target_dir, relative)
     print "INSTALL_TARGETS += %s\n" % varname