All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jlgrock.javascriptframework.jsdocs.JsDocsMojo Maven / Gradle / Ivy

package com.github.jlgrock.javascriptframework.jsdocs;

import java.io.File;
import java.util.List;
import java.util.Set;

import org.apache.log4j.Logger;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;

import com.github.jlgrock.javascriptframework.mavenutils.logging.MojoLogAppender;

/**
 * Generates javascript docs from the jsdoc-toolkit (the final version).
 * 
 * @goal jsdoc
 * 
 */
public class JsDocsMojo extends AbstractJsDocsNonAggMojo {
	/**
	 * Logger.
	 */
	private static final Logger LOGGER = Logger.getLogger(JsDocsMojo.class);

	/**
	 * Specifies the destination directory where javadoc saves the generated
	 * HTML files. 
* See d.
* * @parameter expression="${destDir}" * default-value="${project.build.directory}/apidocs" * @required */ private File outputDirectory; @Override public final File getOutputDirectory() { return outputDirectory; } @Override public final String getClassifier() { return "jsdocs"; } @Override public final void execute() throws MojoExecutionException, MojoFailureException { LOGGER.debug("starting report execution..."); MojoLogAppender.beginLogging(this); try { ReportGenerator.extractJSDocToolkit(getToolkitExtractDirectory()); Set sourceFiles = getSourceFiles(); List args = createArgumentStack(sourceFiles); ReportGenerator.executeJSDocToolkit(getJsDocAppLocation(), args, getToolkitExtractDirectory()); } catch (Exception e) { LOGGER.error("There was an error in the execution of the report: " + e.getMessage(), e); throw new MojoExecutionException(e.getMessage(), e); } finally { MojoLogAppender.endLogging(); } } @Override public final File getArchiveOutputDirectory() { return null; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy