diff options
author | Chad Austin <chad@imvu.com> | 2013-05-17 12:08:55 -0700 |
---|---|---|
committer | Chad Austin <chad@imvu.com> | 2013-05-17 13:04:02 -0700 |
commit | ec19fe482bf564de68a076ed093af131d502bb30 (patch) | |
tree | ee317bc543e16c363ceb8601cc9dacddd1a8dd91 /scons-tools/closure.py | |
parent | d641184152923a119b3c2b7fd51acc71997ff0cd (diff) |
Move emscripten SCons tools into emscripten/scons-tools/
Diffstat (limited to 'scons-tools/closure.py')
-rw-r--r-- | scons-tools/closure.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scons-tools/closure.py b/scons-tools/closure.py new file mode 100644 index 00000000..8f53e507 --- /dev/null +++ b/scons-tools/closure.py @@ -0,0 +1,28 @@ +import os.path +from SCons.Builder import Builder + +def generate(env): + def depend_on_closure_compiler(target, source, env): + env.Depends(target, env['CLOSURE_COMPILER']) + return target, source + + ClosureCompiler = Builder( + action='$JAVA $JAVAFLAGS -jar $CLOSURE_COMPILER $CLOSURE_FLAGS --js_output_file $TARGET $SOURCES', + emitter=depend_on_closure_compiler + ) + + closure = os.path.join( + os.path.dirname(__file__), + '..', + 'third_party', + 'closure-compiler', + 'compiler.jar') + closure = env.File(closure) + + env['JAVA'] = 'java' + env['CLOSURE_COMPILER'] = closure + env.Append( + BUILDERS={'ClosureCompiler':ClosureCompiler}) + +def exists(_env): + return True |