gatk-3.8/build.xml

163 lines
5.3 KiB
XML
Raw Normal View History

<project name="Sting" default="dist" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>Compile and distribute the Sting toolkit</description>
<!-- Set target based on STING_BUILD_TYPE environment variable -->
<property environment="env" />
<condition property="target" value="playground" else="core">
<equals arg1="${env.STING_BUILD_TYPE}" arg2="playground" casesensitive="false" />
</condition>
<condition property="target.is.playground" value="true">
<equals arg1="${target}" arg2="playground" />
</condition>
<!-- set global properties for this build -->
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<property name="javadoc" location="javadoc" />
<path id="thirdparty.dependencies">
<fileset dir="${lib}" includes="*.jar" />
</path>
<path id="core.classpath">
<path refid="thirdparty.dependencies" />
</path>
<path id="playground.classpath">
<path refid="thirdparty.dependencies" />
<fileset dir="${build}" includes="**/*.class" />
</path>
<path id="core.srcdir">
<dirset dir="core/java/src"/>
</path>
<path id="playground.srcdir">
<path refid="core.srcdir" />
<dirset dir="playground/java/src" />
</path>
<!-- ivy properties -->
<property name="ivy.install.version" value="2.0.0" />
<property name="ivy.home" value="${user.home}/.ant" />
<property name="ivy.jar.dir" value="${ivy.home}/lib" />
<property name="ivy.jar.file" value="ivy-${ivy.install.version}.jar" />
<property name="ivy.settings.dir" value="settings" />
<property file="${ivy.settings.dir}/ivysettings.properties" />
<target name="resolve" depends="init"
description="locate and download library dependencies">
<!-- retrieve ivy if necessary -->
<mkdir dir="${ivy.jar.dir}" />
<get src="http://repo1.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/${ivy.jar.file}"
dest="${ivy.jar.dir}/${ivy.jar.file}"
usetimestamp="true"/>
<!-- initialize and load ivy -->
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant"
classpath="${ivy.jar.dir}/${ivy.jar.file}" />
<ivy:settings file="${ivy.settings.dir}/ivysettings.xml" />
<!-- retrieve dependencies -->
<ivy:retrieve />
</target>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<echo message="Compiling module ${target}" />
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init,resolve"
description="compile the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac destdir="${build}" classpathref="${target}.classpath"
debug="true" debuglevel="lines,vars,source">
<src refid="${target}.srcdir" />
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<mkdir dir="${dist}"/>
<copy todir="${dist}">
<fileset dir="${lib}" includes="*.jar" />
</copy>
<jar jarfile="${dist}/StingUtils.jar">
<fileset dir="${build}" includes="org/broadinstitute/sting/utils/**" />
</jar>
<jar jarfile="${dist}/GenomeAnalysisTK.jar">
<fileset dir="${build}" includes="org/broadinstitute/sting/gatk/**" />
<manifest>
<attribute name="Main-Class" value="org.broadinstitute.sting.gatk.GenomeAnalysisTK" />
</manifest>
</jar>
<!-- Call special distribution methods for the playground. Will not run if target isn't playground -->
<antcall target="dist.playground"/>
<pathconvert property="jar.classpath" pathsep=" ">
<flattenmapper />
<fileset dir="${dist}" includes="*.jar" />
</pathconvert>
<jar jarfile="${dist}/StingUtils.jar" update="true">
<manifest>
<attribute name="Class-Path" value="${jar.classpath}" />
</manifest>
</jar>
<jar jarfile="${dist}/GenomeAnalysisTK.jar" update="true">
<manifest>
<attribute name="Class-Path" value="${jar.classpath}" />
</manifest>
</jar>
<jar jarfile="${dist}/FourBaseCaller.jar" basedir="${build}">
<manifest>
<attribute name="Class-Path" value="${jar.classpath}" />
<attribute name="Main-Class" value="org.broadinstitute.sting.projects.fourbasecaller.FourBaseCaller" />
</manifest>
</jar>
</target>
<target name="dist.playground" if="target.is.playground">
<jar jarfile="${dist}/Playground.jar">
<fileset dir="${build}">
<exclude name="org/broadinstitute/sting/utils/**" />
<exclude name="org/broadinstitute/sting/gatk/**" />
</fileset>
</jar>
<pathconvert property="jar.classpath" pathsep=" ">
<flattenmapper />
<fileset dir="${dist}" includes="*.jar" />
</pathconvert>
<jar jarfile="${dist}/Playground.jar" update="true">
<manifest>
<attribute name="Class-Path" value="${jar.classpath}" />
</manifest>
</jar>
</target>
<target name="javadoc">
<mkdir dir="${javadoc}" />
<javadoc sourcepathref="${target}.srcdir" destdir="${javadoc}" />
</target>
<target name="clean"
description="clean up" >
<delete dir="${build}"/>
<delete dir="${dist}"/>
<delete dir="${lib}" />
</target>
</project>