Commit ea332d84 authored by Calvin Metcalf's avatar Calvin Metcalf
Browse files

remove async code and unused files

parent 5239fd95
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3,21 +3,21 @@ module.exports = function(grunt) {
		pkg: grunt.file.readJSON('package.json'),
		concat:{
            full:{
				src:[ './src/proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/*.js'],
				src:[ './src/Proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/*.js'],
                dest:'./dist/proj4.js'
            },
            noDefs:{
                src:[ './src/proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/GOOGLE.js'],
                src:[ './src/Proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/GOOGLE.js'],
                dest:'./dist/proj4-noDefs.js'
            }
		},
        uglify:{
            full:{
    		    src:[ './src/proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./srcgrunt/defs/*.js'],
    		    src:[ './src/Proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./srcgrunt/defs/*.js'],
                dest:'./dist/proj4.min.js'
		    },
            noDefs:{
                src:[ './src/proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/GOOGLE.js'],
                src:[ './src/Proj4js.js','./src/Proj.js','./src/defs.js','./src/common.js','./src/datum.js','./src/Point.js','./src/constants.js','./src/projCode/*.js','./src/defs/GOOGLE.js'],
                dest:'./dist/proj4-noDefs.min.js'
            }
        }

build/README.txt

deleted100755 → 0
+0 −13
Original line number Diff line number Diff line
## HowTo: Build & deploy "Shrunk" Single File Library version of proj4js ##

 * Build:

     cd build
     ./build.py
     cd ..

 * Upload the result to the server: e.g.

  scp build/proj4js.js openlayers@openlayers.org:openlayers.org/htdocs/code/

build/build.py

deleted100755 → 0
+0 −98
Original line number Diff line number Diff line
#!/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 = "library.cfg"
    filename = "proj4js-compressed.js"
    outputFilename = "../lib/" + filename

    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 "Setting the filename to "+filename
    merged = merged.replace('scriptName: "proj4js.js",','scriptName: "'+filename+'",');
    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":
        if len(merged) > 1000000: # The maximum file size for this web service is 1000 KB.
            print "\nPre-compressing using jsmin"
            merged = jsmin.jsmin(merged)
        print "\nIs being compressed using Closure Compiler Service."
        try:
            minimized = closure_ws.minimize(merged)
        except Exception, E:
            print "\nAbnormal termination."
            sys.exit("ERROR: Closure Compilation using Web service failed!\n%s" % E)
        if len(minimized) <= 2:
            print "\nAbnormal termination due to compilation errors."
            sys.exit("ERROR: Closure Compilation using Web service failed!")
        else:
            print '\nClosure Compilation using Web service has completed successfully.'
    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"

build/build.xml

deleted100755 → 0
+0 −160
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!--*************************************************************************
Filename        :   build.xml
Project         :   proj4js
Document Type   :   XML
Purpose         :   build file for ant tool

Author     Date            Description
M.Adair    17-Dec-2001     initial version copied from mapbuilder

$Id: build.xml 2955 2007-07-09 12:12:27Z steven $
***************************************************************************--><!--
-->
<!-- A "project" describes a set of targets that may be requested
     when Ant is executed.  The "default" attribute defines the
     target which is executed if no specific target is requested,
     and the "basedir" attribute defines the current working directory
     from which Ant executes the requested task.  This is normally
     set to the current working directory.
-->
  <project basedir=".." default="dist" name="proj4js">

<!-- ===================== Property Definitions =========================== -->
<!--
  Each of the following properties are used in the build script.
  Values for these properties are set by the first place they are
  defined, from the following list:

  * Definitions on the "ant" command line (ant -Dfoo=bar compile).

  * Definitions from a "build.properties" file in the top level
    source directory of this application.

  * Definitions from a "build.properties" file in the developer's
    home directory.

  * Default definitions in this build.xml file.

  You will note below that property values can be composed based on the
  contents of previously defined properties.  This is a powerful technique
  that helps you minimize the number of changes required when your development
  environment is modified.  Note that property composition is allowed within
  "build.properties" files as well as in the "build.xml" script.
-->
  <property file="build.properties"/>
  <property file="${user.home}/build.properties"/>
  <property file="default.properties"/>  	

<!-- ==================== File and Directory Names ======================== -->
<!--

  These properties generally define file and directory names (or paths) that
  affect where the build process stores its outputs.

  app.name             Base name of this application, used to
                       construct filenames and directories.
                       Defaults to "myapp".

  app.path             Context path to which this application should be
                       deployed (defaults to "/" plus the value of the
                       "app.name" property).

  app.version          Version number of this iteration of the application.

  build.home           The directory into which the "prepare" and
                       "compile" targets will generate their output.
                       Defaults to "build".

  dist.home            The name of the base directory in which
                       distribution files are created.
                       Defaults to "dist".
-->

  <property environment="env"/>
  <property name="app.name" value="proj4js"/>
  <property name="app.path" value="/${app.name}"/>
  <property name="app.version" value="1.1.0"/>
  <property name="build.home" value="${basedir}/tempBuild"/>
  <property name="dist.home" value="${basedir}/dist"/>
  <property name="docs.home" value="${build.home}/docs"/>


<!-- ==================== Prepare Target ================================== -->
<!--
  The "prepare" target is used to create the "build" destination directory,
  and copy the static contents of your web application to it.  If you need
  to copy static files from external dependencies, you can customize the
  contents of this task.

  Normally, this task is executed indirectly when needed.

-->

  <target name="prepare">
    <!-- Create build directories as needed -->
    <mkdir dir="${build.home}"/>
    <!-- Copy static content of the mapbuilder project  -->
    <copy todir="${build.home}">
      <fileset dir="${basedir}" excludes="tools/*.pyc "
          includes="index.html
                    lib/proj4js.js,
                    lib/proj4js-combined.js
                    lib/proj4js-compressed.js
                    lib/defs/**
                    lib/projCode/**
                    lib/util/**
                    build/**
                    demo/**
                    test/**
                    tools/**"
      />
    </copy>
  </target>


<!-- ==================== Clean Target ==================================== -->
<!--

  The "clean" target deletes any previous "build" and "dist" directory,
  so that you can be ensured the application can be built from scratch.

-->

  <target description="Delete old build and dist directories" name="clean">
    <delete dir="${build.home}"/>
    <delete dir="${dist.home}"/>
  </target>


<!-- ==================== Documentation =================================== -->

  <target description="Create documentation" name="docs" depends="prepare">
  
    <mkdir dir="${build.home}/docs"/>
    <mkdir dir="${build.home}/docs/NaturalDocs"/>
    
    <echo message="Generating documentation"/>
    <exec executable="cmd" os="Windows XP" dir="${build.home}">
        <arg line="/c perl C:\Progra~1\NaturalDocs\NaturalDocs -i ./lib -o html ./docs/NaturalDocs -p ./docs/NaturalDocs -r"/>
    </exec>
  </target>


<!-- ==================== Dist Target ===================================== -->
<!--
  The "dist" target creates the zip file distribution for the Apache/PHP
  environment.
-->
  <target name="dist" description="Create binary distribution" depends="clean,prepare,docs">

    <mkdir dir="${dist.home}"/>

    <!-- Create application zip file -->
    <zip destfile="${dist.home}/${app.name}-${app.version}.zip" update="true">
      <zipfileset dir="${build.home}" prefix="proj4js"/>
    </zip>

  </target>

</project>

build/buildUncompressed.py

deleted100755 → 0
+0 −28
Original line number Diff line number Diff line
#!/usr/bin/env python

import sys
sys.path.append("../tools")

import jsmin, mergejs

sourceDirectory = "../lib"
configFilename = "library.cfg"
filename = "proj4js-combined.js"
outputFilename = "../lib/" + filename

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 "Setting the filename to "+filename
merged = merged.replace('scriptName: "proj4js.js",','scriptName: "'+filename+'",');
print "Adding license file."
merged = file("license.txt").read() + merged

print "Writing to %s." % outputFilename
file(outputFilename, "w").write(merged)

print "Done."
Loading