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

Side by Side Diff: chrome/browser/resources/uglify_gn.py

Issue 2980933002: DO NOT SUBMIT, Uglify print preview resources, WIP.
Patch Set: Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/print_preview/BUILD.gn ('k') | chrome/browser/resources/vulcanize.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright 2017 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import argparse
7 import os
8 import sys
9
10 _HERE_PATH = os.path.dirname(__file__)
11 _SRC_PATH = os.path.normpath(os.path.join(_HERE_PATH, '..', '..', '..'))
12 _CWD = os.getcwd()
13
14 sys.path.append(os.path.join(_SRC_PATH, 'third_party', 'node'))
15 import node
16 import node_modules
17
18 def _uglify(base_folder, out_folder, input_files, output_file):
19 out_path = os.path.join(_CWD, out_folder)
20 in_file_paths = map(lambda f: os.path.join(base_folder, f), input_files)
21 out_file_path = os.path.join(out_path, output_file)
22
23 args = in_file_paths + [
24 '--comments', '"/Copyright|license|LICENSE|\<\/?if/"',
25 '--output', out_file_path]
26 node.RunNode([node_modules.PathToUglify()] + args)
27
28
29 def main():
30 parser = argparse.ArgumentParser()
31 parser.add_argument('--base_folder', required=True)
32 parser.add_argument('--out_folder', required=True)
33 parser.add_argument('--input_files', nargs='+')
34 parser.add_argument('--output_file', required=True)
35 args = parser.parse_args()
36
37 _uglify(
38 args.base_folder,
39 args.out_folder,
40 input_files=args.input_files,
41 output_file=args.output_file)
42
43
44 if __name__ == '__main__':
45 main()
OLDNEW
« no previous file with comments | « chrome/browser/resources/print_preview/BUILD.gn ('k') | chrome/browser/resources/vulcanize.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698