view build.xml @ 2:e16016635b2a

Uploaded
author timpalpant
date Mon, 13 Feb 2012 22:12:06 -0500
parents
children
line wrap: on
line source

<?xml version="1.0" encoding="iso-8859-1"?>
<project name="java-genomics-toolkit" default="jar" basedir=".">
  <description>
    build the toolkit
  </description>
  
  <!-- set global properties for this build -->
  <property name="version" value="1.1.0"/>
  <property name="buildnumber" value="1"/>
  <property name="copyright" value="Copyright &#xa9; 2011 Timothy Palpant"/>
  
  <!-- directory variables -->
  <property name="src" location="src"/>
  <property name="test" location="test"/>
  <property name="gui" location="gui"/>
  <property name="build" location="build"/>
  <property name="dist" location="dist"/>
  <property name="lib" location="lib"/>

  <!-- compile all Java code -->
  <target name="compile" description="compile the scripts">
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
    
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}" source="1.7" target="1.7">
	  <classpath>
	    <path id="lib.path.ref">
	      <fileset dir="lib" includes="*.jar"/>
	    </path>
	  </classpath>
    </javac>
    
    <!-- Compile the java code from ${gui} into ${build} -->
    <javac srcdir="${gui}" destdir="${build}" source="1.7" target="1.7">
      <classpath>
  	    <path id="lib.path.ref">
  	      <fileset dir="lib" includes="*.jar"/>
  	    </path>
  	  </classpath>
	</javac>
  </target>

  <!-- package all Java code into a JAR file -->
  <target name="jar" depends="compile" description="generate the jarfile">
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}"/>

    <!-- Put everything in ${build} into the jar file -->
    <jar jarfile="${dist}/${ant.project.name}.jar" manifest="META-INF/MANIFEST.MF">
      <fileset dir="${build}" />
    </jar>
  </target>

  <!-- Package the jar file into a Mac OS X application with jarbundler -->
  <target name="package-osx" depends="jar" description="Build the application for OS X">
    <taskdef name="jarbundler"
             classpath="${lib}/jarbundler-2.2.0.jar" 
             classname="net.sourceforge.jarbundler.JarBundler"/>

    <jarbundler dir="${dist}" verbose="false" showPlist="false"
                name="Genomics Toolkit"
                mainclass="edu.unc.genomics.ToolRunner"
      			jvmversion="1.7+"
      			stubfile="stubFile.sh"
                version="${version}"
                infostring="${ant.project.name}, ${copyright}"
                build="${buildnumber}"
                bundleid="edu.unc.genomics.GenomicsToolkit">
      
        <jarfilelist dir="${dist}" files="${ant.project.name}.jar"/>
        <jarfileset dir="${lib}">
          <include name="*.jar" />
          <exclude name="launch4j.jar" />
          <exclude name="xstream.jar" />
          <exclude name="jarbundler-2.2.0.jar" />
        </jarfileset>

	    <!-- Adjust the look, feel and behavior -->
	    <javaproperty name="apple.laf.useScreenMenuBar" value="true"/>
	    <javaproperty name="apple.awt.brushMetal" value="true"/>
	    <javaproperty name="apple.awt.showGrowBox" value="false"/>
      	<javaproperty name="apple.awt.textantialiasing" value="true"/>
        <javaproperty name="apple.awt.antialiasing" value="true"/>
	
	    <!-- Associate document types with this application -->
	    <documenttype name="Assembly files"
	      			  extensions="len" 
	                  role="Viewer" />
	
	    <!-- Include resource files -->                
	    <resourcefilelist dir="." files="README.rdoc"/>
        <resourcefilelist dir="." files="toolConf.xml"/>
	    <resourcefileset dir="." includes="resources/assemblies/*.len"/>
        <javafilelist dir="." files="log4j.properties"/>
    </jarbundler>
  </target>
  
  <!-- Package the jar file into a Windows application with launch4j -->
  <target name="package-win" depends="jar" description="Build the application for Windows">
    <taskdef name="launch4j"
        classname="net.sf.launch4j.ant.Launch4jTask"
        classpath="${lib}/launch4j.jar:${lib}/xstream.jar" />
    
    <launch4j configFile="launch4j.xml" />
  </target>

  <target name="clean" description="clean up" >
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>