Ignore:
Timestamp:
2008-04-30T15:50:01+12:00 (16 years ago)
Author:
ak19
Message:
  1. tar cmd does the compression too; 2. zip targets renamed; 3. property bin -> dist; 4. target generate-download -> make-dist
File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/trunk/gs3-webservices-democlient/build.xml

    r15242 r15305  
    1919 <property name="fedorags3.src" value="${fedorags3.rootdir}/org" />
    2020 <property name="build" value="${basedir}/build" />
    21  <property name="bin" value="${basedir}/bin" />
     21 <property name="dist" value="${basedir}/dist" />
    2222 <property name="QBRdata.rel.path" value="org/greenstone/gs3client/data" />
    2323 <property name="dlservices.rel.path" value="org/greenstone/gs3client/dlservices" />
     
    2727 <property name="download.zip.name" value="gs3_webservices_democlient" />
    2828 <property name="log4j.propFile" value="log4j.properties" />
    29  <property name="zip.excludes" value="bin/**,logs/**,gs3democlient.properties,${log4j.propFile}" />
     29 <property name="zip.excludes" value="dist/**,logs/**,gs3democlient.properties" />
     30
    3031  <!-- ============ project classpath: everything in the lib folder =================== -->
    3132 <path id="project.classpath">
     
    4142    <echo>- ant compile-demo-client</echo>
    4243    <echo>  for compiling the democlient</echo>
    43     <echo>- fedoraGS3jar</echo>
     44    <echo>- ant fedoraGS3jar</echo>
    4445    <echo>  for generating the fedoraGS3.jar dependency file</echo>
    45     <echo>- QBRdatajar</echo>
     46    <echo>- ant QBRdatajar</echo>
    4647    <echo>  for generating the QBRdata.jar dependency file</echo>
    47     <echo>- generate-download</echo>
     48    <echo>- ant make-dist</echo>
    4849    <echo>  for generating the zip/gzip/bzip file of the project</echo>
    4950    <echo>- ant clean-democlient</echo>
     
    6970</target>
    7071
    71 <target name="generate-download" description="Generates the zip file of the lib and src folders and the executable ${exec.jar.name} file" depends="get-ziptype,ensure-exec-jar" if="zip.type">
    72      <mkdir dir="${bin}" />
     72<target name="make-dist" description="Generates the zip file of the lib and src folders and the executable ${exec.jar.name} file" depends="get-zipformat,ensure-exec-jar" if="zip.type">
     73     <mkdir dir="${dist}" />
     74     <echo>zip.type=${zip.type}</echo>
    7375     <antcall target="create-${zip.type}"/>
    7476</target>
     
    103105    <fileset dir="logs"/>
    104106    <fileset file="${log4j.propFile}"/>
    105     <fileset file="${bin}/${download.zip.name}.tar"/>
    106     <fileset file="${bin}/${download.zip.name}.tar.gz"/>
    107     <fileset file="${bin}/${download.zip.name}.zip"/>
    108     <fileset file="${bin}/${download.zip.name}.tar.bz2"/>
     107    <fileset file="${dist}/${download.zip.name}.tar"/>
     108    <fileset file="${dist}/${download.zip.name}.tar.gz"/>
     109    <fileset file="${dist}/${download.zip.name}.zip"/>
     110    <fileset file="${dist}/${download.zip.name}.tar.bz2"/>
    109111   </delete>
    110112</target>
     
    166168</target>
    167169
    168 <!-- User input for generating compressed output file for one of the chosen file types (zip, gzip, or bzip)-->
    169 <target name="create-gzip" if="gzip" description="User chose to create a tar.gz file of the project">
    170     <tar destfile="${bin}/${download.zip.name}.tar" basedir="${basedir}" excludes="${zip.excludes}" />
    171     <gzip destfile="${bin}/${download.zip.name}.tar.gz" src="${bin}/${download.zip.name}.tar" />
    172     <delete file="${bin}/${download.zip.name}.tar"/>
    173 </target>
    174 
    175 <target name="create-bzip" if="bzip" description="User chose to create a tar.bz2 file of the project">
    176     <tar destfile="${bin}/${download.zip.name}.tar" basedir="${basedir}" excludes="${zip.excludes}"/>
    177     <bzip2 destfile="${bin}/${download.zip.name}.tar.bz2" src="${bin}/${download.zip.name}.tar"/>
    178     <delete file="${bin}/${download.zip.name}.tar"/>
    179 </target>
    180 
    181 <target name="create-zip" if="zip" description="User chose to create a zip file of the project">
    182     <zip destfile="${bin}/${download.zip.name}.zip" basedir="${basedir}" excludes="${zip.excludes}"/>
    183 </target>
    184 
    185 <target name="get-ziptype">
     170<!-- User input for generating compressed output file for one of the chosen file types. A choice of zip, tar.gz (tar gzip), or tar.bz2 (tar bzip)-->
     171<target name="create-targzip" if="zip.type" description="User chose to create a tar.gz file of the project">
     172    <tar destfile="${dist}/${download.zip.name}.tar.gz" basedir="${basedir}" compression="gzip" excludes="${zip.excludes}" />
     173</target>
     174
     175<target name="create-tarbzip" if="zip.type" description="User chose to create a tar.bz2 file of the project">
     176    <tar destfile="${dist}/${download.zip.name}.tar.bz2" basedir="${basedir}" compression="bzip2" excludes="${zip.excludes}" />
     177</target>
     178
     179<target name="create-zip" if="zip.type" description="User chose to create a zip file of the project">
     180     <zip basedir="${basedir}" destfile="${dist}/${download.zip.name}.zip"
     181    excludes="${zip.excludes}" />
     182</target>
     183
     184<target name="get-zipformat">
    186185<!--<input addproperty="zip.type" validargs="zip,gzip,bzip">--><!-- doesn't work with default value-->
    187     <input addproperty="zip.type" defaultvalue="zip">What type of compressed output file do you want to generate.
    188 Choose from zip, gzip (for tar.gz), bzip (tar.bz2)?
     186    <input addproperty="zip.format" defaultvalue="zip">What type of compressed output file do you want to generate?
     187Type one of: zip, tar.gz, tar.bz2
    189188Press enter for default: zip /></input>
    190189    <echo>You chose output file type: ${zip.type}</echo>
    191     <condition property="gzip">
    192       <equals arg1="gzip" arg2="${zip.type}"/>
    193     </condition>
    194     <condition property="zip">
    195       <equals arg1="zip" arg2="${zip.type}"/>
    196     </condition>
    197     <condition property="bzip">
    198       <equals arg1="bzip" arg2="${zip.type}"/>
    199     </condition>
     190    <condition property="zip.type" value="targzip">
     191      <equals arg1="tar.gz" arg2="${zip.format}"/>
     192    </condition>
     193    <condition property="zip.type" value="zip">
     194      <equals arg1="zip" arg2="${zip.format}"/>
     195    </condition>
     196    <condition property="zip.type" value="tarbzip">
     197      <equals arg1="tar.bz2" arg2="${zip.format}"/>
     198    </condition>
     199    <echo>zip.type=${zip.type}</echo>
    200200  </target>
    201201</project>
Note: See TracChangeset for help on using the changeset viewer.