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

com.pyx4me.maven.j2me.PreprocessMojo Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
/**
 * Pyx4me framework
 * Copyright (C) 2006-2007 pyx4.com.
 * 
 * @author vlads
 * @version $Id: PreprocessMojo.java 113 2007-04-21 04:57:04Z vlads $
 */
package com.pyx4me.maven.j2me;
//
//import java.io.File;
//import java.util.Iterator;
//import java.util.List;
//import java.util.Vector;
//
//import net.sf.jour.PreProcessor;
//
//import org.apache.maven.artifact.Artifact;
//import org.apache.maven.plugin.MojoExecutionException;
//import org.apache.maven.plugin.MojoFailureException;
//import org.apache.tools.ant.Project;
//import org.apache.tools.ant.Task;
//
//import com.pyx4j.log4j.MavenLogAppender;
//
//import de.pleumann.antenna.misc.Utility;
//
///**
// * The j2me:preprocess helper to optimize generated classes.
// * 
// * @author vlads
// *
// * @goal preprocess
// *
// * @description Preprocess
// */
public abstract class PreprocessMojo extends AbstractJadWtkMojo  {
//
//	/**
//	 * Reads configuration options from the given file.
//	 * 
//	 * @parameter default-value="${basedir}/jour.xml"
//	 */
//	private File jourConfig;
//	
//	
//	public void execute() throws MojoExecutionException, MojoFailureException {
//		PreprocessMojo.executeClassPreprocessor(jourConfig, getJarFile(classifier), this);
//	}
//	
//	public static void executeClassPreprocessor(File jourConfig, File jarFileOrClassesDirectory, AbstractJadWtkMojo mojo) throws MojoExecutionException, MojoFailureException {
//		MavenLogAppender.startPluginLog(mojo);
//		try {
//			
//			mojo.getLog().info(jourConfig.getAbsolutePath());
//
//			File out = new File(mojo.outputDirectory, "iclasses");
//
//			List classpath = new Vector();
//
//			if (mojo.useWtkLibs) {
//				// Find mdip ClassPath from WTK
//				Project antProject = mojo.getAntProject();
//				Task dummyTaks = new Task() {
//				};
//				dummyTaks.setTaskName("obfuscate");
//				dummyTaks.setProject(antProject);
//
//				Utility utility = Utility.getInstance(antProject, dummyTaks);
//
//				String mdipClassPath = utility.getMidpApi();
//				classpath.add(mdipClassPath);
//			} else {
//				List dependancy = mojo.mavenProject.getCompileArtifacts();
//				for (Iterator i = dependancy.iterator(); i.hasNext();) {
//					Artifact artifact = (Artifact) i.next();
//					if (!Artifact.SCOPE_PROVIDED.equals(artifact.getScope())) {
//						continue;
//					}
//					classpath.add(artifact.getFile().toString());
//				}
//			}
//			
//			PreProcessor pp = new PreProcessor(jourConfig.getAbsolutePath(), jarFileOrClassesDirectory, out, classpath);
//
//			try {
//				pp.process();
//			} catch (Exception e) {
//				mojo.getLog().error("PreProcessing error", e);
//				throw new MojoExecutionException("PreProcessing error", e);
//			}
//			
//		} finally {
//			MavenLogAppender.endPluginLog(mojo);
//		}
//	}
//
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy