OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """ | 7 """ |
8 Release: | 8 Release: |
9 - Concatenates autostart modules, application modules' module.json descriptors
, | 9 - Concatenates autostart modules, application modules' module.json descriptors
, |
10 and the application loader into a single script. | 10 and the application loader into a single script. |
(...skipping 13 matching lines...) Expand all Loading... |
24 import os | 24 import os |
25 import re | 25 import re |
26 import shutil | 26 import shutil |
27 import sys | 27 import sys |
28 | 28 |
29 try: | 29 try: |
30 import simplejson as json | 30 import simplejson as json |
31 except ImportError: | 31 except ImportError: |
32 import json | 32 import json |
33 | 33 |
| 34 rjsmin_path = path.abspath(join( |
| 35 path.dirname(__file__), |
| 36 '..', |
| 37 '..', |
| 38 'build', |
| 39 'scripts')) |
| 40 sys.path.append(rjsmin_path) |
34 import rjsmin | 41 import rjsmin |
35 | 42 |
36 | 43 |
37 def resource_source_url(url): | 44 def resource_source_url(url): |
38 return '\n/*# sourceURL=' + url + ' */' | 45 return '\n/*# sourceURL=' + url + ' */' |
39 | 46 |
40 | 47 |
41 def minify_js(javascript): | 48 def minify_js(javascript): |
42 return rjsmin.jsmin(javascript) | 49 return rjsmin.jsmin(javascript) |
43 | 50 |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 symlink_or_copy_file(join(os.getcwd(), self.application_dir, html_name),
join(self.output_dir, html_name), True) | 267 symlink_or_copy_file(join(os.getcwd(), self.application_dir, html_name),
join(self.output_dir, html_name), True) |
261 | 268 |
262 | 269 |
263 def build_application(application_name, loader, application_dir, output_dir, rel
ease_mode): | 270 def build_application(application_name, loader, application_dir, output_dir, rel
ease_mode): |
264 descriptors = loader.load_application(application_name + '.json') | 271 descriptors = loader.load_application(application_name + '.json') |
265 if release_mode: | 272 if release_mode: |
266 builder = ReleaseBuilder(application_name, descriptors, application_dir,
output_dir) | 273 builder = ReleaseBuilder(application_name, descriptors, application_dir,
output_dir) |
267 else: | 274 else: |
268 builder = DebugBuilder(application_name, descriptors, application_dir, o
utput_dir) | 275 builder = DebugBuilder(application_name, descriptors, application_dir, o
utput_dir) |
269 builder.build_app() | 276 builder.build_app() |
OLD | NEW |