From e2df5ceacb89597d83d22395db70de3d679cfcc1 Mon Sep 17 00:00:00 2001 From: Tom Payne Date: Thu, 10 Oct 2013 16:45:05 +0200 Subject: [PATCH] Add target to concatenate and build all examples --- build.py | 17 ++++++++++++++++- buildcfg/examples-all.json | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 buildcfg/examples-all.json diff --git a/build.py b/build.py index 4ababe5b05d..eaea8b772ea 100755 --- a/build.py +++ b/build.py @@ -283,7 +283,8 @@ def build_src_internal_types_js(t): '--typedef', 'src/objectliterals.jsdoc') -virtual('build-examples', 'examples', EXAMPLES_COMBINED) +virtual('build-examples', 'examples', 'build/examples/all.combined.js', + EXAMPLES_COMBINED) virtual('examples', 'examples/example-list.xml', EXAMPLES_JSON) @@ -299,6 +300,20 @@ def examples_examples_list_js(t): t.run('%(PYTHON)s', 'bin/exampleparser.py', 'examples', 'examples') +@target('build/examples/all.combined.js', 'build/examples/all.js', PLOVR_JAR, + SRC, INTERNAL_SRC, SHADER_SRC, LIBTESS_JS_SRC, + 'buildcfg/base.json', 'build/examples/all.json') +def build_examples_all_combined_js(t): + t.output('%(JAVA)s', '-jar', PLOVR_JAR, 'build', + 'buildcfg/examples-all.json') + report_sizes(t) + + +@target('build/examples/all.js', EXAMPLES_SRC) +def build_examples_all_js(t): + t.output('bin/combine-examples.py', t.dependencies) + + @rule(r'\Abuild/examples/(?P.*).json\Z') def examples_star_json(name, match): def action(t): diff --git a/buildcfg/examples-all.json b/buildcfg/examples-all.json new file mode 100644 index 00000000000..32af55283e9 --- /dev/null +++ b/buildcfg/examples-all.json @@ -0,0 +1,20 @@ +{ + "externs": [ + "//json.js", + "//jquery-1.7.js", + "../externs/bingmaps.js", + "../externs/bootstrap.js", + "../externs/geojson.js", + "../externs/topojson.js", + "../externs/oli.js", + "../externs/proj4js.js", + "../externs/tilejson.js", + "../externs/closure-compiler.js" + ], + "id": "simple", + "inherits": "base.json", + "inputs": [ + "../build/examples/all.js", + "../build/src/internal/src/types.js" + ] +}