Commit 875fd0ce authored by Michael Adair's avatar Michael Adair
Browse files

initial import of cscs branch from mapbuilder; for history prior to this...

initial import of cscs branch from mapbuilder; for history prior to this please see the mapbuilder SVN at https://svn.codehaus.org/mapbuilder
parents
Loading
Loading
Loading
Loading

build/OLprototype.cfg

0 → 100755
+15 −0
Original line number Diff line number Diff line
[first]
OpenLayers/SingleFile.js
OpenLayers/Console.js
OpenLayers/BaseTypes.js
OpenLayers/BaseTypes/Class.js
OpenLayers/Util.js

[last]

[include]
OpenLayers/Ajax.js

[exclude]
Firebug/firebug.js
Firebug/firebugx.js

build/README.txt

0 → 100755
+13 −0
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

0 → 100755
+32 −0
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"
outputFilename = "../lib/proj4js-compressed.js"

if len(sys.argv) > 1:
    configFilename = sys.argv[1]
    extension = configFilename[-4:]

    if extension  != ".cfg":
        configFilename = sys.argv[1] + ".cfg"

if len(sys.argv) > 2:
    outputFilename = sys.argv[2]

print "Merging libraries."
merged = mergejs.run(sourceDirectory, None, configFilename)
print "Compressing."
minimized = jsmin.jsmin(merged)
print "Adding license file."
minimized = file("license.txt").read() + minimized

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

print "Done."

build/build.xml

0 → 100755
+451 −0
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 $
***************************************************************************--><!--
     General purpose build script for web applications and web services,
     including enhanced support for deploying directly to a Tomcat 5
     based server.

     This build script assumes that the source code of your web application
     is organized into the following subdirectories underneath the source
     code directory from which you execute the build script:

        docs                 Static documentation files to be copied to
                             the "docs" subdirectory of your distribution.

        src                  Java source code (and associated resource files)
                             to be compiled to the "WEB-INF/classes"
                             subdirectory of your web applicaiton.

        web                  Static HTML, JSP, and other content (such as
                             image files), including the WEB-INF subdirectory
                             and its configuration file contents.

-->
<!-- 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="deploy-tomcat" 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".

  catalina.home        The directory in which you have installed
                       a binary distribution of Tomcat 5.  This will
                       be used by the "deploy" target.

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

  manager.password     The login password of a user that is assigned the
                       "manager" role (so that he or she can execute
                       commands via the "/manager" web application)

  manager.url          The URL of the "/manager" web application on the
                       Tomcat installation to which we will deploy web
                       applications and web services.

  manager.username     The login username of a user that is assigned the
                       "manager" role (so that he or she can execute
                       commands via the "/manager" web application)

-->

  <property environment="env"/>
  <property name="app.name" value="proj4js"/>
  <property name="pack.name" value="${app.name}-lib"/>
  <property name="app.path" value="/${app.name}"/>
  <property name="catalina.home" value="${env.CATALINA_HOME}"/> <!-- ensure you have this environment var set -->
  <property name="build.home" value="${basedir}/tempBuild"/>
  <property name="compress.home" value="${basedir}/compressBuild"/>
  <property name="deploy.home" value="${catalina.home}/webapps/${app.name}"/>
  <property name="dist.home" value="${basedir}/dist"/>
  <property name="docs.home" value="${build.home}/docs"/>
  <property name="dev.home" value="${basedir}/."/>
  <property name="context.home" value="${dev.home}/server/java"/>
  <property name="src.home" value="${context.home}/src"/>


<!-- ==================== External Dependencies =========================== -->

<!--
  Use property values to define the locations of external JAR files on which
  your application will depend.  In general, these values will be used for
  two purposes:
  * Inclusion on the classpath that is passed to the Javac compiler
  * Being copied into the "/WEB-INF/lib" directory during execution
    of the "deploy" target.

  Because we will automatically include all of the Java classes that Tomcat 5
  exposes to web applications, we will not need to explicitly list any of those
  dependencies.  You only need to worry about external dependencies for JAR
  files that you are going to include inside your "/WEB-INF/lib" directory.
-->

<!--
  <property name="foo.jar"  value="$/lib/foo.jar"/>
-->

<!-- ==================== 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="tempBuild/**"/>
    </copy>
  </target>

  <target name="prepare-tomcat" depends="prepare">

    <!-- Create build directories as needed -->
    <mkdir dir="${build.home}"/>
    <mkdir  dir="${build.home}/WEB-INF"/>
    <mkdir  dir="${build.home}/WEB-INF/classes"/>

    <!-- Copy external dependencies as required -->
    <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
    <mkdir  dir="${build.home}/WEB-INF/lib"/>
<!--
    <copy todir="${build.home}/WEB-INF/lib" file="${foo.jar}"/>
-->
  </target>


<!-- ==================== All Target ====================================== -->

<!--

  The "all" target is a shortcut for running the "clean" target followed
  by the "compile" target, to force a complete recompile.

-->

  <target depends="clean,compile" description="Clean build and dist directories, then compile" name="all"/>



<!-- ==================== 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}"/>
    <delete dir="${compress.home}"/>
  </target>



<!-- ==================== Clean Tomcat ==================================== -->

  <target description="Delete old build and dist directories" name="clean-tomcat">
    <delete dir="${deploy.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 Vista" dir="${build.home}">
        <arg line="/c perl C:\Progra~1\NaturalDocs\NaturalDocs -i ./lib -o html ./docs/NaturalDocs -p ./docs/NaturalDocs -xi ./selenium -xi ./build -xi ./dist -xi ./demo -r"/>
    </exec>
  </target>

  
<!--  ==================== Compilation Control Options ==================== -->

<!--
  These properties control option settings on the Javac compiler when it
  is invoked using the <javac> task.

  compile.debug        Should compilation include the debug option?
  compile.deprecation  Should compilation include the deprecation option?
  compile.optimize     Should compilation include the optimize option?
-->
  <property name="compile.debug"       value="false"/>
  <property name="compile.deprecation" value="false"/>
  <property name="compile.optimize"    value="true"/>


<!-- ==================== External Dependencies =========================== -->
<!--
  Use property values to define the locations of external JAR files on which
  your application will depend.  In general, these values will be used for
  two purposes:
  * Inclusion on the classpath that is passed to the Javac compiler
  * Being copied into the "/WEB-INF/lib" directory during execution
    of the "deploy" target.

  Because we will automatically include all of the Java classes that Tomcat 5
  exposes to web applications, we will not need to explicitly list any of those
  dependencies.  You only need to worry about external dependencies for JAR
  files that you are going to include inside your "/WEB-INF/lib" directory.
-->

<!--
  <property name="foo.jar"     value="${context.home}/lib/foo.jar"/>
-->

<!-- ==================== Compilation Classpath =========================== -->
<!--
  Rather than relying on the CLASSPATH environment variable, Ant includes
  features that makes it easy to dynamically construct the classpath you
  need for each compilation.  The example below constructs the compile
  classpath to include the servlet.jar file, as well as the other components
  that Tomcat makes available to web applications automatically, plus anything
  that you explicitly added.
-->

  <path id="compile.classpath">

    <!-- Include all JAR files that will be included in /WEB-INF/lib -->
    <!-- *** CUSTOMIZE HERE AS REQUIRED BY YOUR APPLICATION *** -->
<!--
    <pathelement location="${foo.jar}"/>
-->
    <pathelement location="${httpClient.jar}"/>
    <pathelement location="${logging.jar}"/>
    <pathelement location="${log4j.jar}"/>

    <!-- Include all elements that Tomcat exposes to applications -->
    <pathelement location="${catalina.home}/common/classes"/>
    <fileset dir="${catalina.home}/common/endorsed">
      <include name="*.jar"/>
    </fileset>
    <fileset dir="${catalina.home}/common/lib">
      <include name="*.jar"/>
    </fileset>
    <pathelement location="${catalina.home}/shared/classes"/>
    <fileset dir="${catalina.home}/shared/lib">
      <include name="*.jar"/>
    </fileset>

  </path>

<!-- ==================== Compile Target ================================== -->
<!--
  The "compile" target transforms source files (from your "src" directory)
  into object files in the appropriate location in the build directory.
  This example assumes that you will be including your classes in an
  unpacked directory hierarchy under "/WEB-INF/classes".
-->

  <target name="compile" depends="prepare-tomcat" description="Compile Java sources">

    <!-- Compile Java classes as necessary -->
    <mkdir    dir="${build.home}/WEB-INF/classes"/>
    <javac srcdir="${src.home}"
          destdir="${build.home}/WEB-INF/classes"
            debug="${compile.debug}"
	    	source="1.4"
            target="1.4"
      deprecation="${compile.deprecation}"
         optimize="${compile.optimize}">
        <classpath refid="compile.classpath"/>
    </javac>

    <!-- Copy application resources -->
    <copy  todir="${build.home}/WEB-INF/classes">
      <fileset dir="${src.home}" excludes="**/*.java"/>
    </copy>

  </target>


<!-- =================== Compress Target ================================== -->

  <target description="Compress JS and XSL files" name="compress" depends="prepare">
    <copy todir="${compress.home}">
      <fileset dir="${build.home}"/>
    </copy>
	<!-- Also run new compression routine, using DOJO -->
 	<chmod file="${basedir}/bin/kompress.sh" perm="ugo+rx"/>
    <exec executable="${basedir}/bin/kompress.sh" os="Linux"/>
  </target>


<!-- ==================== Deploy ========================================== -->
<!--
  The "deploy" target synchronizes the build directory with the Java Servlet
  container directory.  This could also be done by copying in the war file.
-->
  <target name="deploy-tomcat"
    description="Copy build directory to $CATALINA_HOME"
    depends="prepare-tomcat">
    <mkdir dir="${deploy.home}"/>
    <copy todir="${deploy.home}">
      <fileset dir="${build.home}">
      </fileset>
    </copy>
  </target>



<!-- ==================== Dist Target ===================================== -->
<!--

  The "dist" target creates a binary distribution of your application
  in a directory structure ready to be archived in a tar.gz or zip file.
  Note that this target depends on two others:

  * "compile" so that the entire web application (including external
    dependencies) will have been assembled
-->

  <target
    name="dist"
    description="Create binary distribution"
    depends="clean,docs,compile">
    
    <!-- first do the apache distribution -->
    <antcall target="dist-apache"/>
    
    <!-- remove the compress directory, recreated in tomcat distribution -->
    <delete dir="${compress.home}"/>
    
    <!-- do the tomcat distribution -->
    <antcall target="dist-tomcat"/>

  </target>

<!--
  The "dist-tomcat" target creates the war file distribution of your application
  only without creating all docs, zips, etc.  This is to be used for deploying
  your application to a produciton server.
-->
  <target
    name="dist-tomcat"
    description="Create binary distribution"
    depends="compile,compress"
    >
    
    <mkdir dir="${dist.home}"/>
    
    <!-- Create source WAR file -->
    <jar jarfile="${dist.home}/${app.name}.war" basedir="${compress.home}"/>

    <!-- zip up the application WAR file -->
    <zip destfile="${dist.home}/${pack.name}-${app.version}-war.zip" update="true">
      <zipfileset file="${dist.home}/${app.name}.war"/>
    </zip>
  </target>

  	<target
  		name="nightly-build"
  		depends="dist"
  	>
		<property name="mapbuilder.webapp.deploy.dir" value="${geoserver.webapp.dir}/mapbuilder"/>
		<property name="nightlybuild.dir" value="${mapbuilder.webapp.deploy.dir}/nightlybuilds"/>
		<mkdir dir="${nightlybuild.dir}"/>
  		<tstamp/>
		<!-- <delete dir="${mapbuilder.webapp.deploy.dir}"/> -->
  		<copydir dest="${mapbuilder.webapp.deploy.dir}" src="${basedir}/build"></copydir>
  		<copy verbose="true" tofile="${nightlybuild.dir}/${pack.name}-src-${app.version}-${DSTAMP}.zip" file="${dist.home}/${pack.name}-src-${app.version}.zip"/>
  		<copy verbose="true" tofile="${nightlybuild.dir}/${pack.name}-${app.version}-${DSTAMP}.zip" file="${dist.home}/${pack.name}-${app.version}.zip"/>
  		<copy verbose="true" tofile="${nightlybuild.dir}/${pack.name}-${app.version}-war-${DSTAMP}.zip" file="${dist.home}/${pack.name}-${app.version}-war.zip"/>
  	</target>
<!--
  The "dist-apache" target creates the zip file distribution for the Apache/PHP
  environment.
-->
  <target
    name="dist-apache"
    description="Create binary distribution"
    depends="prepare,compress"
    >

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

    <!-- Create source zip file -->
    <zip destfile="${dist.home}/${pack.name}-src-${app.version}.zip" update="true">
      <zipfileset dir="${basedir}" excludes="build/** dist/** compressBuild/** client/** design/**" prefix="mapbuilder"/>
    </zip>
    
    <!-- Create application zip file -->
    <zip destfile="${dist.home}/${pack.name}-${app.version}.zip" update="true">
      <zipfileset dir="${compress.home}" prefix="mapbuilder"/>
    </zip>

  </target>

</project>
+25 −0
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"
outputFilename = "../lib/proj4js-combined.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."