Autogenerate .tar.bz2 with embedded version number. Misc formatting changes.

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2651 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
hanna 2010-01-21 18:32:46 +00:00
parent f51cffe220
commit ee421c106c
4 changed files with 60 additions and 45 deletions

View File

@ -6,7 +6,7 @@
<xsl:variable name="classpath" select="'${sting.dir}/staging:${additional.jars}'" /> <xsl:variable name="classpath" select="'${sting.dir}/staging:${additional.jars}'" />
<xsl:variable name="dist.dir" select="'${sting.dir}/dist'" /> <xsl:variable name="dist.dir" select="'${sting.dir}/dist'" />
<xsl:variable name="staging.dir" select="'${sting.dir}/staging'" /> <xsl:variable name="staging.dir" select="'${sting.dir}/staging'" />
<xsl:variable name="package.dir" select="'${package.dir}/'" /> <xsl:variable name="package.dir" select="'${package.dir}'" />
<xsl:variable name="resources.dir" select="'${package.dir}/resources'" /> <xsl:variable name="resources.dir" select="'${package.dir}/resources'" />
<xsl:template match="package"> <xsl:template match="package">
@ -16,7 +16,7 @@
<project name="{$project.name}" default="package"> <project name="{$project.name}" default="package">
<property name="sting.dir" value="{$ant.basedir}" /> <property name="sting.dir" value="{$ant.basedir}" />
<property name="package.dir" value="{concat($dist.dir,'/packages/',$project.name)}" /> <property name="package.dir" value="{$dist.dir}/packages/{$project.name}" />
<target name="package"> <target name="package">
<!-- Verify that all classes specified are present --> <!-- Verify that all classes specified are present -->
@ -24,9 +24,9 @@
<available property="is.{current()}.present" classpath="{$classpath}" classname="{current()}"/> <available property="is.{current()}.present" classpath="{$classpath}" classname="{current()}"/>
<fail message="Class {current()} not found" unless="is.{current()}.present" /> <fail message="Class {current()} not found" unless="is.{current()}.present" />
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="//properties"> <xsl:for-each select="//resource-bundle">
<available property="is.{current()}.present" file="{$staging.dir}/{current()}"/> <available property="is.{current()}.present" file="{$staging.dir}/{current()}"/>
<fail message="Property file {current()} not found" unless="is.{current()}.present" /> <fail message="Resource bundle {current()} not found" unless="is.{current()}.present" />
</xsl:for-each> </xsl:for-each>
<!-- Create an output directory for the package --> <!-- Create an output directory for the package -->
@ -36,7 +36,7 @@
<xsl:apply-templates select="executable" /> <xsl:apply-templates select="executable" />
<!-- Add in other modules --> <!-- Add in other modules -->
<xsl:for-each select="module"> <xsl:for-each select="modules/module">
<xsl:apply-templates select="document(current())/package/executable" /> <xsl:apply-templates select="document(current())/package/executable" />
</xsl:for-each> </xsl:for-each>
@ -53,9 +53,23 @@
<mkdir dir="{$resources.dir}"/> <mkdir dir="{$resources.dir}"/>
<xsl:call-template name="symlink"> <xsl:call-template name="symlink">
<xsl:with-param name="file.name" select="." /> <xsl:with-param name="file.name" select="." />
<xsl:with-param name="target.dir" select="concat($resources.dir,'/')" /> <xsl:with-param name="target.dir" select="$resources.dir" />
</xsl:call-template> </xsl:call-template>
</xsl:for-each> </xsl:for-each>
<!-- Bundle the package into a single zip file -->
<xsl:choose>
<xsl:when test="version">
<property file="{$staging.dir}/{version/@file}" />
<xsl:variable name="version.property" select="concat('${',version/@property,'}')" />
<property name="package.filename" value="{name}-{$version.property}.tar.bz2" />
</xsl:when>
<xsl:otherwise>
<property name="package.filename" value="{name}.tar.bz2" />
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="package.filename" select="'${package.filename}'" />
<tar destfile="{$dist.dir}/{$package.filename}" basedir="{$package.dir}" compression="bzip2" />
</target> </target>
</project> </project>
</xsl:template> </xsl:template>
@ -77,20 +91,21 @@
</xsl:variable> </xsl:variable>
<available property="is.{$short.name}.present" file="{$file.name}"/> <available property="is.{$short.name}.present" file="{$file.name}"/>
<fail message="File {$file.name} not found" unless="is.{$short.name}.present" /> <fail message="File {$file.name} not found" unless="is.{$short.name}.present" />
<delete file="{concat($target.dir,'/',$short.name)}" /> <delete file="{$target.dir}/{$short.name}" />
<symlink link="{concat($target.dir,'/',$short.name)}" resource="{$full.path}" overwrite="true" /> <symlink link="{$target.dir}/{$short.name}" resource="{$full.path}" overwrite="true" />
</xsl:template> </xsl:template>
<!-- Transform an executable tag into an ant 'jar' task with nested fileset -->
<xsl:template match="executable"> <xsl:template match="executable">
<!-- Create a jar file containing the specified classes / packages and all their dependencies --> <!-- Create a jar file containing the specified classes / packages and all their dependencies -->
<jar jarfile="{concat($package.dir,name,'.jar')}"> <jar jarfile="{$package.dir}/{name}.jar">
<classfileset dir="{$staging.dir}"> <classfileset dir="{$staging.dir}">
<root classname="{main-class}"/> <root classname="{main-class}"/>
</classfileset> </classfileset>
<xsl:for-each select="properties"> <xsl:for-each select="resource-bundle">
<fileset file="{$staging.dir}/{current()}" /> <fileset file="{$staging.dir}/{current()}" />
</xsl:for-each> </xsl:for-each>
<xsl:for-each select="module"> <xsl:for-each select="modules/module">
<xsl:apply-templates select="document(current())/package/executable/dependencies" /> <xsl:apply-templates select="document(current())/package/executable/dependencies" />
</xsl:for-each> </xsl:for-each>
<xsl:apply-templates select="dependencies" /> <xsl:apply-templates select="dependencies" />
@ -100,6 +115,7 @@
</jar> </jar>
</xsl:template> </xsl:template>
<!-- Transform a dependency list into a fileset for embedding in a jar -->
<xsl:template match="dependencies"> <xsl:template match="dependencies">
<classfileset dir="{$staging.dir}"> <classfileset dir="{$staging.dir}">
<xsl:for-each select="package"> <xsl:for-each select="package">

View File

@ -3,10 +3,12 @@
ant clean playground package -Dexecutable=GATK-GSA-Pipeline --> ant clean playground package -Dexecutable=GATK-GSA-Pipeline -->
<package> <package>
<name>GATK-GSA-Pipeline</name> <name>GATK-GSA-Pipeline</name>
<version file="StingText.properties" property="org.broadinstitute.sting.gatk.version" />
<executable> <executable>
<name>GATK-GSA-Pipeline</name> <name>GATK-GSA-Pipeline</name>
<main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class> <main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class>
<properties>StingText.properties</properties> <resource-bundle>StingText.properties</resource-bundle>
<modules>
<module>QualityScoresRecalibration.xml</module> <module>QualityScoresRecalibration.xml</module>
<module>LocalRealignmentAroundIndels.xml</module> <module>LocalRealignmentAroundIndels.xml</module>
<module>UnifiedGenotyper.xml</module> <module>UnifiedGenotyper.xml</module>
@ -14,6 +16,7 @@
<module>VariantAnnotator.xml</module> <module>VariantAnnotator.xml</module>
<module>VariantEval.xml</module> <module>VariantEval.xml</module>
<module>FindContaminatingReadGroups.xml</module> <module>FindContaminatingReadGroups.xml</module>
</modules>
<dependencies> <dependencies>
<!-- Filters --> <!-- Filters -->
<package>org.broadinstitute.sting.gatk.filters</package> <package>org.broadinstitute.sting.gatk.filters</package>

View File

@ -4,15 +4,18 @@
Remove the AnalyzeCovariates executable. --> Remove the AnalyzeCovariates executable. -->
<package> <package>
<name>GATK-Picard</name> <name>GATK-Picard</name>
<version file="StingText.properties" property="org.broadinstitute.sting.gatk.version" />
<executable> <executable>
<name>GATK-Picard</name> <name>GATK-Picard</name>
<main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class> <main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class>
<properties>StingText.properties</properties> <resource-bundle>StingText.properties</resource-bundle>
<modules>
<module>QualityScoresRecalibration.xml</module> <module>QualityScoresRecalibration.xml</module>
<module>LocalRealignmentAroundIndels.xml</module> <module>LocalRealignmentAroundIndels.xml</module>
<module>UnifiedGenotyper.xml</module> <module>UnifiedGenotyper.xml</module>
<module>VariantFiltration.xml</module> <module>VariantFiltration.xml</module>
<module>VariantAnnotator.xml</module> <module>VariantAnnotator.xml</module>
</modules>
<dependencies> <dependencies>
<!-- Filters --> <!-- Filters -->
<package>org.broadinstitute.sting.gatk.filters</package> <package>org.broadinstitute.sting.gatk.filters</package>

View File

@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<package> <package>
<name>GenomeAnalysisTK</name> <name>GenomeAnalysisTK</name>
<version file="StingText.properties" property="org.broadinstitute.sting.gatk.version" />
<executable> <executable>
<name>GenomeAnalysisTK</name> <name>GenomeAnalysisTK</name>
<main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class> <main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class>
<properties>StingText.properties</properties> <resource-bundle>StingText.properties</resource-bundle>
<modules>
<module>QualityScoresRecalibration.xml</module> <module>QualityScoresRecalibration.xml</module>
<module>LocalRealignmentAroundIndels.xml</module> <module>LocalRealignmentAroundIndels.xml</module>
<module>UnifiedGenotyper.xml</module> <module>UnifiedGenotyper.xml</module>
<module>VariantFiltration.xml</module> <module>VariantFiltration.xml</module>
<module>VariantAnnotator.xml</module> <module>VariantAnnotator.xml</module>
<module>VCFValidator.xml</module> <module>VCFValidator.xml</module>
</modules>
<dependencies> <dependencies>
<!-- Filters --> <!-- Filters -->
<package>org.broadinstitute.sting.gatk.filters</package> <package>org.broadinstitute.sting.gatk.filters</package>
@ -23,19 +26,9 @@
<class>org.broadinstitute.sting.gatk.walkers.qc.ValidatingPileupWalker</class> <class>org.broadinstitute.sting.gatk.walkers.qc.ValidatingPileupWalker</class>
</dependencies> </dependencies>
</executable> </executable>
<executable> <modules>
<name>AnalyzeCovariates</name> <module>AnalyzeCovariates.xml</module>
<main-class>org.broadinstitute.sting.analyzecovariates.AnalyzeCovariates</main-class> </modules>
<dependencies>
<!-- Recalibration analysis script -->
<class>org.broadinstitute.sting.analyzecovariates.AnalyzeCovariates</class>
<class>org.broadinstitute.sting.gatk.walkers.recalibration.DinucCovariate</class>
<class>org.broadinstitute.sting.gatk.walkers.recalibration.QualityScoreCovariate</class>
<class>org.broadinstitute.sting.gatk.walkers.recalibration.CycleCovariate</class>
<class>org.broadinstitute.sting.gatk.walkers.recalibration.ReadGroupCovariate</class>
<class>org.broadinstitute.sting.gatk.walkers.recalibration.TileCovariate</class>
</dependencies>
</executable>
<resources> <resources>
<!-- GATK sample code and build scripts --> <!-- GATK sample code and build scripts -->
<file>java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java</file> <file>java/src/org/broadinstitute/sting/gatk/walkers/coverage/DepthOfCoverageWalker.java</file>