| 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) | |
| 41 import rjsmin | 34 import rjsmin |
| 42 | 35 |
| 43 | 36 |
| 44 def resource_source_url(url): | 37 def resource_source_url(url): |
| 45 return '\n/*# sourceURL=' + url + ' */' | 38 return '\n/*# sourceURL=' + url + ' */' |
| 46 | 39 |
| 47 | 40 |
| 48 def minify_js(javascript): | 41 def minify_js(javascript): |
| 49 return rjsmin.jsmin(javascript) | 42 return rjsmin.jsmin(javascript) |
| 50 | 43 |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 symlink_or_copy_file(join(os.getcwd(), self.application_dir, html_name),
join(self.output_dir, html_name), True) | 260 symlink_or_copy_file(join(os.getcwd(), self.application_dir, html_name),
join(self.output_dir, html_name), True) |
| 268 | 261 |
| 269 | 262 |
| 270 def build_application(application_name, loader, application_dir, output_dir, rel
ease_mode): | 263 def build_application(application_name, loader, application_dir, output_dir, rel
ease_mode): |
| 271 descriptors = loader.load_application(application_name + '.json') | 264 descriptors = loader.load_application(application_name + '.json') |
| 272 if release_mode: | 265 if release_mode: |
| 273 builder = ReleaseBuilder(application_name, descriptors, application_dir,
output_dir) | 266 builder = ReleaseBuilder(application_name, descriptors, application_dir,
output_dir) |
| 274 else: | 267 else: |
| 275 builder = DebugBuilder(application_name, descriptors, application_dir, o
utput_dir) | 268 builder = DebugBuilder(application_name, descriptors, application_dir, o
utput_dir) |
| 276 builder.build_app() | 269 builder.build_app() |
| OLD | NEW |