Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5752)

Unified Diff: chrome/browser/resources/vulcanize_gn.py

Issue 2698143003: [MD WebUI] Polymer-CSS-Build across all bundles. (Closed)
Patch Set: address comments Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/vulcanize.gni ('k') | third_party/node/node.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/vulcanize_gn.py
diff --git a/chrome/browser/resources/vulcanize_gn.py b/chrome/browser/resources/vulcanize_gn.py
index 4962d083c5fff8da4253b7563482a17bdf0a2993..0cfca6e41188bdaa4b6de2a6c2b743eb986314ae 100755
--- a/chrome/browser/resources/vulcanize_gn.py
+++ b/chrome/browser/resources/vulcanize_gn.py
@@ -8,7 +8,6 @@ import itertools
import os
import platform
import re
-import subprocess
import sys
import tempfile
@@ -74,19 +73,6 @@ _VULCANIZE_REDIRECT_ARGS = list(itertools.chain.from_iterable(map(
_PAK_UNPACK_FOLDER = 'flattened'
-def _run_node(cmd_parts, stdout=None):
- cmd = " ".join([node.GetBinaryPath()] + cmd_parts)
- process = subprocess.Popen(
- cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
- stdout, stderr = process.communicate()
-
- if stderr:
- print >> sys.stderr, '%s failed: %s' % (cmd, stderr)
- raise
-
- return stdout
-
-
def _undo_mapping(mappings, url):
for (redirect_url, file_path) in mappings:
if url.startswith(redirect_url):
@@ -154,7 +140,7 @@ def _vulcanize(in_folder, args):
exclude_args.append('--exclude')
exclude_args.append(f)
- output = _run_node(
+ output = node.RunNode(
[node_modules.PathToVulcanize()] +
_VULCANIZE_BASE_ARGS + _VULCANIZE_REDIRECT_ARGS + exclude_args +
['--out-request-list', _request_list_path(out_path, args.html_out_file),
@@ -179,26 +165,19 @@ def _vulcanize(in_folder, args):
tmp.write(output)
try:
- _run_node([node_modules.PathToCrisper(),
- '--source', tmp.name,
- '--script-in-head', 'false',
- '--html', html_out_path,
- '--js', js_out_path])
-
- _run_node([node_modules.PathToUglifyJs(), js_out_path,
- '--comments', '"/Copyright|license|LICENSE|\<\/?if/"',
- '--output', js_out_path])
+ node.RunNode([node_modules.PathToCrisper(),
+ '--source', tmp.name,
+ '--script-in-head', 'false',
+ '--html', html_out_path,
+ '--js', js_out_path])
+
+ node.RunNode([node_modules.PathToUglifyJs(), js_out_path,
+ '--comments', '"/Copyright|license|LICENSE|\<\/?if/"',
+ '--output', js_out_path])
finally:
os.remove(tmp.name)
-def _css_build(out_folder, files):
- out_path = os.path.join(_CWD, out_folder)
- paths = [os.path.join(out_path, f) for f in files]
-
- _run_node([node_modules.PathToPolymerCssBuild()] + paths)
-
-
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('--depfile', required=True)
@@ -230,7 +209,6 @@ def main(argv):
vulcanize_input_folder = output_folder
_vulcanize(vulcanize_input_folder, args)
- _css_build(args.out_folder, files=[args.html_out_file])
_update_dep_file(vulcanize_input_folder, args)
« no previous file with comments | « chrome/browser/resources/vulcanize.gni ('k') | third_party/node/node.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698