o just checking in so michal and I can work something out

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@162705 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jason van Zyl 2004-05-16 14:25:17 +00:00
parent ed24a60895
commit e98d8b2a87
1 changed files with 34 additions and 10 deletions

View File

@ -9,28 +9,48 @@ import java.util.List;
import java.util.Map;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @plugin.id compiler
* @plugin.description A maven2 plugin which integrates the use of Maven2 with IntelliJ's IDEA
*
* @parameter <name> <type> <required> <validatator> <description>
*
* This may be on a per method basis
* @parameter sourceDirectories String[] required validator
* @parameter outputDirectory String required validator
* @parameter classpathElements String[] required validator
* @parameter compiler String required validator
*
* The goal would map to a method if multiple methods were allowed
* @goal.name idea
* @goal.idea.parameter project #project
*
* There could be threadsafe and non threadsafe versions of a compiler
* plugin. The case where you instantiate a compiler plugin that maintains
* a reference to an incremental compiler.
*
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id$
* @todo make a plugin for each plugin type so that they are not all globbed in here
* this will remove the magic plexus does with Map requirements which will make
* reuse outside of the maven/plexus context easier
* @todo use compile source roots and not the pom.build.sourceDirectory so that any
* sort of preprocessing and/or source generation can be taken into consideration.
*/
// Conditions underwhich we fail
// - specified source directory does not exist
// - missing classpath Elements
// - compilation error
// How to accurately report failures to users
public class CompilerPlugin
extends AbstractPlugin
{
private Map compilers;
private boolean debug = true;
private boolean debug = false;
public void execute( PluginExecutionRequest request, PluginExecutionResponse response )
throws Exception
{
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
String sourceDirectory = (String) request.getParameter( "sourceDirectory" );
String outputDirectory = (String) request.getParameter( "outputDirectory" );
@ -39,9 +59,13 @@ public class CompilerPlugin
String compilerId = (String) request.getParameter( "compiler" );
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
if ( ! new File( sourceDirectory ).exists() )
{
throw new Exception( "The specified source directory '"+ sourceDirectory + "' does not exist!" );
return;
}
Compiler compiler = (Compiler) compilers.get( compilerId );