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

com.xlrit.gears.runner.ExportMojo Maven / Gradle / Ivy

There is a newer version: 1.18.0
Show newest version
package com.xlrit.gears.runner;

import com.xlrit.gears.runner.driver.Config;
import com.xlrit.gears.runner.driver.Driver;
import com.xlrit.gears.runner.driver.ExportConfig;
import com.xlrit.gears.runner.driver.ExportDriver;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;

@Mojo(name = "export", defaultPhase = LifecyclePhase.VERIFY, requiresProject = false)
public class ExportMojo extends RunnerMojo {

	@Parameter(property = "gears.runner.resultDir")
	public String resultDir = "target/exported-files";

	@Parameter(property = "gears.runner.target")
	public String exportTarget = "json";

	@Parameter(property = "gears.runner.writeResult")
	public Boolean writeResult = false;

	@Parameter(property = "gears.runner.quiet")
	public Boolean quiet = false;

	@Override
	protected Config getConfig() {
		ExportConfig config = new ExportConfig();
		if (resultDir != null) config.resultDir = resultDir;
		if (exportTarget != null) config.exportTarget = exportTarget;
		if (writeResult != null) config.writeResult = writeResult;
		if (quiet != null) config.quiet = quiet;
		return config;
	}

	@Override @SuppressWarnings("rawtypes")
	protected Driver getDriver() {
		return new ExportDriver();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy