Add the svn version on the fly to the version number properties.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@2607 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
420cef4094
commit
ac4756db20
|
|
@ -99,10 +99,13 @@
|
||||||
<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">
|
||||||
|
<exec executable="svnversion" outputproperty="svn.version" failonerror="true">
|
||||||
|
<arg value="--no-newline" />
|
||||||
|
</exec>
|
||||||
<javadoc doclet="org.broadinstitute.sting.utils.help.ResourceBundleExtractorDoclet"
|
<javadoc doclet="org.broadinstitute.sting.utils.help.ResourceBundleExtractorDoclet"
|
||||||
docletpath="build"
|
docletpath="build"
|
||||||
classpathref="runtime.dependencies"
|
classpathref="runtime.dependencies"
|
||||||
additionalparam="-out ${build.dir}/${resource.file}">
|
additionalparam="-version-suffix .${svn.version} -out ${build.dir}/${resource.file}">
|
||||||
<packageset refid="source.files"/>
|
<packageset refid="source.files"/>
|
||||||
</javadoc>
|
</javadoc>
|
||||||
</target>
|
</target>
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,15 @@ public class ResourceBundleExtractorDoclet {
|
||||||
*/
|
*/
|
||||||
public static boolean start(RootDoc rootDoc) throws FileNotFoundException {
|
public static boolean start(RootDoc rootDoc) throws FileNotFoundException {
|
||||||
PrintStream out = System.out;
|
PrintStream out = System.out;
|
||||||
|
String versionPrefix = null, versionSuffix = null;
|
||||||
|
|
||||||
for(String[] options: rootDoc.options()) {
|
for(String[] options: rootDoc.options()) {
|
||||||
if(options[0].equals("-out"))
|
if(options[0].equals("-out"))
|
||||||
out = new PrintStream(options[1]);
|
out = new PrintStream(options[1]);
|
||||||
|
if(options[0].equals("-version-prefix"))
|
||||||
|
versionPrefix = options[1];
|
||||||
|
if(options[0].equals("-version-suffix"))
|
||||||
|
versionSuffix = options[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cache packages as we see them, since there's no direct way to iterate over packages.
|
// Cache packages as we see them, since there's no direct way to iterate over packages.
|
||||||
|
|
@ -47,11 +52,11 @@ public class ResourceBundleExtractorDoclet {
|
||||||
String.format("%s.%s",containingPackage.name(),currentClass.name()) :
|
String.format("%s.%s",containingPackage.name(),currentClass.name()) :
|
||||||
String.format("%s",currentClass.name());
|
String.format("%s",currentClass.name());
|
||||||
|
|
||||||
renderHelpText(className,currentClass,out);
|
renderHelpText(className,currentClass,out,versionPrefix,versionSuffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(PackageDoc currentPackage: packages)
|
for(PackageDoc currentPackage: packages)
|
||||||
renderHelpText(currentPackage.name(),currentPackage,out);
|
renderHelpText(currentPackage.name(),currentPackage,out,versionPrefix,versionSuffix);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -62,7 +67,7 @@ public class ResourceBundleExtractorDoclet {
|
||||||
* @return Number of potential parameters; 0 if not supported.
|
* @return Number of potential parameters; 0 if not supported.
|
||||||
*/
|
*/
|
||||||
public static int optionLength(String option) {
|
public static int optionLength(String option) {
|
||||||
if(option.equals("-out")) {
|
if(option.equals("-out") || option.equals("-version-prefix") || option.equals("-version-suffix")) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -73,8 +78,9 @@ public class ResourceBundleExtractorDoclet {
|
||||||
* @param elementName element name to use as the key
|
* @param elementName element name to use as the key
|
||||||
* @param element Doc element to process.
|
* @param element Doc element to process.
|
||||||
* @param out Output stream to which to write.
|
* @param out Output stream to which to write.
|
||||||
|
* @param versionSuffix Text to add to the end of the version string.
|
||||||
*/
|
*/
|
||||||
private static void renderHelpText(String elementName, Doc element, PrintStream out) {
|
private static void renderHelpText(String elementName, Doc element, PrintStream out, String versionPrefix, String versionSuffix) {
|
||||||
// Extract overrides from the doc tags.
|
// Extract overrides from the doc tags.
|
||||||
String name = null;
|
String name = null;
|
||||||
String version = null;
|
String version = null;
|
||||||
|
|
@ -91,7 +97,9 @@ public class ResourceBundleExtractorDoclet {
|
||||||
name = tag.text();
|
name = tag.text();
|
||||||
}
|
}
|
||||||
else if(tag.name().equals("@"+VERSION_TAGLET_NAME))
|
else if(tag.name().equals("@"+VERSION_TAGLET_NAME))
|
||||||
version = tag.text();
|
version = String.format("%s%s%s", (versionPrefix != null) ? versionPrefix : "",
|
||||||
|
tag.text(),
|
||||||
|
(versionSuffix != null) ? versionSuffix : "");
|
||||||
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))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue