rebuilding head
authoridfx <idfx>
Sat, 6 Nov 2004 20:20:16 +0000 (20:20 +0000)
committeridfx <idfx>
Sat, 6 Nov 2004 20:20:16 +0000 (20:20 +0000)
NEWS
build.xml
perms.sh-dist

diff --git a/NEWS b/NEWS
index e68411a..4c7e76e 100755 (executable)
--- a/NEWS
+++ b/NEWS
@@ -1,8 +1,8 @@
-[last changed: $Date: 2003/11/26 18:27:20 $]  2002 mir-coders group
+[last changed: $Date: 2004/11/06 20:20:16 $]  2002 mir-coders group
 -------------------------------------------------------------------------------
 
 ================================
-1.1 (as of yet unreleased)
+1.1-rc1 (as of yet unreleased)
 ================================
 
 [New features/Improvements]
   publication date and include things like image thumbnails
   
 [Bugfixes]
+* more image formats supported with JAI / Java Image I/O
 
 [Build process]
 
 [Maintenance]
 
 [Notes]
+Mir depends media operations depend on the correct installation of
+JAI / Java Image I/O in the JRE running tomcat.
 
 ===============================
 1.0.0 final released 2002/12/24
index 4f7d893..3e3f1b2 100755 (executable)
--- a/build.xml
+++ b/build.xml
-<project name="Mir" default="compile" basedir=".">
-
-
-<!-- What this file is all about
-
-     You can use this version of build.xml to use directly with ant
-     i.e. without the build.sh script. Simply call ant and let it all
-     happen.
--->
-
-<!-- Property Definitions
-
-     Please not that only the first couple of properties have to be defined.
-     The rest, residing below the "no customization needed" line may be
-     customized if you know what you are doing. Else, leave the defaults
-     and use them to look up where ant places all the files.
-
-     app.name          Base name of this application, used to
-                       construct filenames and directories.
-
-     deploy.home       The name of the directory into which the
-                       deployment hierarchy will be created.
-                       Normally, this will be the name of a
-                       subdirectory under $TOMCAT_HOME/webapps.
-
-     deploy.classes    The name of the directory that will contain
-                       the class files.
-
-     dist.home        The name of the base directory in which
-                       distribution files are created.
-
-     dist.src          The name of the distribution JAR file
-                       containing the application source code,
-                       to be stored in the "dist.home" directory.
-                       This filename should end with ".jar".
-
-     dist.war          The name of the Web ARchive (WAR) file
-                       containing our deployable application.
-                       This filename should end with ".war".
-
-     javadoc.home      The name of the base directory in which
-                       the JavaDoc documentation for this application
-                       is generated.
-
-     tomcat.home       The name of the base directory in which
-                       Tomcat has been installed.  This value is
-                       normally set automatically from the value
-                       of the TOMCAT_HOME environment variable.
-
-       java.home          The location of your Java SDK.
-
-       java.localhome     Where your local java classes and jar files
-                       are located.
-
-       tomcat.home        The location of the tomcat root directory.
-
--->
+<project name="Mir" default="deploy" basedir=".">
+  <!--
+    - Build script for the Mir project
+    -
+    - usefull tasks are:
+    -   * compile
+    -        Creates the jars needed for a mir deployment
+    -   * deploy
+    -        Sets up a deployment directory
+    -   * binary-distribution
+    -        Sets up a distributable version of mir in the
+    -        form of a war file
+    -   * source-distribution
+    -        Sets up a distributable version of mir as a
+    -        zipped version of the source tree
+    -   * javadoc
+    -        Generates the project's javadoc
+    -->
+
+  <property name="version"        value="1.1.0rc0"/>
 
   <property name="app.name"       value="mir"/>
+
+  <!-- -->
   <property name="deploy.home"    value="./bin/${app.name}"/>
 
-  <!-- don't use unless your Jikes is >= v1.18 -->
-  <!-- <property name="build.compiler"   value="jikes"/>-->
+  <!-- The distribution will be built here: -->
+  <property name="distribution.home"      value="./dist"/>
 
 
-<!-- No customization required after this line -->
 
+  <!-- The temporary files made during the build process
+       will be created here: -->
+  <property name="build.home"     value="./build"/>
+  <property name="build.classes"  value="./${build.home}/classes"/>
+  <property name="build.jars"  value="./${build.home}/jars"/>
+  <property name="build.javadoc"   value="${build.home}/javadoc"/>
+
+  <!-- retrieve environment variables -->
   <property environment="env"/>
-  <property name="dist.home"      value="${deploy.home}"/>
+<!--
   <property name="deploy.webinf"  value="${deploy.home}/WEB-INF"/>
   <property name="deploy.classes" value="${deploy.webinf}/classes"/>
+
   <property name="dist.src"       value="${app.name}.jar"/>
   <property name="dist.war"       value="${app.name}.war"/>
-  <property name="javadoc.home"   value="${deploy.home}/javadoc"/>
+  -->
   <property name="tomcat.home"    value="${env.TOMCAT_HOME}"/>
 
+<!--
+  <property name="compile.optimize" value="off" />
+  <property name="compile.debug" value="on" />
+  -->
 
+  <target name="deploy" depends="compile,generate-deployment-tree" 
+      description="Sets up a deployment directory">
+  </target>
 
-  <!-- Construct the classpath -->
-  <path id="project.class.path">
-    <pathelement path="${deploy.home}"/>
-    <pathelement path="${deploy.classes}"/>
-    <pathelement path="source"/>
-    <pathelement path="etc/extrasource"/>
-    <fileset dir="lib">
-      <include name="*.jar"/>
-    </fileset>
-    <fileset dir="lib/struts">
-      <include name="*.jar"/>
-    </fileset>
-    <fileset dir="lib/hibernate">
-      <include name="*.jar"/>
-    </fileset>
-    <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
-  <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
-       <fileset dir="${tomcat.home}">
-               <include name="lib/common/*.jar" />
-       </fileset>
-  <!-- for libs shared between webapps (tomcat 3.3.x) -->
-       <fileset dir="${tomcat.home}">
-               <include name="lib/apps/*.jar" />
-       </fileset>
-  <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
-       <fileset dir="${tomcat.home}">
-               <include name="common/lib/*.jar" />
-       </fileset>
-  <!-- for libs shared between webapps (tomcat 4.0.x) -->
-       <fileset dir="${tomcat.home}">
-               <include name="lib/*.jar" />
-       </fileset>
-  <!-- for libs shared between webapps (tomcat 4.1.x) -->
-       <fileset dir="${tomcat.home}">
-               <include name="shared/lib/*.jar" />
-       </fileset>
-       <fileset dir="${tomcat.home}">
-               <include name="common/endorsed/*.jar" />
-       </fileset>
-  </path>
-
-
+  <target name="debug" depends="compile-debug,generate-deployment-tree"
+      description="Sets up a deployment directory with debug enabled">
 
-<!-- The "prepare" target is used to construct the deployment home
-     directory structure (if necessary), and to copy in static files
-     as required.  In the example below, Ant is instructed to create
-     the deployment directory, copy the contents of the "web/" source
-     hierarchy, and set up the WEB-INF subdirectory appropriately.
--->
+  </target>
 
-  <target name="prepare">
-    <mkdir  dir="${deploy.home}"/>
-    <mkdir  dir="${deploy.webinf}"/>
-    <mkdir  dir="${deploy.classes}"/>
-    <mkdir  dir="${deploy.webinf}/log"/>
+  <target name="generate-deployment-tree">
+    <property name="destination" value="${deploy.home}"/>
+    <mkdir  dir="${destination}"/>
+    <mkdir  dir="${destination}/WEB-INF"/>
+    <delete dir="${destination}/WEB-INF/lib"/>
+    <mkdir  dir="${destination}/WEB-INF/lib"/>
+    <mkdir  dir="${destination}/WEB-INF/log"/>
 
-    <copy todir="${deploy.home}">
+    <copy todir="${destination}">
       <fileset dir="web"/>
     </copy>
-        
-    <copy todir="${deploy.webinf}/classes">
-       <fileset dir="source">
-               <include name="**/*.xml"/>
-       </fileset>
-    </copy>
 
-    <copy todir="${deploy.webinf}/etc">
-      <fileset dir="etc" excludes="bundles/** hibernate.cfg.xml web.xml"/>
+    <copy todir="${destination}/WEB-INF/etc">
+      <fileset dir="etc" excludes="extrasource,extralib"/>
     </copy>
-    <copy todir="${deploy.classes}/bundles">
-        <fileset dir="etc/bundles"/>
+
+    <copy todir="${destination}/WEB-INF">
+      <fileset dir="meta"/>
     </copy>
-    <copy todir="${deploy.webinf}" file="etc/web.xml"/>
 
-    <copy todir="${deploy.webinf}/templates">
+    <copy todir="${destination}/WEB-INF/templates">
       <fileset dir="templates"/>
     </copy>
-    
-    <copy todir="${deploy.webinf}" file="source/default.properties" />
-    
-    <copy todir="${deploy.classes}/bundles">
+
+    <copy todir="${destination}/WEB-INF/bundles">
       <fileset dir="bundles"/>
     </copy>
-    
-    <copy todir="${deploy.classes}" file="etc/hibernate.cfg.xml"/>
-    
-    <copy todir="${deploy.home}/WEB-INF/lib">
-      <fileset dir="lib">
-        <exclude name="ant.jar"/>
-        <exclude name="xerces.jar"/>
-      </fileset>
-      <fileset dir="lib/hibernate"/>
-      <fileset dir="lib/struts"/>
-    </copy>
-  </target>
 
+    <copy todir="${destination}/WEB-INF" file="source/default.properties" />
 
-
-<!-- The "clean" target removes the deployment home directory structure,
-     so that the next time the "compile" target is requested, it will need
-     to compile everything from scratch.
--->
-
+    <copy todir="${destination}/WEB-INF/lib">
+      <fileset dir="lib" />
+      <fileset dir="etc/extralib" />
+      <fileset dir="${build.jars}" />
+    </copy>
+  </target>
 
   <target name="clean">
-    <delete dir="${deploy.classes}"/>
-    <mkdir dir="${deploy.classes}"/>
+    <delete dir="${build.home}"/>
   </target>
 
+  <!-- Construct the classpath -->
+  <path id="project.classpath">
+    <fileset dir="lib">
+      <include name="*.jar"/>
+    </fileset>
+    <fileset dir="etc/extralib">
+      <include name="*.jar"/>
+    </fileset>
+
+    <pathelement path="${tomcat.home}/lib/tomcat.jar"/>
 
+    <!-- for libs shared between tomcat and webapps (tomcat 3.3.x) -->
+    <fileset dir="${tomcat.home}">
+                 <include name="lib/common/*.jar" />
+         </fileset>
+    <!-- for libs shared between webapps (tomcat 3.3.x) -->
+         <fileset dir="${tomcat.home}">
+                 <include name="lib/apps/*.jar" />
+         </fileset>
+    <!-- for libs shared between tomcat and webapps (tomcat 4.x.x) -->
+         <fileset dir="${tomcat.home}">
+                 <include name="common/lib/*.jar" />
+         </fileset>
+    <!-- for libs shared between webapps (tomcat 4.0.x) -->
+         <fileset dir="${tomcat.home}">
+                 <include name="lib/*.jar" />
+         </fileset>
+    <!-- for libs shared between webapps (tomcat 4.1.x) -->
+         <fileset dir="${tomcat.home}">
+                 <include name="shared/lib/*.jar" />
+         </fileset>
+
+         <fileset dir="${tomcat.home}">
+                 <include name="common/endorsed/*.jar" />
+         </fileset>
+  </path>
 
-<!-- The "mrproper" target removes the entire deploy dir - including all
-       built pages and images.
--->
 
-  <target name="mrproper">
-    <delete dir="${deploy.home}"/>
+  <target name="prepare-compilation">
+    <mkdir  dir="${build.classes}"/>
+    <mkdir  dir="${build.jars}"/>
+    <uptodate property="up.to.date" targetfile="${build.jars}/mir.jar">
+      <srcfiles dir="source" includes="**/*.java"/>
+      <srcfiles dir="lib" includes="*.jar"/>
+      <srcfiles dir="etc/extrasource" includes="**/*"/>
+      <srcfiles dir="etc/extralib" includes="*"/>
+    </uptodate>
   </target>
 
-  <!-- drop out if $TOMCAT_HOME is not set>-->
-  <target name="testtomcat" unless="tomcat.present">
-    <fail message="the $$TOMCAT_HOME environment variable is not set or is set to the wrong path. Please set it first. giving up!"/>
+  <!-- compile target: compiles all files into the build/classes dir -->
+  <target name="compile" depends="prepare-compilation" unless="up.to.date"
+          description="Creates the jars needed for a mir deployment">
+          
+    <javac destdir="${build.classes}" deprecation="on">
+      <src path="source"/>
+      <src path="etc/extrasource"/>
+      <classpath refid="project.classpath"/>
+    </javac>
+
+    <jar
+       jarfile="${build.jars}/mir.jar">
+      <fileset dir="${build.classes}" includes="**/*.class" />
+      <manifest>
+        <attribute name="Built-By" value="${user.name}"/>
+      </manifest>
+    </jar>
   </target>
 
-<!-- The "compile" target is used to compile (or recompile) the Java classes
-     that make up this web application.  The recommended source code directory
-     structure makes this very easy because the <javac> task automatically
-     works its way down a source code hierarchy and compiles any class that
-     has not yet been compiled, or where the source file is newer than the
-     class file.
-
-     Feel free to adjust the compilation option parameters (debug,
-     optimize, and deprecation) to suit your requirements.  It is also
-     possible to base them on properties, so that you can adjust this
-     behavior at runtime.
-
-     The "compile" task depends on the "prepare" task, so the deployment
-     home directory structure will be created if needed the first time.
--->
-
-  <target name="compile" depends="prepare">
-    <!-- check to see if $TOMCAT_HOME was set to something useful.. -->
-    <available file="${tomcat.home}/conf" property="tomcat.present"/>
-    <antcall target="testtomcat"/>
-
-    <!--<antcall target="clean"/>-->
-    <dependset>
-      <srcfileset
-        dir="source"
-        includes="**/*.java"/>
-<!-- ML: now why can't this be added?
-      <srcfileset
-        dir="etc/extrasource"
-        includes="**/*.java"/> -->
-      <srcfileset
-        dir="lib"
-        includes="*.jar"/>
-      <targetfileset
-        dir="${deploy.classes}"
-        includes="**/*.class"/>
-    </dependset>
-    <javac destdir="${deploy.classes}"
+  <!-- compile a debuggable version -->
+  <target name="compile-debug" depends="prepare-compilation">
+    <javac destdir="${build.classes}"
            debug="on" optimize="off" deprecation="on">
       <src path="source"/>
       <src path="etc/extrasource"/>
-      <classpath refid="project.class.path"/>
+      <classpath refid="project.classpath"/>
     </javac>
   </target>
 
 
-
-  <target name="perms">
-    <exec executable="./perms.sh"/>
+  <!-- build the project's javadoc -->
+  <target name="javadoc" depends="prepare-javadoc">
+    <javadoc
+        destdir="${build.javadoc}"
+        author="true"
+        version="true"
+        use="true"
+        packagenames="mir.*,mircoders.*"
+        sourcepath="source"
+        sourcefiles="source/Mir.java,source/OpenMir.java"
+        windowtitle="Mir">
+
+      <classpath refid="project.classpath"/>
+      <link href="http://java.sun.com/j2se/1.3/docs/api"/>
+    </javadoc>
   </target>
 
+  <target name="prepare-javadoc">
+    <mkdir  dir="${build.javadoc}"/>
+  </target>
 
-<!-- The "javadoc" target is used to create the Javadoc API documentation
-     for the Java classes in this web application.  It is assumed that
-     this documentation is included in the deployed application, so the
-     example below generates the Javadoc HTML files in a subdirectory under
-     the deployment home directory.  Feel free to customize the options for
-     the JavaDoc task, after consulting the Ant documentation.
--->
-
-  <target name="javadoc" depends="prepare">
-    <javadoc packagenames="mir.*, mircoders.*"
-            sourcefiles="source/Mir.java,source/OpenMir.java"
-            sourcepath="source"
-             destdir="${javadoc.home}">
-         <classpath refid="project.class.path"/>
-       </javadoc>
+  <target name="prepare-binary-distribution">
+    <mkdir  dir="${distribution.home}"/>
+    <delete dir="${build.home}/binarydist"/>
+    <mkdir  dir="${build.home}/binarydist"/>
   </target>
 
+  <target name="binary-distribution" depends="prepare-binary-distribution">
+    <antcall target="generate-deployment-tree">
+      <param name="destination" value="${build.home}/binarydist"/>
+    </antcall>
 
-<!-- The "all" target rebuilds everything by executing the "clean"
-     target first, which forces the "compile" target to compile all
-     source code instead of just the files that have been changed.
--->
-
-  <target name="all" depends="clean,prepare,compile,javadoc"/>
-
-
-<!-- The "dist" target builds the distribution Web ARchive (WAR) file
-     for this application, suitable for distribution to sites that wish
-     to install your application.  It also creates a JAR file containing
-     the source code for this application, if you wish to distribute
-     that separately.
--->
-  <target name="dist" depends="prepare,compile">
-    <jar jarfile="${dist.home}/mirbase.jar"
-        includes="mir/**"
-        basedir="${deploy.classes}"/>
-    <jar jarfile="${dist.home}/${dist.src}"
-         basedir="./source"/>
-    <jar jarfile="${dist.home}/${dist.war}"
-         basedir="${deploy.home}"
-         excludes="${dist.war}"/>
+    <zip zipfile="${distribution.home}/binary.zip" >
+      <fileset dir="${build.home}/binarydist" includes="**/*" />
+    </zip>
   </target>
-  
-  <target name="rundbtest" depends="compile">
-       <java fork="true" classname="mir.core.test.Test">
-               <classpath>
-                       <fileset dir="${tomcat.home}/common/endorsed">
-                               <include name="**/*.jar"/>
-                       </fileset>
-                       <fileset dir="${tomcat.home}/common/lib">
-                               <include name="**/*.jar"/>
-                       </fileset>
-                       <fileset dir="${deploy.webinf}/lib">
-                               <include name="**/*.jar"/>
-                       </fileset>
-                       <path id="classes" path="${deploy.classes}"/>
-               </classpath>
-               <sysproperty key="org.xml.sax.driver" value="org.apache.xerces.parsers.SAXParser"/> 
-       </java>
+
+  <target name="prepare-source-distribution">
+    <mkdir  dir="${distribution.home}"/>
+  </target>
+
+  <target name="source-distribution" depends="prepare-source-distribution">
+    <zip zipfile="${distribution.home}/source.zip" >
+      <fileset dir="."
+        includes="bundles/**/*,source/**/*,etc/**/*,meta/**/*,web/**/*,templates/**/*,dbscripts/**/*,lib/**/*,doc/**/*,build.xml" />
+    </zip>
+
   </target>
 
 </project>
index 83cbdaf..ae9f312 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 # Where the installed system resides
-INSTDIR=bin/mir
+INSTDIR=`dirname $0`/bin/mir
 
 # The group all files belong to
 GROUP=www-data