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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 /** | 96 /** |
97 * An array of filenames of cached files. | 97 * An array of filenames of cached files. |
98 */ | 98 */ |
99 var CACHED_FILES = [ | 99 var CACHED_FILES = [ |
100 {joined_filepaths} | 100 {joined_filepaths} |
101 ]; | 101 ]; |
102 | 102 |
103 importScripts('{boilerplate_dir}/caterpillar.js'); | 103 importScripts('{boilerplate_dir}/caterpillar.js'); |
104 importScripts('{boilerplate_dir}/sw_static.js'); | 104 importScripts('{boilerplate_dir}/sw_static.js'); |
105 | 105 |
106 // Ignore calls to chrome.app.runtime.onLaunched.addListener from the background | |
107 // scripts. | |
108 chrome.app = {{ | |
109 runtime: {{ | |
110 onLaunched: {{ | |
111 addListener: function() {{}} | |
112 }} | |
113 }} | |
114 }}; | |
115 | |
116 // TODO(Caterpillar): Edit background scripts to remove chrome.app.runtime | 106 // TODO(Caterpillar): Edit background scripts to remove chrome.app.runtime |
117 // dependence. | 107 // dependence. |
118 """ | 108 """ |
119 | 109 |
120 | 110 |
121 def setup_output_dir(input_dir, output_dir, boilerplate_dir, force=False): | 111 def setup_output_dir(input_dir, output_dir, boilerplate_dir, force=False): |
122 """Sets up the output web app directory tree. | 112 """Sets up the output web app directory tree. |
123 | 113 |
124 Copies all files from the input Chrome App to the output web app, and creates | 114 Copies all files from the input Chrome App to the output web app, and creates |
125 a subdirectory for the boilerplate code. | 115 a subdirectory for the boilerplate code. |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
768 if args.mode == 'config': | 758 if args.mode == 'config': |
769 configuration.generate_and_save(args.output, args.interactive) | 759 configuration.generate_and_save(args.output, args.interactive) |
770 | 760 |
771 elif args.mode == 'convert': | 761 elif args.mode == 'convert': |
772 config = configuration.load(args.config) | 762 config = configuration.load(args.config) |
773 convert_app(args.input, args.output, config, args.force) | 763 convert_app(args.input, args.output, config, args.force) |
774 | 764 |
775 | 765 |
776 if __name__ == '__main__': | 766 if __name__ == '__main__': |
777 sys.exit(main()) | 767 sys.exit(main()) |
OLD | NEW |