commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/primitives build.xml
Date Tue, 14 Oct 2003 21:49:16 GMT
scolebourne    2003/10/14 14:49:16

  Modified:    primitives build.xml
  Log:
  Tidy up ready for first release
  
  Revision  Changes    Path
  1.3       +110 -73   jakarta-commons/primitives/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/primitives/build.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- build.xml	14 Oct 2003 19:40:42 -0000	1.2
  +++ build.xml	14 Oct 2003 21:49:16 -0000	1.3
  @@ -45,20 +45,44 @@
     <!-- The current version number of this component -->
     <property name="component.version"       value="0.1"/>
   
  -  <!-- The base directory for compilation targets -->
  -  <property name="build.home"              value="target"/>
  +  <!-- The final name of the component -->
  +  <property name="final.name"              value="commons-${component.name}-${component.version}"/>
   
  -  <!-- The base directory for component configuration files -->
  -  <property name="conf.home"               value="src/conf"/>
  +  <!-- The final source name of the component -->
  +  <property name="final.name.src"          value="${final.name}-src"/>
   
  -  <!-- The base directory for distribution targets -->
  -  <property name="dist.home"               value="dist"/>
  +  <!-- The base directory for component sources -->
  +  <property name="source"                  value="src"/>
   
     <!-- The base directory for component sources -->
     <property name="source.home"             value="src/java"/>
   
     <!-- The base directory for unit test sources -->
     <property name="test.home"               value="src/test"/>
  +  
  +  <!-- The base directory for component configuration files -->
  +  <property name="conf.home"               value="src/conf"/>
  +
  +  <!-- The base directory for targets -->
  +  <property name="target"                  value="target"/>
  +
  +  <!-- The directory for compiled classes -->
  +  <property name="target.class"            value="${target}/classes"/>
  +
  +  <!-- The directory for compiled test classes -->
  +  <property name="target.class.test"       value="${target}/test-classes"/>
  +
  +  <!-- The directory for filtered conf files -->
  +  <property name="target.conf"             value="${target}/conf"/>
  +
  +  <!-- The directory for javadoc -->
  +  <property name="target.javadoc"          value="${target}/docs"/>
  +
  +  <!-- The base directory for assembling zips -->
  +  <property name="target.assembly"         value="${target}/${final.name}"/>
  +  
  +  <!-- The base directory for assembling zips -->
  +  <property name="target.assembly.src"         value="${target}/${final.name.src}"/>
   
   
   <!-- ========== Compiler Defaults ========================================= -->
  @@ -75,7 +99,7 @@
   
     <!-- Construct compile classpath -->
     <path id="compile.classpath">
  -    <pathelement location="${build.home}/classes"/>
  +    <pathelement location="${target}/classes"/>
     </path>
   
   
  @@ -84,8 +108,8 @@
   
     <!-- Construct unit test classpath -->
     <path id="test.classpath">
  -    <pathelement location="${build.home}/classes"/>
  -    <pathelement location="${build.home}/tests"/>
  +    <pathelement location="${target.class}"/>
  +    <pathelement location="${target.class.test}"/>
       <pathelement location="${junit.jar}"/>
       <pathelement location="${collections-testframework.jar}"/>
     </path>
  @@ -100,8 +124,7 @@
   <!-- ========== Executable Targets ======================================== -->
   
   
  -  <target name="init"
  -   description="Initialize and evaluate conditionals">
  +  <target name="init" description="Initialize and evaluate conditionals">
       <echo message="-------- ${component.name} ${component.version} --------"/>
       <filter  token="name"                  value="${component.name}"/>
       <filter  token="package"               value="${component.package}"/>
  @@ -109,72 +132,65 @@
     </target>
   
   
  -  <target name="prepare" depends="init"
  -   description="Prepare build directory">
  -    <mkdir dir="${build.home}"/>
  -    <mkdir dir="${build.home}/classes"/>
  -    <mkdir dir="${build.home}/conf"/>
  -    <mkdir dir="${build.home}/tests"/>
  +  <target name="prepare" depends="init" description="Prepare build directory">
  +    <mkdir dir="${target}"/>
  +    <mkdir dir="${target.class}"/>
  +    <mkdir dir="${target.class.test}"/>
  +    <mkdir dir="${target.conf}"/>
     </target>
   
   
  -  <target name="static" depends="prepare"
  -   description="Copy static files to build directory">
  +  <target name="static" depends="prepare" description="Copy static files to build directory">
       <tstamp/>
  -    <copy  todir="${build.home}/conf" filtering="on">
  +    <copy  todir="${target.conf}" filtering="on">
         <fileset dir="${conf.home}" includes="*.MF"/>
       </copy>
     </target>
   
   
  -  <target name="compile" depends="static"
  -   description="Compile shareable components">
  +  <target name="compile" depends="static" description="Compile main classes">
       <javac  srcdir="${source.home}"
  -           destdir="${build.home}/classes"
  +           destdir="${target.class}"
                debug="${compile.debug}"
          deprecation="${compile.deprecation}"
             optimize="${compile.optimize}">
         <classpath refid="compile.classpath"/>
       </javac>
  -  <!--  <copy    todir="${build.home}/classes" filtering="on">
  -      <fileset dir="${source.home}" excludes="**/*.java"/>
  -    </copy> -->
     </target>
   
   
  -  <target name="compile.tests" depends="compile"
  -   description="Compile unit test cases">
  +  <target name="compile.tests" depends="compile" description="Compile unit test classes">
       <javac  srcdir="${test.home}"
  -           destdir="${build.home}/tests"
  +           destdir="${target.class.test}"
                debug="${compile.debug}"
          deprecation="${compile.deprecation}"
             optimize="${compile.optimize}">
         <classpath refid="test.classpath"/>
       </javac>
  -    <copy    todir="${build.home}/tests" filtering="on">
  -      <fileset dir="${test.home}" excludes="**/*.java"/>
  -    </copy>
     </target>
   
   
  -  <target name="clean"
  -   description="Clean build and distribution directories">
  -    <delete    dir="${build.home}"/>
  -    <delete    dir="${dist.home}"/>
  +  <target name="jar" depends="compile" description="Create jar">
  +    <mkdir dir="${target.class}/META-INF"/>
  +    <copy file="LICENSE.txt" tofile="${target.class}/META-INF/LICENSE.txt"/>
  +    <jar jarfile="${target}/${final.name}.jar"
  +         basedir="${target.class}"
  +         manifest="${target.conf}/MANIFEST.MF"/>
     </target>
   
   
  -  <target name="all" depends="clean,compile"
  -   description="Clean and compile all components"/>
  +  <target name="clean" description="Clean build and distribution directories">
  +    <delete dir="${target}"/>
  +  </target>
  +
  +
  +  <target name="all" depends="clean,compile" description="Clean and compile all components"/>
   
   
  -  <target name="javadoc" depends="compile"
  -   description="Create component Javadoc documentation">
  -    <mkdir      dir="${dist.home}"/>
  -    <mkdir      dir="${dist.home}/docs"/>
  -    <mkdir      dir="${dist.home}/docs/api"/>
  +  <target name="javadoc" depends="compile" description="Create component Javadoc documentation">
  +    <mkdir dir="${target.javadoc}/api"/>
       <javadoc sourcepath="${source.home}"
  -                destdir="${dist.home}/docs/api"
  +                destdir="${target.javadoc}/api"
              packagenames="org.apache.commons.*"
                    author="true"
                   private="true"
  @@ -187,36 +203,57 @@
     </target>
   
   
  -  <target name="dist" depends="compile,javadoc"
  -   description="Create binary distribution">
  -    <mkdir      dir="${dist.home}"/>
  -    <copy      file="LICENSE.txt"
  -              todir="${dist.home}"/>
  -    <copy      file="RELEASE-NOTES.txt"
  -              todir="${dist.home}"/>
  -    <antcall target="jar"/>
  +  <target name="dist" depends="dist-bin,dist-src" description="Create distribution">
     </target>
  -
  -
  -  <target name="jar" depends="compile"
  -   description="Create jar">
  -    <mkdir      dir="${dist.home}"/>
  -    <mkdir      dir="${build.home}/classes/META-INF"/>
  -    <copy      file="LICENSE.txt"
  -             tofile="${build.home}/classes/META-INF/LICENSE.txt"/>
  -    <jar    jarfile="${dist.home}/commons-${component.name}.jar"
  -            basedir="${build.home}/classes"
  -           manifest="${build.home}/conf/MANIFEST.MF"/>
  -  </target>
  -
  -
  -  <target name="install-jar" depends="jar"
  -   description="--> Installs jar file in ${lib.repo}">
  -    <copy todir="${lib.repo}" filtering="no">
  -      <fileset dir="${dist.home}">
  -        <include name="commons-${component.name}.jar"/>
  -      </fileset>
  +  
  +  
  +  <target name="dist-bin" depends="compile,test,jar,javadoc" description="Create binary
distribution">
  +    <mkdir dir="${target.assembly}"/>
  +    
  +    <copy file="LICENSE.txt" todir="${target.assembly}"/>
  +    <copy file="RELEASE-NOTES.txt" todir="${target.assembly}"/>
  +    <copy file="${target}/${final.name}.jar" todir="${target.assembly}"/>
  +    <mkdir dir="${target.assembly}/docs"/>
  +    <copy todir="${target.assembly}/docs">
  +      <fileset dir="${target.javadoc}"/>
  +    </copy>
  +    
  +	<tar destfile="${target}/${final.name}.tar" basedir="${target.assembly}"/>
  +	<gzip zipfile="${target}/${final.name}.tar.gz" src="${target}/${final.name}.tar"/>
  +	<delete file="${target}/${final.name}.tar"/>
  +	
  +	<fixcrlf srcdir="${target.assembly}" eol="crlf" includes="**/*.txt"/>
  +	<zip destfile="${target}/${final.name}.zip" basedir="${target.assembly}"/>
  +	
  +	<delete dir="${target.assembly}"/>
  +  </target>
  +  
  +  <target name="dist-src" depends="compile,test,jar" description="Create source distribution">
  +    <mkdir dir="${target.assembly.src}"/>
  +    
  +    <copy file="LICENSE.txt" todir="${target.assembly.src}"/>
  +    <copy file="RELEASE-NOTES.txt" todir="${target.assembly.src}"/>
  +    <copy file="build.xml" todir="${target.assembly.src}"/>
  +    <copy file="maven.xml" todir="${target.assembly.src}"/>
  +    <copy file="project.properties" todir="${target.assembly.src}"/>
  +    <copy file="project.xml" todir="${target.assembly.src}"/>
  +    <copy file="checkstyle.xml" todir="${target.assembly.src}"/>
  +    <copy file="${target}/${final.name}.jar" todir="${target.assembly.src}"/>
  +    <mkdir dir="${target.assembly.src}/${source}"/>
  +    <copy todir="${target.assembly.src}/${source}">
  +      <fileset dir="${source}"/>
       </copy>
  +    
  +	<tar destfile="${target}/${final.name.src}.tar" basedir="${target.assembly.src}"/>
  +	<gzip zipfile="${target}/${final.name.src}.tar.gz" src="${target}/${final.name.src}.tar"/>
  +	<delete file="${target}/${final.name.src}.tar"/>
  +	
  +	<fixcrlf srcdir="${target.assembly.src}" eol="crlf" includes="**/*.txt"/>
  +	<fixcrlf srcdir="${target.assembly.src}" eol="crlf" includes="**/*.xml"/>
  +	<fixcrlf srcdir="${target.assembly.src}" eol="crlf" includes="**/*.properties"/>
  +	<zip destfile="${target}/${final.name.src}.zip" basedir="${target.assembly.src}"/>
  +	
  +	<delete dir="${target.assembly.src}"/>
     </target>
   
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message