home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Freeware / Grafica / gallerymage / GalleryMage-2.4.1.exe / build.xml next >
Extensible Markup Language  |  2005-04-03  |  5KB  |  173 lines

  1. <?xml version="1.0"?>
  2.  
  3. <project name="gallmage" basedir="." default="all">
  4.  
  5.     <property name="version" value="2.4.1" />
  6.  
  7.     <property name="root" value="." />
  8.     <property name="src" value="${root}/src" />
  9.     <property name="lib" value="${root}/lib" />
  10.     <property name="macbuild" value="${root}/macbuild" />
  11.     <property name="javadoc" value="${root}/javadoc" />
  12.     <property name="classes" value="${root}/classes" />
  13.     
  14.        <taskdef name="jarbundler"
  15.                   classpath="${lib}/jarbundler-1.4.jar"
  16.                   classname="com.loomcom.ant.tasks.jarbundler.JarBundler" />
  17.  
  18.     
  19.     <property name="classpath" value="lib/jtank.jar:lib/edtftpj.jar" />
  20.     
  21.     <property name="java_home" value="${env.JAVA_HOME}" />
  22.     <property name="javac" value="${java_home}/bin/javac" />
  23.     
  24.     <target name="init">
  25.         <mkdir dir="${classes}"/>
  26.         <mkdir dir="${javadoc}"/>
  27.     </target>
  28.  
  29.     <target name="all" depends="jar" >
  30.     </target>
  31.  
  32.     <target name="jar" depends="build" >
  33.           <jar jarfile="gallmage.jar">
  34.         <manifest>
  35.             <attribute name="Main-Class" value="com.tanksoftware.gallmage.GallMage2"/>
  36.             <attribute name="Class-Path" value="lib/jtank.jar lib/edtftpj.jar"/>
  37.         </manifest>               
  38.         <fileset dir="${classes}"/>
  39.           </jar>            
  40.     </target>
  41.     
  42.     <target name="clean">
  43.         <delete failonerror="false" dir="${classes}"/>
  44.         <delete failonerror="false" dir="${javadoc}"/>
  45.         <delete failonerror="false" dir="${macbuild}"/>
  46.         <delete failonerror="false" dir="dog/gallmage/"/>
  47.         <delete failonerror="false">
  48.             <fileset file="gallmage.jar" />
  49.             <fileset file="doc/*.aux" />
  50.             <fileset file="doc/*.log" />
  51.             <fileset file="doc/*.out" />
  52.             <fileset file="doc/*.toc" />
  53.             <fileset file="doc/*.dvi" />
  54.             <fileset file="doc/*.pdf" />
  55.             <fileset file="*.dmg" />
  56.         </delete>
  57.     </target>
  58.  
  59.     <target name="build" depends="init">
  60.         <copy failonerror="false" todir="${lib}">
  61.             <fileset dir="../jtank/">
  62.                 <include name="jtank.jar" />
  63.             </fileset>
  64.         </copy>
  65.         <depend srcdir="${src}"
  66.             destdir="${classes}"
  67.             cache="depcache"
  68.             closure="yes"/>
  69.         <javac destdir="${classes}" debug="on" debuglevel="lines,vars,source" srcdir="${src}" fork="no"
  70.             deprecation="on"
  71.             classpath="${classpath}">
  72.         </javac>
  73.     </target>
  74.     
  75.     <target name="rel" depends="all">
  76.  
  77.         <tar destfile="gallmage-${version}.tar.gz"
  78.             compression="gzip">  
  79.             <tarfileset dir="./" prefix="gallmage/">              
  80.                 <include name="src/**"/>
  81.                 <include name="lib/*.jar"/>
  82.                 <include name="conf/**"/>
  83.                 <include name="doc/**"/>
  84.                 <exclude name="doc/*.aux"/>
  85.                 <exclude name="doc/*.log"/>
  86.                 <exclude name="doc/*.toc"/>
  87.                 <exclude name="doc/*.log"/>
  88.                 <exclude name="doc/*.out"/>
  89.                 <include name="data/*.ico"/>
  90.                 <include name="data/*.icns"/>
  91.                 <include name="data/*.png"/>
  92.                 <include name="sample/**"/>
  93.                 <include name="*.bat"/>
  94.                 <include name="*.nsi"/>
  95.                 <include name="gallmage.jar"/>
  96.                 <include name="ChangeLog"/>
  97.                 <include name="COPYING.txt"/>
  98.                 <include name="README.txt"/>
  99.                 <include name="build.xml"/>            
  100.             </tarfileset>
  101.             <tarfileset dir="./" prefix="gallmage/" mode="755">              
  102.                 <include name="GallMage2"/>
  103.             </tarfileset>
  104.         </tar>
  105.     </target>
  106.     
  107.     <target name="mac" depends="rel">
  108.         <delete failonerror="false" dir="${macbuild}"/>
  109.         
  110.         <mkdir dir="${macbuild}"/>
  111.         <mkdir dir="${macbuild}/Gallery Mage/Gallery Mage"/>
  112.         <jarbundler 
  113.             dir="${macbuild}/Gallery Mage/Gallery Mage" 
  114.             jars="gallmage.jar lib/jtank.jar lib/edtftpj.jar" 
  115.             mainclass="com.tanksoftware.gallmage.GallMage2" name="Gallery Mage"
  116.             vmoptions="-Xms32m -Xmx512m" 
  117.             jvmversion="1.4+"
  118.             icon="data/gm.icns"
  119.         />
  120.         <copy todir="${macbuild}/Gallery Mage/Gallery Mage">
  121.             <fileset dir="./">
  122.                 <include name="sample/**"/>
  123.                 <include name="conf/**"/>
  124.                 <include name="doc/gallmage.pdf" />
  125.                 <include name="doc/gallmage/**" />
  126.             </fileset>
  127.         </copy>
  128.         <copy todir="${macbuild}/Gallery Mage">
  129.             <fileset dir="./doc">
  130.                 <include name="drag Gallery Mage into your Applications folder" />
  131.             </fileset>
  132.         </copy>
  133.     </target>
  134.     
  135.     <target name="mac-dmg" depends="mac">
  136.         <fileset file="*.dmg" />
  137.         <exec executable="hdiutil" failonerror="true">
  138.             <arg value="create"/>
  139.             <arg value="-srcfolder"/>
  140.             <arg value="${macbuild}/Gallery Mage"/>
  141.             <arg value="-fs"/>
  142.             <arg value="HFS+"/>
  143.             <arg value="GalleryMage-${version}.dmg"/>
  144.         </exec>
  145.     </target>
  146.  
  147.     <!-- run twice to make sure, we have the correct toc and references -->
  148.     <target name="pdf" depends="init">
  149.         <exec dir="doc" executable="pdflatex">
  150.             <arg value="gallmage.tex" />
  151.         </exec>
  152.         <exec dir="doc" executable="pdflatex">
  153.             <arg value="gallmage.tex" />
  154.         </exec>
  155.     </target>
  156.  
  157.     <!-- always run latex before running latex2html (aux file) -->
  158.     <!-- latex runs in batchmode, because we don't have to care about errors here -->
  159.     <target name="html" depends="pdf">
  160.         <exec dir="doc" executable="latex">
  161.             <arg line="-interaction=batchmode gallmage.tex" />
  162.         </exec>
  163.         <exec dir="doc" executable="latex2html">
  164.             <arg line="-split 0 -info 0 -local_icons gallmage.tex" />
  165.         </exec>
  166.         <exec dir="doc" executable="latex2html">
  167.             <arg line="-split 0 -info 0 gallmage.tex" />
  168.         </exec>
  169.     </target>
  170.     
  171.     
  172. </project>
  173.