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

org.sitoolkit.wt.plugin.maven.Script2JavaMojo Maven / Gradle / Ivy

There is a newer version: 2.3
Show newest version
package org.sitoolkit.wt.plugin.maven;

import java.io.File;

import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.sitoolkit.wt.app.script2java.Script2Java;

/**
 */
@Mojo(name = "script2java", defaultPhase = LifecyclePhase.GENERATE_TEST_SOURCES)
public class Script2JavaMojo extends AbstractMojo {

	@Parameter(defaultValue = "${file.encoding}")
	private String testScriptCsvEncoding;

	@Parameter(defaultValue = "${project.build.directory}/generated-test-sources/test")
	private File outputDirectory;

	@Component
	private MavenProject project;

	@Override
	public void execute() throws MojoExecutionException {
		String outdir = outputDirectory.getAbsolutePath();
		Script2Java.staticExecute(outdir, testScriptCsvEncoding);
		project.addTestCompileSourceRoot(outdir);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy