Commit 6fa9c511 authored by Michael Adair's avatar Michael Adair
Browse files

re #15: file clean up; clean up of ant build.xml file -retrying

parent 05f805f0
Loading
Loading
Loading
Loading
+19 −312
Original line number Diff line number Diff line
@@ -10,25 +10,6 @@ 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
@@ -37,7 +18,7 @@ $Id: build.xml 2955 2007-07-09 12:12:27Z steven $
     from which Ant executes the requested task.  This is normally
     set to the current working directory.
-->
  <project basedir=".." default="deploy-tomcat" name="proj4js">
  <project basedir=".." default="dist" name="proj4js">

<!-- ===================== Property Definitions =========================== -->
<!--
@@ -85,67 +66,22 @@ $Id: build.xml 2955 2007-07-09 12:12:27Z steven $
                       "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="app.version" value="1.0.0"/>
  <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
@@ -160,41 +96,22 @@ $Id: build.xml 2955 2007-07-09 12:12:27Z steven $
    <mkdir dir="${build.home}"/>
    <!-- Copy static content of the mapbuilder project  -->
    <copy todir="${build.home}">
      <fileset dir="${basedir}" excludes="tempBuild/**"/>
      <fileset dir="${basedir}" excludes="tools/*.pyc "
          includes="lib/proj4js.js,
                    lib/proj4js-combined.js
                    lib/proj4js-compressed.js
                    lib/defs/**
                    lib/projCode/**
                    build/**
                    demo/**
                    test/**
                    tools/**"
      />
    </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,
@@ -205,19 +122,9 @@ $Id: build.xml 2955 2007-07-09 12:12:27Z steven $
  <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">
@@ -226,224 +133,24 @@ $Id: build.xml 2955 2007-07-09 12:12:27Z steven $
    <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 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 -xi ./build -xi ./dist -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
  The "dist" target creates the zip file distribution for the Apache/PHP
  environment.
-->
  <target
    name="dist-apache"
    description="Create binary distribution"
    depends="prepare,compress"
    >
  <target name="dist" description="Create binary distribution" depends="prepare,docs">

    <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 destfile="${dist.home}/${app.name}-${app.version}.zip" update="true">
      <zipfileset dir="${build.home}" prefix="proj4js"/>
    </zip>

  </target>
+3 −1
Original line number Diff line number Diff line
@@ -17,8 +17,10 @@
    
  </style>
  
  <script src="lib/proj4js-compressed.js"></script>
  <script src="lib/proj4js.js"></script>
 
  <script src="lib/defs/EPSG27200.js"></script>
  <script src="lib/defs/EPSG4272.js"></script>
  <script src="lib/defs/EPSG54009.js"></script>
  <script src="lib/defs/EPSG42304.js"></script>
  <script src="lib/defs/EPSG25833.js"></script>

test/staticLoad.html

deleted100755 → 0
+0 −57
Original line number Diff line number Diff line
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <link href="base.css" type="text/css" rel="stylesheet"/>
  <title>Proj4js Test Page</title>
  <script src="../lib/OLprototype.js"></script>
  <script src="../lib/proj4js.js"></script>
  <script src="../lib/projCode/utm.js"></script>
  <script src="../lib/projCode/lcc.js"></script>
  <script src="../lib/projCode/tmerc.js"></script>
  <script src="../lib/projCode/merc.js"></script>
  <script src="../lib/projCode/stere.js"></script>
  <script src="../lib/projCode/gauss.js"></script>
  <script src="../lib/projCode/sterea.js"></script>
  <script src="../lib/projCode/aea.js"></script>
  
  <!-- these below not tested or validated yet !!  -->
  <script src="../lib/projCode/aeqd.js"></script>
  <script src="../lib/projCode/eqdc.js"></script>
  <script src="../lib/projCode/equi.js"></script>
  <script src="../lib/projCode/laea.js"></script>
  <script src="../lib/projCode/mill.js"></script>
  <script src="../lib/projCode/moll.js"></script>
  <script src="../lib/projCode/omerc.js"></script>
  <script src="../lib/projCode/ortho.js"></script>
  <script src="../lib/projCode/poly.js"></script>
  <script src="../lib/projCode/sinu.js"></script>
  <script src="../lib/projCode/vandg.js"></script>
  
  <script src="testdata.js"></script>
  <script src="runtests.js"></script>
  

</head>

<body onload="runTests()">
  <div id="header">
    <h1>Proj4js test page</h1>
  </div>
  <div id="navbar">
    <a href="http://svn.codehaus.org/mapbuilder/cscs">Proj4js</a> | 
    <a href="http://communitymapbuilder.org/">MapBuilder</a> | 
    <a href="http://openlayers.org/">OpenLayers</a> | 
    <a href="http://spatialreference.org/">spatialreference.org</a> 
    <a href="./index.html">dynamic loading of proj code</a> 
  </div>
  <table id="testResult" border="1">
      <tr>
        <th>projection</th>
        <th>class</th>
        <th colspan='3'>forward</th>
        <th colspan='3'>inverse</th>
      </tr>
    </tr>
  </table>
</body>
</html>
 No newline at end of file