Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package apparat.embedding.maven;
 
 import  apparat.tools.tdsi.TDSIConfiguration;
 import  apparat.tools.tdsi.TurboDieselSportInjection;
 import  org.apache.maven.plugin.MojoExecutionException;
 import  org.apache.maven.plugin.MojoFailureException;
 import  scala.collection.immutable.List;
 
 import  java.io.File;

Author(s):
Joa Ebert
Phase:
package
Goal:
tdsi
ThreadSafe:
public final class TurboDieselSportInjectionMojo extends AbstractApparatMojo {
Whether or not to expand Alchemy instructions.

Parameter:
default-value="true" expression="${apparat.tdsi.alchemyExpansion}
Required:
	private boolean alchemyExpansion;

Whether or not to perform macro expansion.

Parameter:
default-value="true" expression="${apparat.tdsi.macroExpansion}
Required:
	private boolean macroExpansion;

Whether or not to perform inline expansion.

Parameter:
default-value="true" expression="${apparat.tdsi.inlineExpansion}
Required:
	private boolean inlineExpansion;

Whether or not to fix bytecode generated by Alchemy.

Parameter:
default-value="false" expression="${apparat.tdsi.fixAlchemy}
Required:
	private boolean fixAlchemy;

Whether or not to perform ASM expansion.

Parameter:
default-value="true" expression="${apparat.tdsi.asmExpansion}
Required:
	private boolean asmExpansion;
	@Override public void execute() throws MojoExecutionException, MojoFailureException {
		if(!alchemyExpansion && !macroExpansion && !inlineExpansion && !fixAlchemy && !asmExpansion) {
			getLog().warn("TurboDieselSportInjection has been disabled since all its " +
					"features are turned off.");
			return;
		}
		//TODO add support for external libraries here (ask velo about it :>)
		super.execute();
	}
	@Override protected void processFile(final File file) {
		if(getLog().isDebugEnabled()) {
			getLog().debug("Running "+file+" through TurboDieselSportInjection ...");
		}
		final TurboDieselSportInjection.TDSITool tool = new TurboDieselSportInjection.TDSITool();
		final TDSIConfiguration config = new TDSIConfiguration() {
			@Override public File input() { return file; }
			@Override public File output() { return file;}
			@Override public boolean alchemyExpansion() { return alchemyExpansion; }
			@Override public boolean macroExpansion() { return macroExpansion; }
			@Override public boolean inlineExpansion() { return inlineExpansion; }
			@Override public boolean fixAlchemy() { return fixAlchemy; }
			@Override public boolean asmExpansion() { return asmExpansion; }
			@Override public List<File> externalLibraries() { return List.empty(); }
		};
		tool.configure(config);
		tool.run();
	}
New to GrepCode? Check out our FAQ X