|
3 | 3 | raise Exception("Blockly build only compatible with Python 2.x.\n" |
4 | 4 | "You are using: " + sys.version) |
5 | 5 |
|
6 | | -import errno, glob, httplib, json, os, re, subprocess, threading, urllib |
| 6 | +import errno, glob, httplib, json, os, re, subprocess, threading, urllib, shutil |
7 | 7 |
|
8 | 8 | CLOSURE_DIR = os.path.pardir |
9 | 9 | CLOSURE_ROOT = os.path.pardir |
@@ -181,12 +181,17 @@ def gen_core(self, vertical): |
181 | 181 | # Read in all the source files. |
182 | 182 | filenames = calcdeps.CalculateDependencies(search_paths, |
183 | 183 | [os.path.join("core", "blockly.js")]) |
| 184 | + |
| 185 | + |
| 186 | + |
184 | 187 | filenames.sort() # Deterministic build. |
| 188 | + if not os.path.exists('goog'): |
| 189 | + shutil.copytree('node_modules\\google-closure-library\\closure\\goog','goog') |
185 | 190 | for filename in filenames: |
| 191 | + filename = filename.replace("node_modules\\google-closure-library\\closure\\","") |
186 | 192 | # Append filenames as false arguments the step before compiling will |
187 | 193 | # either transform them into arguments for local or remote compilation |
188 | 194 | params.append(("js_file", filename)) |
189 | | - |
190 | 195 | self.do_compile(params, target_filename, filenames, "") |
191 | 196 |
|
192 | 197 | def gen_blocks(self, block_type): |
@@ -237,7 +242,7 @@ def do_compile_jar(self, params, target_filename): |
237 | 242 | args = [] |
238 | 243 | for group in [["java -jar google-closure-compiler.jar"], dash_params]: |
239 | 244 | args.extend(group) |
240 | | - # print args |
| 245 | + print " ".join(args) |
241 | 246 | if sys.platform == "darwin": |
242 | 247 | proc = subprocess.Popen(" ".join(args), stdin=subprocess.PIPE, stdout=subprocess.PIPE) |
243 | 248 | else: |
|
0 commit comments