Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: build.py

Issue 6116696976785408: Issue 1590 - Add devenv support for Safari (Closed)
Patch Set: Created Nov. 21, 2014, 10:32 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | packagerChrome.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build.py
===================================================================
--- a/build.py
+++ b/build.py
@@ -4,8 +4,10 @@
# 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, sys, re, subprocess, buildtools
+import os, sys, re, subprocess, shutil, buildtools
from getopt import getopt, GetoptError
+from StringIO import StringIO
+from zipfile import ZipFile
knownTypes = ('gecko', 'chrome', 'opera', 'safari')
@@ -216,8 +218,20 @@
def createDevEnv(baseDir, scriptName, opts, args, type):
- import buildtools.packagerChrome as packager
- packager.createDevEnv(baseDir, type=type)
+ if type == 'safari':
+ import buildtools.packagerSafari as packager
+ else:
+ import buildtools.packagerChrome as packager
+
+ file = StringIO()
+ packager.createBuild(baseDir, type=type, outFile=file, devenv=True, releaseBuild=True)
+
+ devenv_dir = os.path.join(baseDir, 'devenv')
+ shutil.rmtree(devenv_dir, ignore_errors=True)
+
+ file.seek(0)
+ with ZipFile(file, 'r') as zip_file:
+ zip_file.extractall(devenv_dir)
def setupTranslations(baseDir, scriptName, opts, args, type):
@@ -437,7 +451,7 @@
with addCommand(createDevEnv, 'devenv') as command:
command.shortDescription = 'Set up a development environment'
command.description = 'Will set up or update the devenv folder as an unpacked extension folder for development.'
- command.supportedTypes = ('chrome', 'opera')
+ command.supportedTypes = ('chrome', 'opera', 'safari')
with addCommand(setupTranslations, 'setuptrans') as command:
command.shortDescription = 'Sets up translation languages'
« no previous file with comments | « no previous file | packagerChrome.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld