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

Unified Diff: packagerChrome.py

Issue 29600577: Issue 5997 - Avoid including qunit files in release builds (Closed)
Patch Set: Created Nov. 7, 2017, 3:24 p.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 | 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 be749d697775900fc42f64a454ca5e7a01e54775..313c473a65400e3effe9162b52986a3677fa5522 100644
--- a/packagerChrome.py
+++ b/packagerChrome.py
@@ -150,7 +150,7 @@ def toJson(data):
).encode('utf-8') + '\n'
-def create_bundles(params, files):
+def create_bundles(params, files, devenv):
base_extension_path = params['baseDir']
info_templates = {
'chrome': 'chromeInfo.js.tmpl',
@@ -191,6 +191,15 @@ def create_bundles(params, files):
'entry_points': entry_files,
})
+ if devenv:
+ qunit_path = os.path.join(params['baseDir'], 'qunit')
+ qunit_files = ([os.path.join(qunit_path, 'common.js')] +
+ glob.glob(os.path.join(qunit_path, 'tests', '*.js')))
+ configuration['bundles'].append({
+ 'bundle_name': 'qunit/tests.js',
+ 'entry_points': qunit_files
+ })
+
cmd = ['node', os.path.join(os.path.dirname(__file__), 'webpack_runner.js')]
process = subprocess.Popen(cmd, stdout=subprocess.PIPE,
stdin=subprocess.PIPE)
@@ -364,7 +373,7 @@ def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
files.read(baseDir, skip=[opt for opt, _ in mapped])
if metadata.has_section('bundles'):
- create_bundles(params, files)
+ create_bundles(params, files, devenv)
if metadata.has_section('preprocess'):
files.preprocess(
« no previous file with comments | « no previous file | packagerEdge.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld