From fd42db84043efdf775bfaf19c11f313aba4c16e6 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 13 Apr 2015 10:34:35 -0600 Subject: [PATCH 01/21] Correct docs about what the ci target runs We stopped using the `build-examples` target with 3f1ae87eee07f9ff6f4af9fa5ccad680ac68004f. --- build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.py b/build.py index d2337cc2c7..8e222fe635 100755 --- a/build.py +++ b/build.py @@ -825,9 +825,9 @@ Other less frequently used targets are: apidoc - Builds the API-Documentation using JSDoc3. ci - Builds all examples in various modes and usually takes a long time to finish. This target calls the following - targets: lint, build, build-all, test, test-rendering, - build-examples, check-examples and apidoc. This is the - target run on Travis CI. + targets: 'lint', 'build', 'test', 'test-rendering', + 'build/examples/all.combined.js', 'check-examples', + and 'apidoc'. This is the target run on Travis CI. test-coverage - Generates a test coverage report in the coverage folder. reallyclean - Remove untracked files from the repository. checkdeps - Checks whether all required development software is From 4131f41740008b363c0a03b6296ebec345330daa Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 13 Apr 2015 10:40:22 -0600 Subject: [PATCH 02/21] Remove unused EXAMPLES_COMBINED and build-examples target This was discussed as part of #1118 but never completed (see https://github.com/openlayers/ol3/pull/1118#discussion_r6894016). --- build.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/build.py b/build.py index 8e222fe635..64aebd1be1 100755 --- a/build.py +++ b/build.py @@ -128,9 +128,6 @@ EXAMPLES_DEST_ALL = [path.replace('examples_src', 'examples') EXAMPLES_JSON = ['build/' + example.replace('.html', '.json') for example in EXAMPLES_SRC_HTML] -EXAMPLES_COMBINED = ['build/' + example.replace('.html', '.combined.js') - for example in EXAMPLES_SRC_HTML] - GLSL_SRC = [path for path in ifind('src') if path.endswith('.glsl')] @@ -258,10 +255,6 @@ def build_test_rendering_requires(t): build_requires(t) -virtual('build-examples', 'examples', 'build/examples/all.combined.js', - EXAMPLES_COMBINED) - - virtual('examples', EXAMPLES_DEST_ALL) From 7b2391cc2ea47323d8da0978e36014fe1299738a Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 13 Apr 2015 10:42:22 -0600 Subject: [PATCH 03/21] Remove unused EXAMPLES_JSON --- build.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/build.py b/build.py index 64aebd1be1..ad355ce296 100755 --- a/build.py +++ b/build.py @@ -125,9 +125,6 @@ EXAMPLES_SRC_JS = [example.replace('.html', '.js') EXAMPLES_DEST_ALL = [path.replace('examples_src', 'examples') for path in EXAMPLES_SRC_ALL] -EXAMPLES_JSON = ['build/' + example.replace('.html', '.json') - for example in EXAMPLES_SRC_HTML] - GLSL_SRC = [path for path in ifind('src') if path.endswith('.glsl')] From 0faace215b6f764b5bd5a21944091da2b488bcb2 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Mon, 13 Apr 2015 10:58:31 -0600 Subject: [PATCH 04/21] Compiled examples go in build/compiled-examples --- build.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build.py b/build.py index ad355ce296..a2a1a7b0bd 100755 --- a/build.py +++ b/build.py @@ -172,7 +172,7 @@ virtual('default', 'build') virtual('ci', 'lint', 'build', 'test', 'test-rendering', - 'build/examples/all.combined.js', 'check-examples', 'apidoc') + 'build/compiled-examples/all.combined.js', 'check-examples', 'apidoc') virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js', @@ -263,20 +263,20 @@ def examples_dest(name, match): return Target(name, action=action, dependencies=dependencies) -@target('build/examples/all.combined.js', 'build/examples/all.js', +@target('build/compiled-examples/all.combined.js', 'build/compiled-examples/all.js', SRC, SHADER_SRC, 'config/examples-all.json', NPM_INSTALL) def build_examples_all_combined_js(t): t.run('node', 'tasks/build.js', 'config/examples-all.json', - 'build/examples/all.combined.js') + 'build/compiled-examples/all.combined.js') report_sizes(t) -@target('build/examples/all.js', EXAMPLES_SRC_JS) +@target('build/compiled-examples/all.js', EXAMPLES_SRC_JS) def build_examples_all_js(t): t.output('%(PYTHON)s', 'bin/combine-examples.py', t.dependencies) -@rule(r'\Abuild/examples/(?P.*).json\Z') +@rule(r'\Abuild/compiled-examples/(?P.*).json\Z') def examples_star_json(name, match): def action(t): @@ -381,15 +381,15 @@ def examples_star_json(name, match): dependencies=[__file__, NPM_INSTALL]) -@rule(r'\Abuild/examples/(?P.*).combined.js\Z') +@rule(r'\Abuild/compiled-examples/(?P.*).combined.js\Z') def examples_star_combined_js(name, match): def action(t): - config = 'build/examples/%(id)s.json' % match.groupdict() + config = 'build/compiled-examples/%(id)s.json' % match.groupdict() t.run('node', 'tasks/build.js', config, name) report_sizes(t) dependencies = [SRC, SHADER_SRC, 'examples/%(id)s.js' % match.groupdict(), - 'build/examples/%(id)s.json' % match.groupdict(), + 'build/compiled-examples/%(id)s.json' % match.groupdict(), NPM_INSTALL] return Target(name, action=action, dependencies=dependencies) @@ -816,7 +816,7 @@ Other less frequently used targets are: ci - Builds all examples in various modes and usually takes a long time to finish. This target calls the following targets: 'lint', 'build', 'test', 'test-rendering', - 'build/examples/all.combined.js', 'check-examples', + 'build/compiled-examples/all.combined.js', 'check-examples', and 'apidoc'. This is the target run on Travis CI. test-coverage - Generates a test coverage report in the coverage folder. reallyclean - Remove untracked files from the repository. From 8fd2e9f79f1f8f19353a149180de4f5b8a528118 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Tue, 14 Apr 2015 10:21:33 -0600 Subject: [PATCH 05/21] Untangle resources and put built examples in the build dir --- .gitignore | 1 - build.py | 19 +- config/examples-all.json | 2 +- config/examples/example.html | 19 +- .../jsdoc/api/template/static}/logo-70x70.png | Bin config/jsdoc/api/template/tmpl/layout.tmpl | 4 +- examples_src/geolocation-orientation.html | 9 +- examples_src/index.html | 7 +- examples_src/mobile-full-screen.html | 4 +- .../resources}/example-behaviour.js | 0 .../resources}/layout.css | 6 +- examples_src/resources/logo-70x70.png | Bin 0 -> 5732 bytes .../resources/map-background.jpg | Bin .../resources}/prism/prism.css | 0 .../resources}/prism/prism.min.js | 0 .../resources}/zeroclipboard/.jshintrc | 0 .../zeroclipboard/ZeroClipboard.Core.js | 0 .../zeroclipboard/ZeroClipboard.Core.min.js | 0 .../zeroclipboard/ZeroClipboard.Core.min.map | 0 .../resources}/zeroclipboard/ZeroClipboard.js | 0 .../zeroclipboard/ZeroClipboard.min.js | 0 .../zeroclipboard/ZeroClipboard.min.map | 0 .../zeroclipboard/ZeroClipboard.swf | Bin .../bootstrap/css/bootstrap-responsive.css | 1109 --- .../css/bootstrap-responsive.min.css | 9 - resources/bootstrap/css/bootstrap.css | 6158 ----------------- resources/bootstrap/css/bootstrap.min.css | 9 - .../img/glyphicons-halflings-white.png | Bin 8777 -> 0 bytes .../bootstrap/img/glyphicons-halflings.png | Bin 12799 -> 0 bytes resources/bootstrap/js/bootstrap.js | 2276 ------ resources/bootstrap/js/bootstrap.min.js | 6 - resources/display-frame-rate.js | 39 - resources/jquery.min.js | 4 - resources/logo-32x32-optimized.png | Bin 1116 -> 0 bytes resources/logo-32x32.png | Bin 1205 -> 0 bytes resources/logo.png | Bin 1365 -> 0 bytes tasks/build-examples.js | 2 +- tasks/serve.js | 26 +- 38 files changed, 53 insertions(+), 9656 deletions(-) rename {resources => config/jsdoc/api/template/static}/logo-70x70.png (100%) rename {resources => examples_src/resources}/example-behaviour.js (100%) rename {resources => examples_src/resources}/layout.css (86%) create mode 100644 examples_src/resources/logo-70x70.png rename resources/textured_paper.jpeg => examples_src/resources/map-background.jpg (100%) rename {resources => examples_src/resources}/prism/prism.css (100%) rename {resources => examples_src/resources}/prism/prism.min.js (100%) rename {resources => examples_src/resources}/zeroclipboard/.jshintrc (100%) rename {resources => examples_src/resources}/zeroclipboard/ZeroClipboard.Core.js (100%) rename {resources => examples_src/resources}/zeroclipboard/ZeroClipboard.Core.min.js (100%) rename {resources => examples_src/resources}/zeroclipboard/ZeroClipboard.Core.min.map (100%) rename {resources => examples_src/resources}/zeroclipboard/ZeroClipboard.js (100%) rename {resources => examples_src/resources}/zeroclipboard/ZeroClipboard.min.js (100%) rename {resources => examples_src/resources}/zeroclipboard/ZeroClipboard.min.map (100%) rename {resources => examples_src/resources}/zeroclipboard/ZeroClipboard.swf (100%) delete mode 100644 resources/bootstrap/css/bootstrap-responsive.css delete mode 100644 resources/bootstrap/css/bootstrap-responsive.min.css delete mode 100644 resources/bootstrap/css/bootstrap.css delete mode 100644 resources/bootstrap/css/bootstrap.min.css delete mode 100644 resources/bootstrap/img/glyphicons-halflings-white.png delete mode 100644 resources/bootstrap/img/glyphicons-halflings.png delete mode 100644 resources/bootstrap/js/bootstrap.js delete mode 100644 resources/bootstrap/js/bootstrap.min.js delete mode 100644 resources/display-frame-rate.js delete mode 100644 resources/jquery.min.js delete mode 100644 resources/logo-32x32-optimized.png delete mode 100644 resources/logo-32x32.png delete mode 100644 resources/logo.png diff --git a/.gitignore b/.gitignore index ed5c657ad9..a0318c246e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.pyc /build/ -/examples/ /node_modules/ /dist/ /coverage/ diff --git a/build.py b/build.py index a2a1a7b0bd..a5b51a02bd 100755 --- a/build.py +++ b/build.py @@ -122,7 +122,7 @@ EXAMPLES_SRC_HTML = [path EXAMPLES_SRC_JS = [example.replace('.html', '.js') for example in EXAMPLES_SRC_HTML] -EXAMPLES_DEST_ALL = [path.replace('examples_src', 'examples') +EXAMPLES_DEST_ALL = [path.replace('examples_src', 'build/examples') for path in EXAMPLES_SRC_ALL] GLSL_SRC = [path @@ -255,7 +255,7 @@ def build_test_rendering_requires(t): virtual('examples', EXAMPLES_DEST_ALL) -@rule(r'\Aexamples/(?P.*)\Z') +@rule(r'\Abuild\/examples/(?P.*)\Z') def examples_dest(name, match): def action(t): t.run('node', 'tasks/build-examples.js') @@ -299,7 +299,7 @@ def examples_star_json(name, match): "src": [ "src/**/*.js", "build/ol.ext/*.js", - "examples/%(id)s.js" % match.groupdict()], + "build/examples/%(id)s.js" % match.groupdict()], "compile": { "js": [ "externs/olx.js", @@ -623,7 +623,7 @@ def build_check_whitespace_timestamp(t): virtual('apidoc', 'build/jsdoc-%(BRANCH)s-timestamp' % vars(variables)) -@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), 'host-resources', +@target('build/jsdoc-%(BRANCH)s-timestamp' % vars(variables), SRC, SHADER_SRC, ifind('config/jsdoc/api/template'), NPM_INSTALL) def jsdoc_BRANCH_timestamp(t): @@ -665,14 +665,7 @@ def split_example_file(example, dst_dir): target_require.close() -@target('host-resources', phony=True) -def host_resources(t): - resources_dir = 'build/hosted/%(BRANCH)s/resources' - t.rm_rf(resources_dir) - t.cp_r('resources', resources_dir) - - -@target('host-examples', 'build', 'host-resources', 'examples', phony=True) +@target('host-examples', 'build', 'examples', phony=True) def host_examples(t): examples_dir = 'build/hosted/%(BRANCH)s/examples' build_dir = 'build/hosted/%(BRANCH)s/build' @@ -680,7 +673,7 @@ def host_examples(t): closure_lib_path = output('node', '-e', 'process.stdout.write(require("closure-util").getLibraryPath())') t.rm_rf(examples_dir) - t.cp_r('examples', examples_dir) + t.cp_r('build/examples', examples_dir) for example in EXAMPLES_SRC_JS: split_example_file(example, examples_dir % vars(variables)) t.cp('bin/loader_hosted_examples.js', examples_dir + '/loader.js') diff --git a/config/examples-all.json b/config/examples-all.json index 29e51fb47e..3e75c54f08 100644 --- a/config/examples-all.json +++ b/config/examples-all.json @@ -3,7 +3,7 @@ "src": [ "src/**/*.js", "build/ol.ext/*.js", - "build/examples/all.js" + "build/compiled-examples/all.js" ], "compile": { "js": [ diff --git a/config/examples/example.html b/config/examples/example.html index 4eae12fb83..406338166c 100644 --- a/config/examples/example.html +++ b/config/examples/example.html @@ -4,14 +4,13 @@ + - - - + {{{ extraHead }}} {{{ css.tag }}} - - + + {{ title }} @@ -19,7 +18,7 @@ @@ -77,10 +76,10 @@ - - - - + + + + {{{ js.tag }}} diff --git a/resources/logo-70x70.png b/config/jsdoc/api/template/static/logo-70x70.png similarity index 100% rename from resources/logo-70x70.png rename to config/jsdoc/api/template/static/logo-70x70.png diff --git a/config/jsdoc/api/template/tmpl/layout.tmpl b/config/jsdoc/api/template/tmpl/layout.tmpl index 626499b0b5..4094774323 100644 --- a/config/jsdoc/api/template/tmpl/layout.tmpl +++ b/config/jsdoc/api/template/tmpl/layout.tmpl @@ -18,7 +18,7 @@