~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to scons-tools/closure.py

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-06-11 15:45:24 UTC
  • mfrom: (1.2.1) (2.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130611154524-rppb3w6tixlegv4n
Tags: 1.4.7~20130611~a1eb425-1
* New snapshot release
* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os.path
 
2
from SCons.Builder import Builder
 
3
 
 
4
def generate(env):
 
5
    def depend_on_closure_compiler(target, source, env):
 
6
        env.Depends(target, env['CLOSURE_COMPILER'])
 
7
        return target, source
 
8
 
 
9
    ClosureCompiler = Builder(
 
10
        action='$JAVA $JAVAFLAGS -jar $CLOSURE_COMPILER $CLOSURE_FLAGS --js_output_file $TARGET $SOURCES',
 
11
        emitter=depend_on_closure_compiler
 
12
    )
 
13
 
 
14
    closure = os.path.join(
 
15
        os.path.dirname(__file__),
 
16
        '..',
 
17
        'third_party',
 
18
        'closure-compiler',
 
19
        'compiler.jar')
 
20
    closure = env.File(closure)
 
21
 
 
22
    env['JAVA'] = 'java'
 
23
    env['CLOSURE_COMPILER'] = closure
 
24
    env.Append(
 
25
        BUILDERS={'ClosureCompiler':ClosureCompiler})
 
26
 
 
27
def exists(_env):
 
28
    return True