
org.stjs.maven.TestSTJSMojo Maven / Gradle / Ivy
package org.stjs.maven;
import java.io.File;
import java.util.List;
import org.apache.maven.artifact.DependencyResolutionRequiredException;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
/**
*
* @goal generate-test
* @phase process-test-classes
* @requiresDependencyResolution test
* @author acraciun
*
*/
public class TestSTJSMojo extends AbstractSTJSMojo {
private static final String MAVEN_TEST_SKIP = "maven.test.skip";
/**
* The source directories containing the sources to be compiled.
*
* @parameter default-value="${project.testCompileSourceRoots}"
* @required
*/
private List compileSourceRoots;
/**
*
* Specify where to place generated source files
*
*
* @parameter default-value="${project.build.directory}/generated-test-js"
*/
private File generatedTestSourcesDirectory;
/**
* @parameter default-value="${project.build.testOutputDirectory}"
*/
private File buildOutputDirectory;
@Override
protected List getCompileSourceRoots() {
return compileSourceRoots;
}
@Override
protected File getGeneratedSourcesDirectory() {
return generatedTestSourcesDirectory;
}
@SuppressWarnings("unchecked")
@Override
protected List getClasspathElements() throws DependencyResolutionRequiredException {
return project.getTestClasspathElements();
}
@Override
protected File getBuildOutputDirectory() {
return buildOutputDirectory;
}
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if ("true".equals(System.getProperty(MAVEN_TEST_SKIP))) {
getLog().info("Tests are skipped, so javascript generation for tests is also skipped");
} else {
super.execute();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy