Author: mkleint
Date: Fri Feb 19 15:18:40 2010
New Revision: 911840

URL: http://svn.apache.org/viewvc?rev=911840&view=rev
Log:
MCOMPILER-75 add jdk 1.6 annotation processing parameters (-s, -proc) handling.

Modified:
    maven/plugins/trunk/maven-compiler-plugin/pom.xml
    
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
    
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java
    
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java

Modified: maven/plugins/trunk/maven-compiler-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/pom.xml?rev=911840&r1=911839&r2=911840&view=diff
==============================================================================
--- maven/plugins/trunk/maven-compiler-plugin/pom.xml (original)
+++ maven/plugins/trunk/maven-compiler-plugin/pom.xml Fri Feb 19 15:18:40 2010
@@ -50,6 +50,15 @@
     <url>http://jira.codehaus.org/browse/MCOMPILER</url>
   </issueManagement>
 
+  <!-- FIXME: remove once not depending on snapshots -->
+  <repositories>
+      <repository>
+          <id>plexus.snapshot</id>
+          
<url>http://oss.repository.sonatype.org/content/repositories/plexus-snapshots</url>
+      </repository>
+  </repositories>
+
+
   <dependencies>
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
@@ -78,7 +87,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-compiler-api</artifactId>
-      <version>1.7</version>
+      <version>1.8-SNAPSHOT</version>
       <exclusions>
         <exclusion>
           <groupId>org.codehaus.plexus</groupId>
@@ -94,7 +103,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-compiler-manager</artifactId>
-      <version>1.7</version>
+      <version>1.8-SNAPSHOT</version>
       <exclusions>
         <exclusion>
           <groupId>org.codehaus.plexus</groupId>
@@ -105,7 +114,7 @@
     <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-compiler-javac</artifactId>
-      <version>1.7.1</version>
+      <version>1.8-SNAPSHOT</version>
       <scope>runtime</scope>
       <exclusions>
         <exclusion>

Modified: 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java?rev=911840&r1=911839&r2=911840&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/AbstractCompilerMojo.java
 Fri Feb 19 15:18:40 2010
@@ -21,6 +21,7 @@
 
 import java.io.File;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -186,6 +187,22 @@
 
     /**
      * <p>
+     * Sets whether annotation processing is performed or not. Only applies to 
JDK 1.6+
+     * If not set, both compilation and annotation processing are performed at 
the same time.
+     * </p>
+     * <p>
+     * Allowed values are:
+     *    none - no annotation processing is performed.
+     *    only - only annotation processing is done, no compilation.
+     * </p>
+     *
+     * @parameter
+     * @since 2.2
+     */
+    private String proc;
+
+    /**
+     * <p>
      * Sets the arguments to be passed to the compiler (prepending a dash) if 
fork is set to true.
      * </p>
      * <p>
@@ -288,6 +305,8 @@
     
     protected abstract Map<String, String> getCompilerArguments();
 
+    protected abstract File getGeneratedSourcesDirectory();
+
     @SuppressWarnings( "unchecked" )
     public void execute()
         throws MojoExecutionException, CompilationFailureException
@@ -389,6 +408,10 @@
 
         compilerConfiguration.setTargetVersion( getTarget() );
 
+        compilerConfiguration.setProc(proc);
+
+        compilerConfiguration.setGeneratedSourcesDirectory( 
getGeneratedSourcesDirectory() );
+
         compilerConfiguration.setSourceEncoding( encoding );
         
         Map<String, String> effectiveCompilerArguments = 
getCompilerArguments();

Modified: 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java?rev=911840&r1=911839&r2=911840&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java
 Fri Feb 19 15:18:40 2010
@@ -95,6 +95,17 @@
      */
     private Set<String> excludes = new HashSet<String>();
 
+    /**
+     * <p>
+     * Specify where to place generated source files created by annotation 
processing.
+     * Only applies to JDK 1.6+
+     * </p>
+     * @parameter 
default-value="${project.build.directory}/generated-sources/annotations"
+     * @since 2.2
+     */
+    private File generatedSourcesDirectory;
+
+
     protected List<String> getCompileSourceRoots()
     {
         return compileSourceRoots;
@@ -179,4 +190,9 @@
       return compilerArguments;
     }
 
+    protected File getGeneratedSourcesDirectory()
+    {
+        return generatedSourcesDirectory;
+    }
+
 }
\ No newline at end of file

Modified: 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java
URL: 
http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java?rev=911840&r1=911839&r2=911840&view=diff
==============================================================================
--- 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java
 (original)
+++ 
maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/TestCompilerMojo.java
 Fri Feb 19 15:18:40 2010
@@ -137,6 +137,17 @@
      */
     private String testCompilerArgument;
 
+    /**
+     * <p>
+     * Specify where to place generated source files created by annotation 
processing.
+     * Only applies to JDK 1.6+
+     * </p>
+     * @parameter 
default-value="${project.build.directory}/generated-sources/test-annotations"
+     * @since 2.2
+     */
+    private File generatedTestSourcesDirectory;
+
+
     public void execute()
         throws MojoExecutionException, CompilationFailureException
     {
@@ -226,4 +237,9 @@
       return testCompilerArguments == null ? compilerArguments : 
testCompilerArguments;
     }
 
+    protected File getGeneratedSourcesDirectory() 
+    {
+        return generatedTestSourcesDirectory;
+    }
+
 }


Reply via email to