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

Unified Diff: packagerChrome.py

Issue 29575633: Issue 4720 - enable devenv target for Edge packager (Closed)
Patch Set: Addressing Sebastian's comments Created Oct. 18, 2017, 9:24 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 | « build.py ('k') | packagerEdge.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packagerChrome.py
diff --git a/packagerChrome.py b/packagerChrome.py
index 948a9074ce55b2e359237582c27474efcc1cdad6..5a9c0d5e92d8858d40a40611c6a2b64fdef557b3 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -12,6 +12,7 @@ from StringIO import StringIO
import struct
import subprocess
import sys
+import random
from packager import (readMetadata, getDefaultFileName, getBuildVersion,
getTemplate, Files)
@@ -319,6 +320,18 @@ def writePackage(outputFile, pubkey, signature, zipdata):
file.write(zipdata)
+def add_devenv_requirements(files, metadata, params):
+ files.read(os.path.join(os.path.dirname(__file__),
kzar 2017/10/18 13:50:26 Nit: IMO this would look nicer indented differentl
tlucas 2017/10/18 14:29:07 Done.
Sebastian Noack 2017/10/18 22:00:44 FWIW, both look good to me.
+ 'chromeDevenvPoller__.js'),
+ relpath='devenvPoller__.js')
+ files['devenvVersion__'] = str(random.random())
+
+ if metadata.has_option('general', 'testScripts'):
+ files['qunit/index.html'] = createScriptPage(
+ params, 'testIndex.html.tmpl', ('general', 'testScripts')
+ )
+
+
def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuild=False, keyFile=None, devenv=False):
metadata = readMetadata(baseDir, type)
version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum)
@@ -363,15 +376,7 @@ def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
fix_translations_for_chrome(files)
if devenv:
- import buildtools
- import random
- files.read(os.path.join(buildtools.__path__[0], 'chromeDevenvPoller__.js'), relpath='devenvPoller__.js')
- files['devenvVersion__'] = str(random.random())
-
- if metadata.has_option('general', 'testScripts'):
- files['qunit/index.html'] = createScriptPage(
- params, 'testIndex.html.tmpl', ('general', 'testScripts')
- )
+ add_devenv_requirements(files, metadata, params)
zipdata = files.zipToString()
signature = None
« no previous file with comments | « build.py ('k') | packagerEdge.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld