From e98d8b2a87fd394f26563fc1ff8900feb578aba2 Mon Sep 17 00:00:00 2001 From: Jason van Zyl Date: Sun, 16 May 2004 14:25:17 +0000 Subject: [PATCH] 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 --- .../apache/maven/plugin/CompilerPlugin.java | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerPlugin.java b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerPlugin.java index 53fd0f642e..5033b90889 100644 --- a/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerPlugin.java +++ b/maven-plugins/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerPlugin.java @@ -9,28 +9,48 @@ import java.util.List; import java.util.Map; /** - * @author Jason van Zyl + * @plugin.id compiler + * @plugin.description A maven2 plugin which integrates the use of Maven2 with IntelliJ's IDEA * + * @parameter + * + * 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 Jason van Zyl * @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 );