Merge pull request #2404 from tschaub/builds
Two ways to use the library: advanced compilation (prod) or raw/concatenated (dev).
This commit is contained in:
+1
-7
@@ -122,13 +122,7 @@ executing the `host-examples` build target:
|
|||||||
|
|
||||||
After running `host-examples` you can now open the examples index page in the browser, for example: <http://localhost/~elemoine/ol3/build/hosted/master/examples/>. (This assumes that the `hosted` directory is a web directory, served by Apache for example.)
|
After running `host-examples` you can now open the examples index page in the browser, for example: <http://localhost/~elemoine/ol3/build/hosted/master/examples/>. (This assumes that the `hosted` directory is a web directory, served by Apache for example.)
|
||||||
|
|
||||||
To make an example use `ol-simple.js` or `ol-whitespace.js` instead of `ol.js`
|
Append `?mode=raw` to make the example work in full debug mode. In raw mode the OpenLayers and Closure Library scripts are loaded individually by the Closure Library's `base.js` script (which the example page loads and executes before any other script).
|
||||||
append `?mode=simple` or `?mode=whitespace` to the example URL.
|
|
||||||
|
|
||||||
Append `?mode=debug` or `?mode=raw` to make the example work in full debug mode. In
|
|
||||||
full debug mode the OpenLayers and Closure Library scripts are loaded individually by
|
|
||||||
the Closure Library's `base.js` script (which the example page loads and
|
|
||||||
executes before any other script).
|
|
||||||
|
|
||||||
## Running tests
|
## Running tests
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,9 @@
|
|||||||
* This loader is used for the hosted examples. It is used in place of the
|
* This loader is used for the hosted examples. It is used in place of the
|
||||||
* development loader (examples/loader.js).
|
* development loader (examples/loader.js).
|
||||||
*
|
*
|
||||||
* ol.js, ol-simple.js, ol-whitespace.js, and ol-deps.js are built
|
* The ol.js, ol-debug.js, and ol-deps.js scripts are built by OL3's
|
||||||
* by OL3's build.py script. They are located in the ../build/ directory,
|
* build.py script. They are located in the ../build/ directory, relative to
|
||||||
* relatively to this script.
|
* this script.
|
||||||
*
|
*
|
||||||
* The script must be named loader.js.
|
* The script must be named loader.js.
|
||||||
*
|
*
|
||||||
@@ -54,20 +54,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var oljs = 'ol.js', mode;
|
var raw = pageParams.mode && pageParams.mode.toLowerCase() === 'raw';
|
||||||
if ('mode' in pageParams) {
|
|
||||||
mode = pageParams.mode.toLowerCase();
|
|
||||||
if (mode == 'debug') {
|
|
||||||
mode = 'raw';
|
|
||||||
}
|
|
||||||
if (mode != 'advanced' && mode != 'raw') {
|
|
||||||
oljs = 'ol-' + mode + '.js';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var scriptId = encodeURIComponent(scriptParams.id);
|
var scriptId = encodeURIComponent(scriptParams.id);
|
||||||
if (mode != 'raw') {
|
if (!raw) {
|
||||||
document.write('<scr' + 'ipt type="text/javascript" src="../build/' + oljs + '"></scr' + 'ipt>');
|
document.write('<scr' + 'ipt type="text/javascript" src="../build/ol.js"></scr' + 'ipt>');
|
||||||
} else {
|
} else {
|
||||||
window.CLOSURE_NO_DEPS = true; // we've got our own deps file
|
window.CLOSURE_NO_DEPS = true; // we've got our own deps file
|
||||||
document.write('<scr' + 'ipt type="text/javascript" src="../closure-library/closure/goog/base.js"></scr' + 'ipt>');
|
document.write('<scr' + 'ipt type="text/javascript" src="../closure-library/closure/goog/base.js"></scr' + 'ipt>');
|
||||||
|
|||||||
@@ -123,15 +123,14 @@ def report_sizes(t):
|
|||||||
virtual('default', 'build')
|
virtual('default', 'build')
|
||||||
|
|
||||||
|
|
||||||
virtual('ci', 'lint', 'jshint', 'build', 'build-all',
|
virtual('ci', 'lint', 'jshint', 'build', 'test',
|
||||||
'test', 'build/examples/all.combined.js', 'check-examples', 'apidoc')
|
'build/examples/all.combined.js', 'check-examples', 'apidoc')
|
||||||
|
|
||||||
|
|
||||||
virtual('build', 'build/ol.css', 'build/ol.js',
|
virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js')
|
||||||
'build/ol-simple.js', 'build/ol-whitespace.js')
|
|
||||||
|
|
||||||
|
|
||||||
virtual('check', 'lint', 'jshint', 'build/ol-all.js', 'test')
|
virtual('check', 'lint', 'jshint', 'test')
|
||||||
|
|
||||||
|
|
||||||
virtual('todo', 'fixme')
|
virtual('todo', 'fixme')
|
||||||
@@ -148,26 +147,12 @@ def build_ol_new_js(t):
|
|||||||
report_sizes(t)
|
report_sizes(t)
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol-simple.js', SRC, SHADER_SRC, 'buildcfg/ol-simple.json')
|
@target('build/ol-debug.js', SRC, SHADER_SRC, 'buildcfg/ol-debug.json')
|
||||||
def build_ol_simple_js(t):
|
def build_ol_debug_js(t):
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol-simple.json', 'build/ol-simple.js')
|
t.run('node', 'tasks/build.js', 'buildcfg/ol-debug.json', 'build/ol-debug.js')
|
||||||
report_sizes(t)
|
report_sizes(t)
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol-whitespace.js', SRC, SHADER_SRC, 'buildcfg/ol-whitespace.json')
|
|
||||||
def build_ol_whitespace_js(t):
|
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol-whitespace.json', 'build/ol-whitespace.js')
|
|
||||||
report_sizes(t)
|
|
||||||
|
|
||||||
|
|
||||||
virtual('build-all', 'build/ol-all.js')
|
|
||||||
|
|
||||||
|
|
||||||
@target('build/ol-all.js', SRC, SHADER_SRC, 'buildcfg/ol-all.json')
|
|
||||||
def build_ol_all_js(t):
|
|
||||||
t.run('node', 'tasks/build.js', 'buildcfg/ol-all.json', 'build/ol-all.js')
|
|
||||||
|
|
||||||
|
|
||||||
for glsl_src in GLSL_SRC:
|
for glsl_src in GLSL_SRC:
|
||||||
def shader_src_helper(glsl_src):
|
def shader_src_helper(glsl_src):
|
||||||
@target(glsl_src.replace('.glsl', 'shader.js'), glsl_src,
|
@target(glsl_src.replace('.glsl', 'shader.js'), glsl_src,
|
||||||
@@ -609,8 +594,7 @@ def host_examples(t):
|
|||||||
split_example_file(example, examples_dir % vars(variables))
|
split_example_file(example, examples_dir % vars(variables))
|
||||||
t.cp_r('examples/data', examples_dir + '/data')
|
t.cp_r('examples/data', examples_dir + '/data')
|
||||||
t.cp('bin/loader_hosted_examples.js', examples_dir + '/loader.js')
|
t.cp('bin/loader_hosted_examples.js', examples_dir + '/loader.js')
|
||||||
t.cp('build/ol.js', 'build/ol-simple.js', 'build/ol-whitespace.js',
|
t.cp('build/ol.js', 'build/ol-debug.js', build_dir)
|
||||||
build_dir)
|
|
||||||
t.cp('build/ol.css', css_dir)
|
t.cp('build/ol.css', css_dir)
|
||||||
t.cp('examples/index.html', 'examples/example-list.js',
|
t.cp('examples/index.html', 'examples/example-list.js',
|
||||||
'examples/example-list.xml', 'examples/Jugl.js',
|
'examples/example-list.xml', 'examples/Jugl.js',
|
||||||
|
|||||||
@@ -1,64 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": ["*"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "ADVANCED",
|
|
||||||
"output_wrapper": "// OpenLayers 3. See http://ol3.js.org/\n(function(){%output%})();",
|
|
||||||
"use_types_for_optimization": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"exports": ["*"]
|
||||||
|
}
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": ["*"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "SIMPLE",
|
|
||||||
"output_wrapper": "%output%",
|
|
||||||
"use_types_for_optimization": false,
|
|
||||||
"manage_closure_dependencies": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
{
|
|
||||||
"exports": ["*"],
|
|
||||||
"compile": {
|
|
||||||
"externs": [
|
|
||||||
"externs/bingmaps.js",
|
|
||||||
"externs/closure-compiler.js",
|
|
||||||
"externs/geojson.js",
|
|
||||||
"externs/oli.js",
|
|
||||||
"externs/olx.js",
|
|
||||||
"externs/proj4js.js",
|
|
||||||
"externs/tilejson.js",
|
|
||||||
"externs/topojson.js",
|
|
||||||
"externs/vbarray.js"
|
|
||||||
],
|
|
||||||
"define": [
|
|
||||||
"goog.dom.ASSUME_STANDARDS_MODE=true",
|
|
||||||
"goog.DEBUG=false"
|
|
||||||
],
|
|
||||||
"jscomp_error": [
|
|
||||||
"accessControls",
|
|
||||||
"ambiguousFunctionDecl",
|
|
||||||
"checkEventfulObjectDisposal",
|
|
||||||
"checkRegExp",
|
|
||||||
"checkStructDictInheritance",
|
|
||||||
"checkTypes",
|
|
||||||
"checkVars",
|
|
||||||
"const",
|
|
||||||
"constantProperty",
|
|
||||||
"deprecated",
|
|
||||||
"duplicateMessage",
|
|
||||||
"es3",
|
|
||||||
"externsValidation",
|
|
||||||
"fileoverviewTags",
|
|
||||||
"globalThis",
|
|
||||||
"internetExplorerChecks",
|
|
||||||
"invalidCasts",
|
|
||||||
"misplacedTypeAnnotation",
|
|
||||||
"missingGetCssName",
|
|
||||||
"missingProperties",
|
|
||||||
"missingProvide",
|
|
||||||
"missingRequire",
|
|
||||||
"missingReturn",
|
|
||||||
"newCheckTypes",
|
|
||||||
"nonStandardJsDocs",
|
|
||||||
"suspiciousCode",
|
|
||||||
"strictModuleDepCheck",
|
|
||||||
"typeInvalidation",
|
|
||||||
"undefinedNames",
|
|
||||||
"undefinedVars",
|
|
||||||
"unknownDefines",
|
|
||||||
"uselessCode",
|
|
||||||
"visibility"
|
|
||||||
],
|
|
||||||
"extra_annotation_name": [
|
|
||||||
"api", "observable"
|
|
||||||
],
|
|
||||||
"jscomp_off": [
|
|
||||||
"es5Strict"
|
|
||||||
],
|
|
||||||
"compilation_level": "WHITESPACE_ONLY",
|
|
||||||
"output_wrapper": "var CLOSURE_DEPS = false;\n%output%",
|
|
||||||
"use_types_for_optimization": false,
|
|
||||||
"manage_closure_dependencies": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user