OLD | NEW |
1 #!/usr/bin/env python2 | 1 #!/usr/bin/env python2 |
2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
3 | 3 |
4 # Copyright 2015 Google Inc. All Rights Reserved. | 4 # Copyright 2015 Google Inc. All Rights Reserved. |
5 # | 5 # |
6 # Licensed under the Apache License, Version 2.0 (the "License"); | 6 # Licensed under the Apache License, Version 2.0 (the "License"); |
7 # you may not use this file except in compliance with the License. | 7 # you may not use this file except in compliance with the License. |
8 # You may obtain a copy of the License at | 8 # You may obtain a copy of the License at |
9 # | 9 # |
10 # http://www.apache.org/licenses/LICENSE-2.0 | 10 # http://www.apache.org/licenses/LICENSE-2.0 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 /** | 90 /** |
91 * @const An array of filenames of cached files. | 91 * @const An array of filenames of cached files. |
92 */ | 92 */ |
93 var CACHED_FILES = [ | 93 var CACHED_FILES = [ |
94 {joined_filepaths} | 94 {joined_filepaths} |
95 ]; | 95 ]; |
96 | 96 |
97 importScripts('{boilerplate_dir}/caterpillar.js'); | 97 importScripts('{boilerplate_dir}/caterpillar.js'); |
98 importScripts('{boilerplate_dir}/sw_static.js'); | 98 importScripts('{boilerplate_dir}/sw_static.js'); |
99 | 99 |
100 // Ignore calls to chrome.app.runtime.onLaunched.addListener from the background | |
101 // scripts. | |
102 chrome.app = {{ | |
103 runtime: {{ | |
104 onLaunched: {{ | |
105 addListener: function() {{}} | |
106 }} | |
107 }} | |
108 }}; | |
109 | |
110 // TODO: (Caterpillar) Edit background scripts to remove chrome.app.runtime | 100 // TODO: (Caterpillar) Edit background scripts to remove chrome.app.runtime |
111 // dependence. | 101 // dependence. |
112 """ | 102 """ |
113 | 103 |
114 | 104 |
115 def setup_output_dir(input_dir, output_dir, boilerplate_dir, force=False): | 105 def setup_output_dir(input_dir, output_dir, boilerplate_dir, force=False): |
116 """Sets up the output web app directory tree. | 106 """Sets up the output web app directory tree. |
117 | 107 |
118 Copies all files from the input Chrome App to the output web app, and creates | 108 Copies all files from the input Chrome App to the output web app, and creates |
119 a subdirectory for the boilerplate code. | 109 a subdirectory for the boilerplate code. |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 if args.mode == 'config': | 714 if args.mode == 'config': |
725 configuration.generate_and_save(args.output, args.interactive) | 715 configuration.generate_and_save(args.output, args.interactive) |
726 | 716 |
727 elif args.mode == 'convert': | 717 elif args.mode == 'convert': |
728 config = configuration.load(args.config) | 718 config = configuration.load(args.config) |
729 convert_app(args.input, args.output, config, args.force) | 719 convert_app(args.input, args.output, config, args.force) |
730 | 720 |
731 | 721 |
732 if __name__ == '__main__': | 722 if __name__ == '__main__': |
733 sys.exit(main()) | 723 sys.exit(main()) |
OLD | NEW |