Branching for the 2.11 release
git-svn-id: http://svn.openlayers.org/branches/openlayers/2.11@12220 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
The OpenLayers build tool supports several different
|
||||
forms of compressing your javascript code, and a method
|
||||
of describing build profiles to create customized
|
||||
OpenLayers builds with only the components you need.
|
||||
|
||||
When building a file, you can choose to build with several
|
||||
different compression options to the Python-based build.py
|
||||
script. The following is an example script:
|
||||
|
||||
python build.py -c closure full OpenLayers-closure.js
|
||||
|
||||
This script selects the 'closure' compression mechanism,
|
||||
uses a config file called 'full.cfg', and writes the output
|
||||
to OpenLayers-closure.js.
|
||||
|
||||
The options available for compression are:
|
||||
|
||||
* closure
|
||||
This requires you to have a closure-compiler.jar in your
|
||||
tools directory. You can do this by fetching the compiler
|
||||
from:
|
||||
|
||||
http://closure-compiler.googlecode.com/files/compiler-latest.zip
|
||||
|
||||
Then unzipping that file, and placing compiler.jar into tools
|
||||
and renaming it closure-compiler.jar.
|
||||
|
||||
* closure_ws
|
||||
This uses the closure compiler webservice. This will only work
|
||||
for files source Javascript files which are under 1MB. (Note that
|
||||
the default OpenLayers full build is not under 1MB.)
|
||||
|
||||
* jsmin
|
||||
jsmin is the default compiler, and uses the Python-based
|
||||
jsmin script to compress the Javascript.
|
||||
|
||||
* minimize
|
||||
This is a simple whitespace removing Python script, designed
|
||||
to fill in when other tools are unavailable.
|
||||
|
||||
* none
|
||||
None will leave the Javascript uncompressed.
|
||||
|
||||
Executable
+82
@@ -0,0 +1,82 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append("../tools")
|
||||
import mergejs
|
||||
import optparse
|
||||
|
||||
def build(config_file = None, output_file = None, options = None):
|
||||
have_compressor = []
|
||||
try:
|
||||
import jsmin
|
||||
have_compressor.append("jsmin")
|
||||
except ImportError:
|
||||
print "No jsmin"
|
||||
try:
|
||||
import closure
|
||||
have_compressor.append("closure")
|
||||
except Exception, E:
|
||||
print "No closure (%s)" % E
|
||||
try:
|
||||
import closure_ws
|
||||
have_compressor.append("closure_ws")
|
||||
except ImportError:
|
||||
print "No closure_ws"
|
||||
|
||||
try:
|
||||
import minimize
|
||||
have_compressor.append("minimize")
|
||||
except ImportError:
|
||||
print "No minimize"
|
||||
|
||||
use_compressor = None
|
||||
if options.compressor and options.compressor in have_compressor:
|
||||
use_compressor = options.compressor
|
||||
|
||||
sourceDirectory = "../lib"
|
||||
configFilename = "full.cfg"
|
||||
outputFilename = "OpenLayers.js"
|
||||
|
||||
if config_file:
|
||||
configFilename = config_file
|
||||
extension = configFilename[-4:]
|
||||
|
||||
if extension != ".cfg":
|
||||
configFilename = config_file + ".cfg"
|
||||
|
||||
if output_file:
|
||||
outputFilename = output_file
|
||||
|
||||
print "Merging libraries."
|
||||
merged = mergejs.run(sourceDirectory, None, configFilename)
|
||||
print "Compressing using %s" % use_compressor
|
||||
if use_compressor == "jsmin":
|
||||
minimized = jsmin.jsmin(merged)
|
||||
elif use_compressor == "minimize":
|
||||
minimized = minimize.minimize(merged)
|
||||
elif use_compressor == "closure_ws":
|
||||
minimized = closure_ws.minimize(merged)
|
||||
elif use_compressor == "closure":
|
||||
minimized = closure.minimize(merged)
|
||||
else: # fallback
|
||||
minimized = merged
|
||||
print "Adding license file."
|
||||
minimized = file("license.txt").read() + minimized
|
||||
|
||||
print "Writing to %s." % outputFilename
|
||||
file(outputFilename, "w").write(minimized)
|
||||
|
||||
print "Done."
|
||||
|
||||
if __name__ == '__main__':
|
||||
opt = optparse.OptionParser(usage="%s [options] [config_file] [output_file]\n Default config_file is 'full.cfg', Default output_file is 'OpenLayers.js'")
|
||||
opt.add_option("-c", "--compressor", dest="compressor", help="compression method: one of 'jsmin', 'minimize', 'closure_ws', 'closure', or 'none'", default="jsmin")
|
||||
(options, args) = opt.parse_args()
|
||||
if not len(args):
|
||||
build(options=options)
|
||||
elif len(args) == 1:
|
||||
build(args[0], options=options)
|
||||
elif len(args) == 2:
|
||||
build(args[0], args[1], options=options)
|
||||
else:
|
||||
print "Wrong number of arguments"
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
sys.path.append("../tools")
|
||||
|
||||
import jsmin, mergejs
|
||||
|
||||
sourceDirectory = "../lib"
|
||||
configFilename = "full.cfg"
|
||||
outputFilename = "OpenLayers.js"
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
configFilename = sys.argv[1] + ".cfg"
|
||||
if len(sys.argv) > 2:
|
||||
outputFilename = sys.argv[2]
|
||||
|
||||
print "Merging libraries."
|
||||
merged = mergejs.run(sourceDirectory, None, configFilename)
|
||||
print "Adding license file."
|
||||
merged = file("license.txt").read() + merged
|
||||
|
||||
print "Writing to %s." % outputFilename
|
||||
file(outputFilename, "w").write(merged)
|
||||
|
||||
print "Done."
|
||||
@@ -0,0 +1,13 @@
|
||||
# This is the full build with all files: this includes the vector-related files
|
||||
# like Renderers and Formats.
|
||||
|
||||
[first]
|
||||
|
||||
[last]
|
||||
|
||||
[include]
|
||||
|
||||
[exclude]
|
||||
Firebug
|
||||
OpenLayers.js
|
||||
OpenLayers/Lang
|
||||
@@ -0,0 +1,48 @@
|
||||
# This file includes the OpenLayers code to create a build for everything that
|
||||
# does not require vector support.
|
||||
|
||||
[first]
|
||||
|
||||
[last]
|
||||
|
||||
[include]
|
||||
|
||||
[exclude]
|
||||
Firebug
|
||||
OpenLayers.js
|
||||
OpenLayers/Format/GeoRSS.js
|
||||
OpenLayers/Format/GML.js
|
||||
OpenLayers/Format/WKT.js
|
||||
OpenLayers/Format/KML.js
|
||||
OpenLayers/Format/WFS.js
|
||||
OpenLayers/Format.js
|
||||
OpenLayers/Handler/Path.js
|
||||
OpenLayers/Handler/Point.js
|
||||
OpenLayers/Handler/Polygon.js
|
||||
OpenLayers/Handler/Select.js
|
||||
OpenLayers/Geometry/Collection.js
|
||||
OpenLayers/Geometry/Curve.js
|
||||
OpenLayers/Geometry/LinearRing.js
|
||||
OpenLayers/Geometry/LineString.js
|
||||
OpenLayers/Geometry/MultiLineString.js
|
||||
OpenLayers/Geometry/MultiPoint.js
|
||||
OpenLayers/Geometry/MultiPolygon.js
|
||||
OpenLayers/Geometry/Point.js
|
||||
OpenLayers/Geometry/Polygon.js
|
||||
OpenLayers/Geometry/Rectangle.js
|
||||
OpenLayers/Geometry/Surface.js
|
||||
OpenLayers/Geometry.js
|
||||
OpenLayers/Layer/GML.js
|
||||
OpenLayers/Layer/Vector.js
|
||||
OpenLayers/Control/DrawFeature.js
|
||||
OpenLayers/Control/EditingToolbar.js
|
||||
OpenLayers/Control/SelectFeature.js
|
||||
OpenLayers/Feature/Vector.js
|
||||
OpenLayers/Renderer
|
||||
OpenLayers/Renderer/Elements.js
|
||||
OpenLayers/Renderer/SVG.js
|
||||
OpenLayers/Renderer/VML.js
|
||||
OpenLayers/Renderer.js
|
||||
OpenLayers/Lang
|
||||
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
|
||||
OpenLayers.js -- OpenLayers Map Viewer Library
|
||||
|
||||
Copyright 2005-2011 OpenLayers Contributors, released under the FreeBSD
|
||||
license. Please see http://svn.openlayers.org/trunk/openlayers/license.txt
|
||||
for the full text of the license.
|
||||
|
||||
Includes compressed code under the following licenses:
|
||||
|
||||
(For uncompressed versions of the code used please see the
|
||||
OpenLayers SVN repository: <http://openlayers.org/>)
|
||||
|
||||
*/
|
||||
|
||||
/* Contains portions of Prototype.js:
|
||||
*
|
||||
* Prototype JavaScript framework, version 1.4.0
|
||||
* (c) 2005 Sam Stephenson <sam@conio.net>
|
||||
*
|
||||
* Prototype is freely distributable under the terms of an MIT-style license.
|
||||
* For details, see the Prototype web site: http://prototype.conio.net/
|
||||
*
|
||||
*--------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
*
|
||||
* Contains portions of Rico <http://openrico.org/>
|
||||
*
|
||||
* Copyright 2005 Sabre Airline Solutions
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you
|
||||
* may not use this file except in compliance with the License. You
|
||||
* may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* permissions and limitations under the License.
|
||||
*
|
||||
**/
|
||||
|
||||
/**
|
||||
* Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/>
|
||||
* Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com)
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Contains portions of Gears <http://code.google.com/apis/gears/>
|
||||
*
|
||||
* Copyright 2007, Google Inc.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of Google Inc. nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
|
||||
* EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
||||
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
||||
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
||||
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* Sets up google.gears.*, which is *the only* supported way to access Gears.
|
||||
*
|
||||
* Circumvent this file at your own risk!
|
||||
*
|
||||
* In the future, Gears may automatically define google.gears.* without this
|
||||
* file. Gears may use these objects to transparently fix bugs and compatibility
|
||||
* issues. Applications that use the code below will continue to work seamlessly
|
||||
* when that happens.
|
||||
*/
|
||||
|
||||
/**
|
||||
* OpenLayers.Util.pagePosition is based on Yahoo's getXY method, which is
|
||||
* Copyright (c) 2006, Yahoo! Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use of this software in source and binary forms, with or
|
||||
* without modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of Yahoo! Inc. nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software without
|
||||
* specific prior written permission of Yahoo! Inc.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
@@ -0,0 +1,17 @@
|
||||
# This file includes a small subset of OpenLayers code, designed to be
|
||||
# integrated into another application. It includes only the Layer types
|
||||
# neccesary to create tiled or untiled WMS, and does not include any Controls.
|
||||
# This is the result of what was at the time called "Webmap.js" at the FOSS4G
|
||||
# Web Mapping BOF.
|
||||
|
||||
[first]
|
||||
|
||||
[last]
|
||||
|
||||
[include]
|
||||
OpenLayers/Map.js
|
||||
OpenLayers/Layer/WMS.js
|
||||
|
||||
[exclude]
|
||||
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
[first]
|
||||
|
||||
[last]
|
||||
|
||||
[include]
|
||||
OpenLayers/Map.js
|
||||
OpenLayers/Kinetic.js
|
||||
OpenLayers/Projection.js
|
||||
OpenLayers/Layer/SphericalMercator.js
|
||||
OpenLayers/Layer/XYZ.js
|
||||
OpenLayers/Layer/Bing.js
|
||||
OpenLayers/Layer/WMS.js
|
||||
OpenLayers/Control/TouchNavigation.js
|
||||
OpenLayers/Control/Geolocate.js
|
||||
OpenLayers/Control/ZoomPanel.js
|
||||
OpenLayers/Control/Attribution.js
|
||||
OpenLayers/Control/SelectFeature.js
|
||||
OpenLayers/Control/DrawFeature.js
|
||||
OpenLayers/Control/ModifyFeature.js
|
||||
OpenLayers/Control/Panel.js
|
||||
OpenLayers/Handler/Point.js
|
||||
OpenLayers/Handler/Path.js
|
||||
OpenLayers/Handler/Polygon.js
|
||||
OpenLayers/Layer/Vector.js
|
||||
OpenLayers/Renderer/SVG.js
|
||||
OpenLayers/Renderer/Canvas.js
|
||||
OpenLayers/Format/GeoJSON.js
|
||||
OpenLayers/Format/KML.js
|
||||
OpenLayers/Protocol/HTTP.js
|
||||
OpenLayers/Protocol/WFS.js
|
||||
OpenLayers/Protocol/WFS/v1_0_0.js
|
||||
OpenLayers/Strategy/Fixed.js
|
||||
|
||||
[exclude]
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# This build config is supposed to be used for the units tests with "mode=build"
|
||||
|
||||
[first]
|
||||
|
||||
[last]
|
||||
|
||||
[include]
|
||||
|
||||
[exclude]
|
||||
OpenLayers.js
|
||||
Reference in New Issue
Block a user