Ejemplo n.º 1
0
def compile_example_javascripts(t):
    """compile examples into single files
    """
    t.rm_rf('build/examples')
    t.makedirs('build/examples')
    t.cp_r('examples/stable/css', 'build/examples/css')
    EXAMPLES_CONFIG = [
        path for path in ifind('build/cfgexamples/') if path.endswith('.js')
    ]
    for f in EXAMPLES_CONFIG:
        (f_path, f_name) = os.path.split(f)
        htmlf = f_name.replace('.js', '.html')
        t.cp('examples/stable/' + htmlf, 'build/examples/' + htmlf)
        example_build = 'build/examples/' + f.replace('build/cfgexamples/', '')

        @target(example_build, f)
        def compile_example(mytrgt):
            """Compile example"""
            mytrgt.output('%(JAVA)s', '-client', '-XX:+TieredCompilation',
                          '-jar', PLOVR_JAR, 'build', f)

        tar = targets.get(example_build)
        tar.build()

    t.touch()
Ejemplo n.º 2
0
def compile_example_javascripts(t):
    """compile sandboxs examples into single files
    """
    EXAMPLES_CONFIG = [path for path in ifind('build/cfgsandbox/') if path.endswith('.js')]
    for f in EXAMPLES_CONFIG:
        (f_path, f_name) = os.path.split(f)
        htmlf = f_name.replace('.js', '.html');
        t.cp('examples/sandbox/' + htmlf, 'build/examples/' + htmlf)
        example_build = 'build/examples/' + f.replace('build/cfgexamples/', '')

        @target(example_build, f)
        def compile_example(mytrgt):
            """Compile example"""
            mytrgt.output('%(JAVA)s',
                    '-client', '-XX:+TieredCompilation',
                    '-jar', PLOVR_JAR, 'build', f)

        tar = targets.get(example_build)
        tar.build()
Ejemplo n.º 3
0
def compile_workers(trgt):
    """Compile workers"""
    trgt.makedirs('build/workers')

    for worker_src in WORKERS_SRC:
        worker_name = worker_src.replace('src/gs/worker/', '')
        worker_cfg = os.path.join('build/cfgworkers/', worker_name)
        worker_build = os.path.join('build/workers/', worker_name)


        @target(worker_build, 'cfg/workers.json', worker_src)
        def compile_worker(mytrgt):
            """Compile worker"""
            mytrgt.output('%(JAVA)s',
                '-client', '-XX:+TieredCompilation',
                '-jar', PLOVR_JAR, 'build',
                worker_cfg)
        tar = targets.get(worker_build)
        tar.build()

    WORKERS_BUILD = [path for path in ifind('build/workers') if path.endswith('.js')]
    trgt.touch()
Ejemplo n.º 4
0
def compile_workers(trgt):
    """Compile workers"""
    trgt.makedirs('build/workers')

    for worker_src in WORKERS_SRC:
        worker_name = worker_src.replace('src/gs/worker/', '')
        worker_cfg = os.path.join('build/cfgworkers/', worker_name)
        worker_build = os.path.join('build/workers/', worker_name)

        @target(worker_build, 'cfg/workers.json', worker_src)
        def compile_worker(mytrgt):
            """Compile worker"""
            mytrgt.output('%(JAVA)s', '-client', '-XX:+TieredCompilation',
                          '-jar', PLOVR_JAR, 'build', worker_cfg)

        tar = targets.get(worker_build)
        tar.build()

    WORKERS_BUILD = [
        path for path in ifind('build/workers') if path.endswith('.js')
    ]
    trgt.touch()