Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package org.broadinstitute.hellbender.utils.help;
import freemarker.template.Configuration;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import org.apache.commons.io.FilenameUtils;
import org.broadinstitute.barclay.help.*;
import java.io.*;
import java.util.List;
import java.util.Map;
/**
* Custom Barclay-based Javadoc Doclet used for generating tool WDL.
*
* NOTE: Methods in this class are intended to be called by Gradle/Javadoc only, and should not be called
* by methods that are used by the GATK runtime. This class has a dependency on com.sun.javadoc classes,
* which may not be present since they're not provided as part of the normal GATK runtime classpath.
*/
@SuppressWarnings("removal")
public class GATKWDLDoclet extends WDLDoclet {
// emit an index file with links to all of the .wdl files
private final static String GATK_FREEMARKER_INDEX_TEMPLATE_NAME = "wdlIndexTemplate.html.ftl";
// the directory where the wdlgen build is running
public final static String OPT_BUILD_DIR = "-build-dir";
private String buildDir;
/**
* Validates the given options against options supported by this doclet.
*
* @param option Option to validate.
* @return Number of potential parameters; 0 if not supported.
*/
public static int optionLength(final String option) {
// Any arguments used for the doclet need to be recognized here. Many javadoc plugins (ie. gradle)
// automatically add some such as "-doctitle", "-windowtitle", which we ignore.
if (option.equals(OPT_BUILD_DIR)) {
return 2;
}
return WDLDoclet.optionLength(option);
}
@Override
protected boolean parseOption(final String[] option) {
if (option[0].equals(OPT_BUILD_DIR)) {
buildDir = option[1];
return true;
} else {
return super.parseOption(option);
}
}
/**
* Create a WDL doclet and generate the FreeMarker templates properties.
* @param rootDoc
* @throws IOException
*/
public static boolean start(final com.sun.javadoc.RootDoc rootDoc) throws IOException {
return new GATKWDLDoclet().startProcessDocs(rootDoc);
}
/**
* @return the location where the build is running; used in the cromwell validation tests to generate a dummy
* input file to satisfy cromwell file localization
*/
public String getBuildDir() { return buildDir; }
/**
* Return the name of the freemarker template to be used for the index generated by Barclay.
* For WDL gen, we create an index file that links to each of the generated WDL files.
* Must reside in the folder passed to the Barclay Javadc Doclet via the "-settings-dir" parameter.
* @return name of freemarker index template
*/
@Override
public String getIndexTemplateName() {
return GATK_FREEMARKER_INDEX_TEMPLATE_NAME;
}
/**
* @return Create and return a DocWorkUnit-derived object to handle documentation
* for the target feature(s) represented by documentedFeature.
*
* @param documentedFeature DocumentedFeature annotation for the target feature
* @param classDoc javadoc classDoc for the target feature
* @param clazz class of the target feature
* @return DocWorkUnit to be used for this feature
*/
@Override
protected DocWorkUnit createWorkUnit(
final DocumentedFeature documentedFeature,
final com.sun.javadoc.ClassDoc classDoc,
final Class clazz)
{
return includeInDocs(documentedFeature, classDoc, clazz) ?
// for WDL we don't need to customize the work unit, only the handler, so just use the
// Barclay default WorkUnit class
new DocWorkUnit(
new GATKWDLWorkUnitHandler(this),
documentedFeature,
classDoc,
clazz) :
null;
}
@Override
protected void processWorkUnitTemplate(
final Configuration cfg,
final DocWorkUnit workUnit,
final List