Generate a ol-debug.js script useful for debugging

Instead of running everything through the Compiler just to remove whitespace, we provide a build that is a simple concatenation of all scripts in dependency order.  This build (ol-debug.js) should never be used in production (the same applies to the old ol-whitespace.js build).  Instead, the intention is that it be used to aid in debugging during development.
This commit is contained in:
Tim Schaub
2014-07-17 21:22:46 -06:00
parent 28a23a11b5
commit 4dc601f30d
4 changed files with 9 additions and 71 deletions

View File

@@ -5,7 +5,7 @@
* 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).
* *
* The ol.js, ol-whitespace.js, and ol-deps.js scripts are built by OL3's * The ol.js, ol-debug.js, and ol-deps.js scripts are built by OL3's
* build.py script. They are located in the ../build/ directory, relative to * build.py script. They are located in the ../build/ directory, relative to
* this script. * this script.
* *

View File

@@ -127,7 +127,7 @@ virtual('ci', 'lint', 'jshint', 'build', 'build-all',
'test', 'build/examples/all.combined.js', 'check-examples', 'apidoc') 'test', 'build/examples/all.combined.js', 'check-examples', 'apidoc')
virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-whitespace.js') virtual('build', 'build/ol.css', 'build/ol.js', 'build/ol-debug.js')
virtual('check', 'lint', 'jshint', 'build/ol-all.js', 'test') virtual('check', 'lint', 'jshint', 'build/ol-all.js', 'test')
@@ -147,9 +147,9 @@ def build_ol_new_js(t):
report_sizes(t) report_sizes(t)
@target('build/ol-whitespace.js', SRC, SHADER_SRC, 'buildcfg/ol-whitespace.json') @target('build/ol-debug.js', SRC, SHADER_SRC, 'buildcfg/ol-debug.json')
def build_ol_whitespace_js(t): def build_ol_debug_js(t):
t.run('node', 'tasks/build.js', 'buildcfg/ol-whitespace.json', 'build/ol-whitespace.js') t.run('node', 'tasks/build.js', 'buildcfg/ol-debug.json', 'build/ol-debug.js')
report_sizes(t) report_sizes(t)
@@ -602,7 +602,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-whitespace.js', build_dir) t.cp('build/ol.js', 'build/ol-debug.js', 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',

3
buildcfg/ol-debug.json Normal file
View File

@@ -0,0 +1,3 @@
{
"exports": ["*"]
}

View File

@@ -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
}
}