Exemplo n.º 1
0
def run_plovr_example_server(t):
    EXAMPLES_CONFIG = [
        path for path in ifind('build/cfgexamples/') if path.endswith('.js')
    ]
    WORKERS_CONFIG = [
        path for path in ifind('build/cfgworkers/') if path.endswith('.js')
    ]
    t.output('%(JAVA)s', '-jar', PLOVR_JAR, 'serve', EXAMPLES_CONFIG,
             WORKERS_CONFIG)
Exemplo n.º 2
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()
Exemplo n.º 3
0
Arquivo: build.py Projeto: szymonc/ol3
def build_lint_src_timestamp(t):
    limited_doc_files = [
        path
        for path in ifind('externs', 'build/src/external/externs')
        if path.endswith('.js')]
    t.run('%(GJSLINT)s', '--strict', '--limited_doc_files=%s' %
          (','.join(limited_doc_files),), t.newer(t.dependencies))
    t.touch()
Exemplo n.º 4
0
def build_lint_src_timestamp(t):
    limited_doc_files = [path for path in ifind("externs", "build/src/external/externs") if path.endswith(".js")]
    t.run(
        "%(GJSLINT)s",
        "--strict",
        "--limited_doc_files=%s" % (",".join(limited_doc_files),),
        t.newer(SRC, INTERNAL_SRC, EXTERNAL_SRC, EXAMPLES_SRC),
    )
    t.touch()
Exemplo n.º 5
0
def build_lint_src_timestamp(t):
    limited_doc_files = [
        path for path in ifind('externs', 'build/src/external/externs')
        if path.endswith('.js')
    ]
    t.run('%(GJSLINT)s', '--jslint_error=all',
          '--limited_doc_files=%s' % (','.join(limited_doc_files), ),
          '--strict', t.newer(t.dependencies))
    t.touch()
Exemplo n.º 6
0
def build_lint_generated_timestamp(t):
    limited_doc_files = [path for path in ifind("externs", "build/src/external/externs") if path.endswith(".js")]
    t.run(
        "%(GJSLINT)s",
        "--jslint_error=all",
        # ignore error for max line length (for these auto-generated sources)
        "--disable=110",
        # for a complete list of error codes to allow, see
        # http://closure-linter.googlecode.com/svn/trunk/closure_linter/errors.py
        "--limited_doc_files=%s" % (",".join(limited_doc_files),),
        "--strict",
        t.newer(t.dependencies),
    )
    t.touch()
Exemplo n.º 7
0
def build_lint_generated_timestamp(t):
    limited_doc_files = [
        path
        for path in ifind('externs', 'build/src/external/externs')
        if path.endswith('.js')]
    t.run('%(GJSLINT)s',
          '--jslint_error=all',
          # ignore error for max line length (for these auto-generated sources)
          '--disable=110',
          # for a complete list of error codes to allow, see
          # http://closure-linter.googlecode.com/svn/trunk/closure_linter/errors.py
          '--limited_doc_files=%s' % (','.join(limited_doc_files),),
          '--strict',
          t.newer(t.dependencies))
    t.touch()
Exemplo n.º 8
0
Arquivo: build.py Projeto: frkator/ol3
def build_lint_generated_timestamp(t):
    limited_doc_files = [
        path
        for path in ifind('externs', 'build/src/external/externs')
        if path.endswith('.js')]
    t.run('%(GJSLINT)s',
          '--jslint_error=all',
          # ignore error for max line length (for these auto-generated sources)
          '--disable=110',
          # for a complete list of error codes to allow, see
          # http://closure-linter.googlecode.com/svn/trunk/closure_linter/errors.py
          '--limited_doc_files=%s' % (','.join(limited_doc_files),),
          '--strict',
          t.newer(t.dependencies))
    t.touch()
Exemplo n.º 9
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()
Exemplo n.º 10
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()
Exemplo n.º 11
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()
Exemplo n.º 12
0
Arquivo: build.py Projeto: bily/ol3
    variables.JAVA = 'C:/Program Files/Java/jre7/bin/java.exe'
    variables.JSDOC = 'jsdoc'  # FIXME
    variables.PHANTOMJS = 'phantomjs'  # FIXME
    variables.PYTHON = 'C:/Python27/python.exe'
else:
    variables.GIT = 'git'
    variables.GJSLINT = 'gjslint'
    variables.JAVA = 'java'
    variables.JSDOC = 'jsdoc'
    variables.PHANTOMJS = 'phantomjs'
    variables.PYTHON = 'python'

variables.BRANCH = output('%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXPORTS = [path
           for path in ifind('src')
           if path.endswith('.exports')
           if path != 'src/objectliterals.exports']

EXTERNAL_SRC = [
    'build/src/external/externs/types.js',
    'build/src/external/src/exports.js',
    'build/src/external/src/types.js']

EXAMPLES = [path
            for path in glob.glob('examples/*.html')
            if path != 'examples/example-list.html']

EXAMPLES_SRC = [path
                for path in ifind('examples')
                if path.endswith('.js')
Exemplo n.º 13
0
def build_check_requires_timestamp(t):
    unused_count = 0
    all_provides = set()
    closure_lib_path = output('node', '-e',
        'process.stdout.write(require("closure-util").getLibraryPath())')
    for filename in ifind(closure_lib_path):
        if filename.endswith('.js'):
            if not re.match(r'.*/closure/goog/', filename):
                continue
            # Skip goog.i18n because it contains so many modules that it causes
            # the generated regular expression to exceed Python's limits
            if re.match(r'.*/closure/goog/i18n/', filename):
                continue
            for line in open(filename, 'rU'):
                m = re.match(r'goog.provide\(\'(.*)\'\);', line)
                if m:
                    all_provides.add(m.group(1))
    for filename in sorted(t.dependencies):
        require_linenos = {}
        uses = set()
        lines = open(filename, 'rU').readlines()
        for lineno, line in _strip_comments(lines):
            m = re.match(r'goog.provide\(\'(.*)\'\);', line)
            if m:
                all_provides.add(m.group(1))
                continue
            m = re.match(r'goog.require\(\'(.*)\'\);', line)
            if m:
                require_linenos[m.group(1)] = lineno
                continue
        ignore_linenos = require_linenos.values()
        for lineno, line in enumerate(lines):
            if lineno in ignore_linenos:
                continue
            for require in require_linenos.iterkeys():
                if require in line:
                    uses.add(require)
        for require in sorted(set(require_linenos.keys()) - uses):
            t.info('%s:%d: unused goog.require: %r' % (
                filename, require_linenos[require], require))
            unused_count += 1
    all_provides.discard('ol')
    all_provides.discard('ol.MapProperty')

    class Node(object):

        def __init__(self):
            self.present = False
            self.children = {}

        def _build_re(self, key):
            if key == '*':
                assert len(self.children) == 0
                # We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
                return '(?=\\.[a-z]\\w*\\b(?!\\.))'
            elif len(self.children) == 1:
                child_key, child = next(self.children.iteritems())
                child_re = child._build_re(child_key)
                if child_key != '*':
                    child_re = '\\.' + child_re
                if self.present:
                    return key + '(' + child_re + ')?'
                else:
                    return key + child_re
            elif self.children:
                children_re = '(?:' + '|'.join(
                    ('\\.' if k != '*' else '') + self.children[k]._build_re(k)
                    for k in sorted(self.children.keys())) + ')'
                if self.present:
                    return key + children_re + '?'
                else:
                    return key + children_re
            else:
                assert self.present
                return key

        def build_re(self, key):
            return re.compile('\\b' + self._build_re(key) + '\\b')
    root = Node()
    for provide in all_provides:
        node = root
        for component in provide.split('.'):
            if component not in node.children:
                node.children[component] = Node()
            node = node.children[component]
        if component[0].islower():
            # We've arrived at a namespace provide like `ol.foo`.
            # In this case, we want to match uses like `ol.foo.doIt()` but
            # not match things like `new ol.foo.SomeClass()`.
            # For this purpose, we use the special wildcard key for the child.
            node.children['*'] = Node()
        else:
            node.present = True
    provide_res = [child.build_re(key)
                   for key, child in root.children.iteritems()]
    missing_count = 0
    for filename in sorted(t.dependencies):
        provides = set()
        requires = set()
        uses = set()
        uses_linenos = {}
        for lineno, line in _strip_comments(open(filename, 'rU')):
            m = re.match(r'goog.provide\(\'(.*)\'\);', line)
            if m:
                provides.add(m.group(1))
                continue
            m = re.match(r'goog.require\(\'(.*)\'\);', line)
            if m:
                requires.add(m.group(1))
                continue
            while True:
                for provide_re in provide_res:
                    m = provide_re.search(line)
                    if m:
                        uses.add(m.group())
                        uses_linenos[m.group()] = lineno
                        line = line[:m.start()] + line[m.end():]
                        break
                else:
                    break
        if filename == 'src/ol/renderer/layerrenderer.js':
            uses.discard('ol.renderer.Map')
        m = re.match(
            r'src/ol/renderer/(\w+)/\1(\w*)layerrenderer\.js\Z', filename)
        if m:
            uses.discard('ol.renderer.Map')
            uses.discard('ol.renderer.%s.Map' % (m.group(1),))
        missing_requires = uses - requires - provides
        if missing_requires:
            for missing_require in sorted(missing_requires):
                t.info("%s:%d missing goog.require('%s')" %
                       (filename, uses_linenos[missing_require], missing_require))
                missing_count += 1
    if unused_count or missing_count:
        t.error('%d unused goog.requires, %d missing goog.requires' %
                (unused_count, missing_count))
    t.touch()
Exemplo n.º 14
0
    variables.CLEANCSS = './node_modules/.bin/cleancss'
    variables.GIT = 'git'
    variables.GJSLINT = 'gjslint'
    variables.JSHINT = './node_modules/.bin/jshint'
    variables.JSDOC = './node_modules/.bin/jsdoc'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = './node_modules/.bin/phantomjs'

variables.BRANCH = output(
    '%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXECUTABLES = [variables.CLEANCSS, variables.GIT, variables.GJSLINT,
               variables.JSDOC, variables.JSHINT, variables.PYTHON,
               variables.PHANTOMJS]

EXAMPLES_SRC_ALL = [path for path in ifind('examples')]

EXAMPLES_SRC_HTML = [path
            for path in EXAMPLES_SRC_ALL
            if path.endswith('.html')
            if path != 'examples/index.html']

EXAMPLES_SRC_JS = [example.replace('.html', '.js')
            for example in EXAMPLES_SRC_HTML]

EXAMPLES_DEST_ALL = [path.replace('examples', 'build/examples')
            for path in EXAMPLES_SRC_ALL]

GLSL_SRC = [path
            for path in ifind('src')
            if path.endswith('.glsl')]
Exemplo n.º 15
0
    variables.GIT = 'git'
    variables.GJSLINT = 'gjslint'
    variables.JSHINT = './node_modules/.bin/jshint'
    variables.JSDOC = './node_modules/.bin/jsdoc'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = './node_modules/.bin/phantomjs'

variables.BRANCH = output(
    '%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXECUTABLES = [variables.CLEANCSS, variables.GIT, variables.GJSLINT,
               variables.JSDOC, variables.JSHINT, variables.PYTHON,
               variables.PHANTOMJS]

EXAMPLES = [path
            for path in ifind('examples')
            if path.endswith('.html')
            if path != 'examples/index.html']

EXAMPLES_SRC = [path
                for path in ifind('examples')
                if path.endswith('.js')
                if not path.endswith('.combined.js')
                if path != 'examples/Jugl.js'
                if path != 'examples/example-list.js']

EXAMPLES_JSON = ['build/' + example.replace('.html', '.json')
                 for example in EXAMPLES]

EXAMPLES_COMBINED = ['build/' + example.replace('.html', '.combined.js')
                     for example in EXAMPLES]
Exemplo n.º 16
0
# Change the python working directory to be where this script is located
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)

if sys.platform == 'win32':
   variables.JAVA = 'C:/Program Files/Java/jre7/bin/java.exe'
   variables.PYTHON = 'C:/Python27/python.exe'
else:
   variables.JAVA = 'java'
   variables.JAR = 'jar'
   variables.JSDOC = 'jsdoc'
   variables.PYTHON = 'python'

SPEC = [path
        for path in ifind('specs')
        if path.endswith('.js')]

SRC = [path
       for path in ifind('src')
       if path.endswith('.js')]

HTML = [path 
        for path in ifind('src/html')
        if path.endswith('.html')]

# Reorder to move gisportal.js to the front
SRC.remove('src/gisportal.js')
SRC.insert(0, 'src/gisportal.js')
# Reorder to move portal to the back
SRC.remove('src/portal.js')
Exemplo n.º 17
0
    variables.GIT = 'git'
    variables.GJSLINT = 'gjslint'
    variables.JSHINT = './node_modules/.bin/jshint'
    variables.JSDOC = './node_modules/.bin/jsdoc'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = './node_modules/.bin/phantomjs'

variables.BRANCH = output('%(GIT)s', 'rev-parse', '--abbrev-ref',
                          'HEAD').strip()

EXECUTABLES = [
    variables.CLEANCSS, variables.GIT, variables.GJSLINT, variables.JSDOC,
    variables.JSHINT, variables.PYTHON, variables.PHANTOMJS
]

EXAMPLES_SRC_ALL = [path for path in ifind('examples')]

EXAMPLES_SRC_HTML = [
    path for path in EXAMPLES_SRC_ALL if path.endswith('.html')
    if path != 'examples/index.html'
]

EXAMPLES_SRC_JS = [
    example.replace('.html', '.js') for example in EXAMPLES_SRC_HTML
]

EXAMPLES_DEST_ALL = [
    path.replace('examples', 'build/examples') for path in EXAMPLES_SRC_ALL
]

GLSL_SRC = [path for path in ifind('src') if path.endswith('.glsl')]
Exemplo n.º 18
0
Arquivo: build.py Projeto: igrcic/ol3
def build_check_requires_timestamp(t):
    unused_count = 0
    all_provides = set()
    closure_lib_path = output('node', '-e',
        'process.stdout.write(require("closure-util").getLibraryPath())')
    for filename in ifind(closure_lib_path):
        if filename.endswith('.js'):
            if not re.match(r'.*/closure/goog/', filename):
                continue
            # Skip goog.i18n because it contains so many modules that it causes
            # the generated regular expression to exceed Python's limits
            if re.match(r'.*/closure/goog/i18n/', filename):
                continue
            for line in open(filename, 'rU'):
                m = re.match(r'goog.provide\(\'(.*)\'\);', line)
                if m:
                    all_provides.add(m.group(1))
    for filename in sorted(t.dependencies):
        require_linenos = {}
        uses = set()
        lines = open(filename, 'rU').readlines()
        for lineno, line in _strip_comments(lines):
            m = re.match(r'goog.provide\(\'(.*)\'\);', line)
            if m:
                all_provides.add(m.group(1))
                continue
            m = re.match(r'goog.require\(\'(.*)\'\);', line)
            if m:
                require_linenos[m.group(1)] = lineno
                continue
        ignore_linenos = require_linenos.values()
        for lineno, line in enumerate(lines):
            if lineno in ignore_linenos:
                continue
            for require in require_linenos.iterkeys():
                if require in line:
                    uses.add(require)
        for require in sorted(set(require_linenos.keys()) - uses):
            t.info('%s:%d: unused goog.require: %r' % (
                filename, require_linenos[require], require))
            unused_count += 1
    all_provides.discard('ol')
    all_provides.discard('ol.MapProperty')

    class Node(object):

        def __init__(self):
            self.present = False
            self.children = {}

        def _build_re(self, key):
            if key == '*':
                assert len(self.children) == 0
                # We want to match `.doIt` but not `.SomeClass` or `.more.stuff`
                return '(?=\\.[a-z]\\w*\\b(?!\\.))'
            elif len(self.children) == 1:
                child_key, child = next(self.children.iteritems())
                child_re = child._build_re(child_key)
                if child_key != '*':
                    child_re = '\\.' + child_re
                if self.present:
                    return key + '(' + child_re + ')?'
                else:
                    return key + child_re
            elif self.children:
                children_re = '(?:' + '|'.join(
                    ('\\.' if k != '*' else '') + self.children[k]._build_re(k)
                    for k in sorted(self.children.keys())) + ')'
                if self.present:
                    return key + children_re + '?'
                else:
                    return key + children_re
            else:
                assert self.present
                return key

        def build_re(self, key):
            return re.compile('\\b' + self._build_re(key) + '\\b')
    root = Node()
    for provide in all_provides:
        node = root
        for component in provide.split('.'):
            if component not in node.children:
                node.children[component] = Node()
            node = node.children[component]
        if component[0].islower():
            # We've arrived at a namespace provide like `ol.foo`.
            # In this case, we want to match uses like `ol.foo.doIt()` but
            # not match things like `new ol.foo.SomeClass()`.
            # For this purpose, we use the special wildcard key for the child.
            node.children['*'] = Node()
        else:
            node.present = True
    provide_res = [child.build_re(key)
                   for key, child in root.children.iteritems()]
    missing_count = 0
    for filename in sorted(t.dependencies):
        provides = set()
        requires = set()
        uses = set()
        uses_linenos = {}
        for lineno, line in _strip_comments(open(filename, 'rU')):
            m = re.match(r'goog.provide\(\'(.*)\'\);', line)
            if m:
                provides.add(m.group(1))
                continue
            m = re.match(r'goog.require\(\'(.*)\'\);', line)
            if m:
                requires.add(m.group(1))
                continue
            while True:
                for provide_re in provide_res:
                    m = provide_re.search(line)
                    if m:
                        uses.add(m.group())
                        uses_linenos[m.group()] = lineno
                        line = line[:m.start()] + line[m.end():]
                        break
                else:
                    break
        if filename == 'src/ol/renderer/layerrenderer.js':
            uses.discard('ol.renderer.Map')
        m = re.match(
            r'src/ol/renderer/(\w+)/\1(\w*)layerrenderer\.js\Z', filename)
        if m:
            uses.discard('ol.renderer.Map')
            uses.discard('ol.renderer.%s.Map' % (m.group(1),))
        missing_requires = uses - requires - provides
        if missing_requires:
            for missing_require in sorted(missing_requires):
                t.info("%s:%d missing goog.require('%s')" %
                       (filename, uses_linenos[missing_require], missing_require))
                missing_count += 1
    if unused_count or missing_count:
        t.error('%d unused goog.requires, %d missing goog.requires' %
                (unused_count, missing_count))
    t.touch()
Exemplo n.º 19
0
# Change the python working directory to be where this script is located
abspath = os.path.abspath(__file__)
dname = os.path.dirname(abspath)
os.chdir(dname)

if sys.platform == 'win32':
    variables.JAVA = 'C:/Program Files/Java/jre7/bin/java.exe'
    variables.PYTHON = 'C:/Python27/python.exe'
else:
    variables.JAVA = 'java'
    variables.JAR = 'jar'
    variables.JSDOC = 'jsdoc'
    variables.PYTHON = 'python'

SPEC = [path for path in ifind('specs') if path.endswith('.js')]

SRC = [path for path in ifind('src') if path.endswith('.js')]

HTML = [path for path in ifind('src/html') if path.endswith('.html')]

# Reorder to move gisportal.js to the front
SRC.remove('src/gisportal.js')
SRC.insert(0, 'src/gisportal.js')
# Reorder to move portal to the back
SRC.remove('src/portal.js')
SRC.append('src/portal.js')

JSDOC = 'lib/jsdoc/jsdoc'  # Used to build javadoc
PLOVR_JAR = 'lib/plovr/plovr-81ed862.jar'  # Used to build minjs
UGLIFYJS = '/local1/data/scratch/node-v0.8.18-linux-x64/node_modules/uglifyjs/bin/uglifyjs'  # Not used anymore, but can be
Exemplo n.º 20
0
    variables.JAR = 'jar'
    variables.JSDOC = './node_modules/.bin/jsdoc'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = 'phantomjs'

variables.BRANCH = output(
    '%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
               variables.JSDOC, variables.JSHINT, variables.PYTHON,
               variables.PHANTOMJS]

EXPORTS = 'build/exports.js'

EXAMPLES = [path
            for path in ifind('examples')
            if path.endswith('.html')
            if path != 'examples/index.html']

EXAMPLES_SRC = [path
                for path in ifind('examples')
                if path.endswith('.js')
                if not path.endswith('.combined.js')
                if not path.startswith('examples/bootstrap')
                if path != 'examples/Jugl.js'
                if path != 'examples/jquery.min.js'
                if path != 'examples/loader.js'
                if path != 'examples/example-list.js']

EXAMPLES_JSON = ['build/' + example.replace('.html', '.json')
                 for example in EXAMPLES]
Exemplo n.º 21
0
    variables.GJSLINT = 'gjslint'
    variables.JAVA = 'java'
    variables.JAR = 'jar'
    variables.JSDOC = 'jsdoc'
    variables.NODE = 'node'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = 'phantomjs'

variables.BRANCH = output(
    '%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
               variables.JSDOC, variables.PYTHON, variables.PHANTOMJS]

EXPORTS = [path
           for path in ifind('src')
           if path.endswith('.exports')]

EXTERNAL_SRC = [
    'build/src/external/externs/types.js',
    'build/src/external/src/exports.js',
    'build/src/external/src/types.js']

EXAMPLES = [path
            for path in ifind('examples')
            if path.endswith('.html')
            if path != 'examples/index.html']

EXAMPLES_SRC = [path
                for path in ifind('examples')
                if path.endswith('.js')
Exemplo n.º 22
0
def run_plovr_example_server(t):
    EXAMPLES_CONFIG = [path for path in ifind('build/cfgexamples/') if path.endswith('.js')]
    WORKERS_CONFIG = [path for path in ifind('build/cfgworkers/') if path.endswith('.js')]
    t.output('%(JAVA)s', '-jar', PLOVR_JAR, 'serve', EXAMPLES_CONFIG, WORKERS_CONFIG)
Exemplo n.º 23
0
    variables.PYTHON = 'python'
    variables.JAVA = 'java'
    variables.GIT = 'git'
    variables.GJSLINT = 'gjslint'
    variables.BUILDER = \
        'bower_components/closure-library/closure/bin/build/closurebuilder.py'
    variables.DEPSWRITER = \
        'bower_components/closure-library/closure/bin/build/depswriter.py'
    variables.CLOSURE_JAR = 'resources/compiler.jar'
    variables.CASPERJS = 'casperjs'

EXECUTABLES = [variables.JSDOC, variables.PYTHON, variables.JAVA,
               variables.GIT, variables.GJSLINT, variables.CASPERJS]

# NOTE: omit workers directory
SRC = [path for path in ifind('src/gs') if path.endswith('.js') and
       not path.startswith('src/gs/worker')]

TEST_SRC = [path for path in ifind('test/specs') if path.endswith('.js')]
WORKERS_SRC = [path for path in ifind('src/gs/worker') if path.endswith('.js')]
WORKERS_BUILD = [path for path in ifind('build/workers')
                 if path.endswith('.js')]
EXAMPLES_SRC = [path for path in ifind('examples/stable/') if path.endswith('.html')]
EXAMPLES_SRC_JS = [path for path in ifind('examples/stable/') if path.endswith('.js')]
EXAMPLES_SANDBOX_SRC = [path for path in ifind('examples/sandbox/') if path.endswith('.html')]
EXAMPLES_SANDBOX_SRC_JS = [path for path in ifind('examples/sandbox/') if path.endswith('.js')]
JSDOC_SRC = [path for path in ifind('src/') if path.endswith('.jsdoc')]
EXPORTS = [path for path in ifind('src')
           if path.endswith('.exports')]

Exemplo n.º 24
0
    variables.JAR = 'jar'
    variables.JSDOC = './node_modules/.bin/jsdoc'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = './node_modules/.bin/phantomjs'

variables.BRANCH = output(
    '%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
               variables.JSDOC, variables.JSHINT, variables.PYTHON,
               variables.PHANTOMJS]

EXPORTS = 'build/exports.js'

EXAMPLES = [path
            for path in ifind('examples')
            if path.endswith('.html')
            if path != 'examples/index.html']

EXAMPLES_SRC = [path
                for path in ifind('examples')
                if path.endswith('.js')
                if not path.endswith('.combined.js')
                if not path.startswith('examples/bootstrap')
                if path != 'examples/Jugl.js'
                if path != 'examples/jquery.min.js'
                if path != 'examples/example-list.js']

EXAMPLES_JSON = ['build/' + example.replace('.html', '.json')
                 for example in EXAMPLES]
Exemplo n.º 25
0
    variables.GJSLINT = 'gjslint'
    variables.BUILDER = \
        'bower_components/closure-library/closure/bin/build/closurebuilder.py'
    variables.DEPSWRITER = \
        'bower_components/closure-library/closure/bin/build/depswriter.py'
    variables.CLOSURE_JAR = 'resources/compiler.jar'
    variables.CASPERJS = 'casperjs'

EXECUTABLES = [
    variables.JSDOC, variables.PYTHON, variables.JAVA, variables.GIT,
    variables.GJSLINT, variables.CASPERJS
]

# NOTE: omit workers directory
SRC = [
    path for path in ifind('src/gs')
    if path.endswith('.js') and not path.startswith('src/gs/worker')
]

TEST_SRC = [path for path in ifind('test/specs') if path.endswith('.js')]
WORKERS_SRC = [path for path in ifind('src/gs/worker') if path.endswith('.js')]
WORKERS_BUILD = [
    path for path in ifind('build/workers') if path.endswith('.js')
]
EXAMPLES_SRC = [
    path for path in ifind('examples/stable/') if path.endswith('.html')
]
EXAMPLES_SRC_JS = [
    path for path in ifind('examples/stable/') if path.endswith('.js')
]
EXAMPLES_SANDBOX_SRC = [
Exemplo n.º 26
0
Arquivo: build.py Projeto: igrcic/ol3
    variables.GIT = 'git'
    variables.GJSLINT = 'gjslint'
    variables.JSHINT = './node_modules/.bin/jshint'
    variables.JSDOC = './node_modules/.bin/jsdoc'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = './node_modules/.bin/phantomjs'

variables.BRANCH = output(
    '%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXECUTABLES = [variables.CLEANCSS, variables.GIT, variables.GJSLINT,
               variables.JSDOC, variables.JSHINT, variables.PYTHON,
               variables.PHANTOMJS]

EXAMPLES = [path
            for path in ifind('examples')
            if path.endswith('.html')
            if path != 'examples/index.html']

EXAMPLES_SRC = [path
                for path in ifind('examples')
                if path.endswith('.js')
                if not path.endswith('.combined.js')
                if path != 'examples/Jugl.js'
                if path != 'examples/example-list.js']

EXAMPLES_JSON = ['build/' + example.replace('.html', '.json')
                 for example in EXAMPLES]

EXAMPLES_COMBINED = ['build/' + example.replace('.html', '.combined.js')
                     for example in EXAMPLES]
Exemplo n.º 27
0
#!/usr/bin/env python

from pake import ifind, main, target, virtual


SRC = [path for path in ifind('.') if path.endswith('.py')]


virtual('all', 'pep8', 'pyflakes')


@target('pep8', SRC, help='runs pep8 on all source files', phony=True)
def pep8(t):
    t.run('pep8', '--ignore=E501', SRC)


@target('pyflakes', SRC, help='runs pyflakes on all source files', phony=True)
def pyflakes(t):
    t.run('pyflakes', SRC)


if __name__ == '__main__':
    main()
Exemplo n.º 28
0
    variables.JAR = 'jar'
    variables.JSDOC = 'jsdoc'
    variables.NODE = 'node'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = 'phantomjs'

TEMPLATE_GLSL_COMPILER_JS = 'build/glsl-unit/bin/template_glsl_compiler.js'

variables.BRANCH = output(
    '%(GIT)s', 'rev-parse', '--abbrev-ref', 'HEAD').strip()

EXECUTABLES = [variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
               variables.JSDOC, variables.PYTHON, variables.PHANTOMJS]

EXPORTS = [path
           for path in ifind('src')
           if path.endswith('.exports')]

EXTERNAL_SRC = [
    'build/src/external/externs/types.js',
    'build/src/external/src/exports.js',
    'build/src/external/src/types.js']

EXAMPLES = [path
            for path in ifind('examples')
            if path.endswith('.html')
            if path != 'examples/index.html']

EXAMPLES_SRC = [path
                for path in ifind('examples')
                if path.endswith('.js')
Exemplo n.º 29
0
    variables.GJSLINT = 'gjslint'
    variables.JSHINT = './node_modules/.bin/jshint'
    variables.JSDOC = './node_modules/.bin/jsdoc'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = './node_modules/.bin/phantomjs'

variables.BRANCH = output('%(GIT)s', 'rev-parse', '--abbrev-ref',
                          'HEAD').strip()

EXECUTABLES = [
    variables.CLEANCSS, variables.GIT, variables.GJSLINT, variables.JSDOC,
    variables.JSHINT, variables.PYTHON, variables.PHANTOMJS
]

EXAMPLES = [
    path for path in ifind('examples') if path.endswith('.html')
    if path != 'examples/index.html'
]

EXAMPLES_SRC = [
    path for path in ifind('examples') if path.endswith('.js')
    if not path.endswith('.combined.js') if path != 'examples/Jugl.js'
    if path != 'examples/example-list.js'
]

EXAMPLES_JSON = [
    'build/' + example.replace('.html', '.json') for example in EXAMPLES
]

EXAMPLES_COMBINED = [
    'build/' + example.replace('.html', '.combined.js') for example in EXAMPLES
Exemplo n.º 30
0
Arquivo: build.py Projeto: geops/ol3
    pake.variables.GJSLINT = "gjslint"  # FIXME
    pake.variables.JAVA = "C:/Program Files/Java/jre7/bin/java.exe"
    pake.variables.JSDOC = "jsdoc"  # FIXME
    pake.variables.PHANTOMJS = "phantomjs"  # FIXME
    pake.variables.PYTHON = "C:/Python27/python.exe"
else:
    pake.variables.GIT = "git"
    pake.variables.GJSLINT = "gjslint"
    pake.variables.JAVA = "java"
    pake.variables.JSDOC = "jsdoc"
    pake.variables.PHANTOMJS = "phantomjs"
    pake.variables.PYTHON = "python"

pake.variables.BRANCH = pake.output("%(GIT)s", "rev-parse", "--abbrev-ref", "HEAD").strip()

EXPORTS = [path for path in pake.ifind("src") if path.endswith(".exports") if path != "src/objectliterals.exports"]

EXTERNAL_SRC = [
    "build/src/external/externs/types.js",
    "build/src/external/src/exports.js",
    "build/src/external/src/types.js",
]

EXAMPLES = [path for path in glob.glob("examples/*.html") if path != "examples/example-list.html"]

EXAMPLES_SRC = [
    path
    for path in pake.ifind("examples")
    if path.endswith(".js")
    if not path.endswith(".combined.js")
    if path != "examples/Jugl.js"
Exemplo n.º 31
0
TEMPLATE_GLSL_COMPILER_JS = "build/glsl-unit/bin/template_glsl_compiler.js"

variables.BRANCH = output("%(GIT)s", "rev-parse", "--abbrev-ref", "HEAD").strip()

EXECUTABLES = [
    variables.GIT,
    variables.GJSLINT,
    variables.JAVA,
    variables.JAR,
    variables.JSDOC,
    variables.PYTHON,
    variables.PHANTOMJS,
]

EXPORTS = [path for path in ifind("src") if path.endswith(".exports")]

EXTERNAL_SRC = [
    "build/src/external/externs/types.js",
    "build/src/external/src/exports.js",
    "build/src/external/src/types.js",
]

EXAMPLES = [path for path in ifind("examples") if path.endswith(".html") if path != "examples/index.html"]

EXAMPLES_SRC = [
    path
    for path in ifind("examples")
    if path.endswith(".js")
    if not path.endswith(".combined.js")
    if not path.startswith("examples/bootstrap")
Exemplo n.º 32
0
    variables.JSDOC = 'jsdoc'
    variables.NODE = 'node'
    variables.PYTHON = 'python'
    variables.PHANTOMJS = 'phantomjs'

TEMPLATE_GLSL_COMPILER_JS = 'build/glsl-unit/bin/template_glsl_compiler.js'

variables.BRANCH = output('%(GIT)s', 'rev-parse', '--abbrev-ref',
                          'HEAD').strip()

EXECUTABLES = [
    variables.GIT, variables.GJSLINT, variables.JAVA, variables.JAR,
    variables.JSDOC, variables.PYTHON, variables.PHANTOMJS
]

EXPORTS = [path for path in ifind('src') if path.endswith('.exports')]

EXTERNAL_SRC = [
    'build/src/external/externs/types.js', 'build/src/external/src/exports.js',
    'build/src/external/src/types.js'
]

EXAMPLES = [
    path for path in ifind('examples') if path.endswith('.html')
    if path != 'examples/index.html'
]

EXAMPLES_SRC = [
    path for path in ifind('examples') if path.endswith('.js')
    if not path.endswith('.combined.js')
    if not path.startswith('examples/bootstrap')
Exemplo n.º 33
0
#!/usr/bin/env python

from pake import ifind, main, target, virtual

SRC = [path for path in ifind('.') if path.endswith('.py')]

virtual('all', 'pep8', 'pyflakes')


@target('pep8', SRC, help='runs pep8 on all source files', phony=True)
def pep8(t):
    t.run('pep8', '--ignore=E501', SRC)


@target('pyflakes', SRC, help='runs pyflakes on all source files', phony=True)
def pyflakes(t):
    t.run('pyflakes', SRC)


if __name__ == '__main__':
    main()