Added version numbers to the help doclet extractor. Since the help system is behaving
more like a resource bundle at this point, changed it over to use the Java ResourceBundle support classes. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2606 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
4de7d6a59b
commit
420cef4094
|
|
@ -6,7 +6,7 @@
|
||||||
<property name="source.dir" value="java/src" />
|
<property name="source.dir" value="java/src" />
|
||||||
<property name="build.dir" value="build" />
|
<property name="build.dir" value="build" />
|
||||||
<property name="dist.dir" value="dist" />
|
<property name="dist.dir" value="dist" />
|
||||||
<property name="help.file" value="${build.dir}/help.properties" />
|
<property name="resource.file" value="StingText.properties" />
|
||||||
|
|
||||||
<property name="single" value="*Test" />
|
<property name="single" value="*Test" />
|
||||||
<property name="singleintegration" value="*IntegrationTest" />
|
<property name="singleintegration" value="*IntegrationTest" />
|
||||||
|
|
@ -99,10 +99,10 @@
|
||||||
<target name="extracthelp" depends="compile"
|
<target name="extracthelp" depends="compile"
|
||||||
description="Extract help key/value pair file from the JavaDoc tags."
|
description="Extract help key/value pair file from the JavaDoc tags."
|
||||||
unless="disable.help">
|
unless="disable.help">
|
||||||
<javadoc doclet="org.broadinstitute.sting.utils.help.HelpExtractorDoclet"
|
<javadoc doclet="org.broadinstitute.sting.utils.help.ResourceBundleExtractorDoclet"
|
||||||
docletpath="build"
|
docletpath="build"
|
||||||
classpathref="runtime.dependencies"
|
classpathref="runtime.dependencies"
|
||||||
additionalparam="-out ${help.file}">
|
additionalparam="-out ${build.dir}/${resource.file}">
|
||||||
<packageset refid="source.files"/>
|
<packageset refid="source.files"/>
|
||||||
</javadoc>
|
</javadoc>
|
||||||
</target>
|
</target>
|
||||||
|
|
@ -124,7 +124,7 @@
|
||||||
|
|
||||||
<jar jarfile="${dist.dir}/GenomeAnalysisTK.jar">
|
<jar jarfile="${dist.dir}/GenomeAnalysisTK.jar">
|
||||||
<fileset dir="build">
|
<fileset dir="build">
|
||||||
<include name="help.properties" />
|
<include name="${resource.file}" />
|
||||||
<include name="**/gatk/**/*.class" />
|
<include name="**/gatk/**/*.class" />
|
||||||
<include name="**/alignment/**/*.class"/>
|
<include name="**/alignment/**/*.class"/>
|
||||||
<include name="**/oneoffprojects/**/*.class" />
|
<include name="**/oneoffprojects/**/*.class" />
|
||||||
|
|
|
||||||
|
|
@ -58,19 +58,11 @@ public class WalkerManager extends PluginManager<Walker> {
|
||||||
/**
|
/**
|
||||||
* A collection of help text for walkers and their enclosing packages.
|
* A collection of help text for walkers and their enclosing packages.
|
||||||
*/
|
*/
|
||||||
private Properties helpText = new Properties();
|
private ResourceBundle helpText;
|
||||||
|
|
||||||
public WalkerManager() {
|
public WalkerManager() {
|
||||||
super(Walker.class,"walker","Walker");
|
super(Walker.class,"walker","Walker");
|
||||||
InputStream helpSourceFile = getClass().getClassLoader().getResourceAsStream("help.properties");
|
helpText = ResourceBundle.getBundle("StingText");
|
||||||
if(helpSourceFile != null) {
|
|
||||||
try {
|
|
||||||
helpText.load(helpSourceFile);
|
|
||||||
}
|
|
||||||
catch(IOException ex) {
|
|
||||||
throw new StingException("Unable to process help data");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -100,7 +92,7 @@ public class WalkerManager extends PluginManager<Walker> {
|
||||||
String displayNameKey = String.format("%s.%s",packageName,DisplayNameTaglet.NAME);
|
String displayNameKey = String.format("%s.%s",packageName,DisplayNameTaglet.NAME);
|
||||||
String displayName = null;
|
String displayName = null;
|
||||||
if(helpText.containsKey(displayNameKey)) {
|
if(helpText.containsKey(displayNameKey)) {
|
||||||
displayName = helpText.getProperty(displayNameKey);
|
displayName = helpText.getString(displayNameKey);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// If no override exists...
|
// If no override exists...
|
||||||
|
|
@ -121,7 +113,7 @@ public class WalkerManager extends PluginManager<Walker> {
|
||||||
String key = String.format("%s.%s",packageName,SummaryTaglet.NAME);
|
String key = String.format("%s.%s",packageName,SummaryTaglet.NAME);
|
||||||
if(!helpText.containsKey(key))
|
if(!helpText.containsKey(key))
|
||||||
return "";
|
return "";
|
||||||
return helpText.getProperty(key);
|
return helpText.getString(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -133,7 +125,7 @@ public class WalkerManager extends PluginManager<Walker> {
|
||||||
String walkerSummary = String.format("%s.%s",walkerType.getName(), SummaryTaglet.NAME);
|
String walkerSummary = String.format("%s.%s",walkerType.getName(), SummaryTaglet.NAME);
|
||||||
if(!helpText.containsKey(walkerSummary))
|
if(!helpText.containsKey(walkerSummary))
|
||||||
return "";
|
return "";
|
||||||
return helpText.getProperty(walkerSummary);
|
return helpText.getString(walkerSummary);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -145,7 +137,7 @@ public class WalkerManager extends PluginManager<Walker> {
|
||||||
String walkerDescription = String.format("%s.%s",walkerType.getName(), DescriptionTaglet.NAME);
|
String walkerDescription = String.format("%s.%s",walkerType.getName(), DescriptionTaglet.NAME);
|
||||||
if(!helpText.containsKey(walkerDescription))
|
if(!helpText.containsKey(walkerDescription))
|
||||||
return "";
|
return "";
|
||||||
return helpText.getProperty(walkerDescription);
|
return helpText.getString(walkerDescription);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,12 @@ import org.broadinstitute.sting.utils.StingException;
|
||||||
* @author mhanna
|
* @author mhanna
|
||||||
* @version 0.1
|
* @version 0.1
|
||||||
*/
|
*/
|
||||||
public class HelpExtractorDoclet {
|
public class ResourceBundleExtractorDoclet {
|
||||||
|
/**
|
||||||
|
* Taglet for the particular version number.
|
||||||
|
*/
|
||||||
|
private static final String VERSION_TAGLET_NAME = "version";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Extracts the contents of certain types of javadoc and adds them to an XML file.
|
* Extracts the contents of certain types of javadoc and adds them to an XML file.
|
||||||
* @param rootDoc The documentation root.
|
* @param rootDoc The documentation root.
|
||||||
|
|
@ -72,6 +77,7 @@ public class HelpExtractorDoclet {
|
||||||
private static void renderHelpText(String elementName, Doc element, PrintStream out) {
|
private static void renderHelpText(String elementName, Doc element, PrintStream out) {
|
||||||
// Extract overrides from the doc tags.
|
// Extract overrides from the doc tags.
|
||||||
String name = null;
|
String name = null;
|
||||||
|
String version = null;
|
||||||
StringBuilder summaryBuilder = new StringBuilder();
|
StringBuilder summaryBuilder = new StringBuilder();
|
||||||
for(Tag tag: element.firstSentenceTags())
|
for(Tag tag: element.firstSentenceTags())
|
||||||
summaryBuilder.append(tag.text());
|
summaryBuilder.append(tag.text());
|
||||||
|
|
@ -84,6 +90,8 @@ public class HelpExtractorDoclet {
|
||||||
throw new StingException("Only one display name tag can be used per package / walker.");
|
throw new StingException("Only one display name tag can be used per package / walker.");
|
||||||
name = tag.text();
|
name = tag.text();
|
||||||
}
|
}
|
||||||
|
else if(tag.name().equals("@"+VERSION_TAGLET_NAME))
|
||||||
|
version = tag.text();
|
||||||
else if(tag.name().equals("@"+SummaryTaglet.NAME))
|
else if(tag.name().equals("@"+SummaryTaglet.NAME))
|
||||||
summary = tag.text();
|
summary = tag.text();
|
||||||
else if(tag.name().equals("@"+DescriptionTaglet.NAME))
|
else if(tag.name().equals("@"+DescriptionTaglet.NAME))
|
||||||
|
|
@ -94,6 +102,9 @@ public class HelpExtractorDoclet {
|
||||||
if(name != null)
|
if(name != null)
|
||||||
out.printf("%s.%s=%s%n",elementName,DisplayNameTaglet.NAME,name);
|
out.printf("%s.%s=%s%n",elementName,DisplayNameTaglet.NAME,name);
|
||||||
|
|
||||||
|
if(version != null)
|
||||||
|
out.printf("%s.%s=%s%n",elementName,VERSION_TAGLET_NAME,version);
|
||||||
|
|
||||||
// Write out an alternate element summary, if exists.
|
// Write out an alternate element summary, if exists.
|
||||||
out.printf("%s.%s=%s%n",elementName,SummaryTaglet.NAME,formatText(summary));
|
out.printf("%s.%s=%s%n",elementName,SummaryTaglet.NAME,formatText(summary));
|
||||||
|
|
||||||
|
|
@ -24,6 +24,10 @@
|
||||||
<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">
|
||||||
|
<available property="is.{current()}.present" file="{$staging.dir}/{current()}"/>
|
||||||
|
<fail message="Property file {current()} not found" unless="is.{current()}.present" />
|
||||||
|
</xsl:for-each>
|
||||||
|
|
||||||
<!-- Create an output directory for the package -->
|
<!-- Create an output directory for the package -->
|
||||||
<mkdir dir="{$package.dir}"/>
|
<mkdir dir="{$package.dir}"/>
|
||||||
|
|
@ -40,8 +44,11 @@
|
||||||
<root classname="{current()}" />
|
<root classname="{current()}" />
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
</classfileset>
|
</classfileset>
|
||||||
|
<xsl:for-each select="dependencies/properties">
|
||||||
|
<fileset file="{$staging.dir}/{current()}" />
|
||||||
|
</xsl:for-each>
|
||||||
<xsl:for-each select="dependencies/file">
|
<xsl:for-each select="dependencies/file">
|
||||||
<fileset file="{current()}" />
|
<fileset file="{$staging.dir}/{current()}" />
|
||||||
</xsl:for-each>
|
</xsl:for-each>
|
||||||
<manifest>
|
<manifest>
|
||||||
<attribute name="Main-Class" value="{main-class}"/>
|
<attribute name="Main-Class" value="{main-class}"/>
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@
|
||||||
<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>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- Text extracted from the javadocs -->
|
||||||
|
<properties>StingText.properties</properties>
|
||||||
|
<!-- The walker -->
|
||||||
<class>org.broadinstitute.sting.gatk.walkers.FixBAMSortOrderTag</class>
|
<class>org.broadinstitute.sting.gatk.walkers.FixBAMSortOrderTag</class>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</executable>
|
</executable>
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,9 @@
|
||||||
<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>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- Text extracted from the javadocs -->
|
||||||
|
<properties>StingText.properties</properties>
|
||||||
|
<!-- Filters -->
|
||||||
<package>org.broadinstitute.sting.gatk.filters</package>
|
<package>org.broadinstitute.sting.gatk.filters</package>
|
||||||
<!-- Quality scores recalibration -->
|
<!-- Quality scores recalibration -->
|
||||||
<class>org.broadinstitute.sting.gatk.walkers.recalibration.CovariateCounterWalker</class>
|
<class>org.broadinstitute.sting.gatk.walkers.recalibration.CovariateCounterWalker</class>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@
|
||||||
<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>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- Text extracted from the javadocs -->
|
||||||
|
<properties>StingText.properties</properties>
|
||||||
|
<!-- Filters -->
|
||||||
<package>org.broadinstitute.sting.gatk.filters</package>
|
<package>org.broadinstitute.sting.gatk.filters</package>
|
||||||
<class>org.broadinstitute.sting.gatk.walkers.coverage.DepthOfCoverageWalker</class>
|
<class>org.broadinstitute.sting.gatk.walkers.coverage.DepthOfCoverageWalker</class>
|
||||||
<class>org.broadinstitute.sting.gatk.walkers.PileupWalker</class>
|
<class>org.broadinstitute.sting.gatk.walkers.PileupWalker</class>
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,11 @@
|
||||||
<name>GenomeAnalysisTK</name>
|
<name>GenomeAnalysisTK</name>
|
||||||
<main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class>
|
<main-class>org.broadinstitute.sting.gatk.CommandLineGATK</main-class>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<!-- Text extracted from the javadocs -->
|
||||||
|
<properties>StingText.properties</properties>
|
||||||
|
<!-- Filters -->
|
||||||
<package>org.broadinstitute.sting.gatk.filters</package>
|
<package>org.broadinstitute.sting.gatk.filters</package>
|
||||||
|
<!-- Basic qc walkers -->
|
||||||
<class>org.broadinstitute.sting.gatk.walkers.coverage.DepthOfCoverageWalker</class>
|
<class>org.broadinstitute.sting.gatk.walkers.coverage.DepthOfCoverageWalker</class>
|
||||||
<class>org.broadinstitute.sting.gatk.walkers.PileupWalker</class>
|
<class>org.broadinstitute.sting.gatk.walkers.PileupWalker</class>
|
||||||
<class>org.broadinstitute.sting.gatk.walkers.PrintReadsWalker</class>
|
<class>org.broadinstitute.sting.gatk.walkers.PrintReadsWalker</class>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue