Author: cdutz
Date: Sun Dec 2 14:59:32 2012
New Revision: 1416186
URL: http://svn.apache.org/viewvc?rev=1416186&view=rev
Log:
- Added TestCompileMojo and included that into the default maven lifecycle.
Added:
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestCompileMojo.java
- copied, changed from r1416070,
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestRunnerMojo.java
- copied, changed from r1416070,
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java
Removed:
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java
Modified:
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/compiler/CompilerMojo.java
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/resources/META-INF/plexus/components.xml
Modified:
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/compiler/CompilerMojo.java
URL:
http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/compiler/CompilerMojo.java?rev=1416186&r1=1416185&r2=1416186&view=diff
==============================================================================
---
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/compiler/CompilerMojo.java
(original)
+++
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/compiler/CompilerMojo.java
Sun Dec 2 14:59:32 2012
@@ -20,10 +20,7 @@ import org.apache.flex.maven.plugins.fle
import org.apache.maven.execution.MavenSession;
import org.apache.maven.plugin.MojoExecution;
import org.apache.maven.plugin.descriptor.PluginDescriptor;
-import org.apache.maven.plugins.annotations.Component;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.maven.plugins.annotations.*;
import org.apache.maven.project.MavenProject;
import org.apache.maven.settings.Settings;
@@ -37,6 +34,7 @@ import java.util.Map;
*/
@Mojo(name = "compile",
defaultPhase = LifecyclePhase.COMPILE,
+ requiresDependencyResolution = ResolutionScope.COMPILE,
threadSafe = true)
public class CompilerMojo extends AbstractFlexMojo {
@@ -44,22 +42,22 @@ public class CompilerMojo extends Abstra
protected boolean useLegacyCompiler;
@Component
- private Map<String, Compiler> compilerMap;
+ protected Map<String, Compiler> compilerMap;
@Component
- private MavenSession session;
+ protected MavenSession session;
@Component
- private MavenProject project;
+ protected MavenProject project;
@Component
- private MojoExecution mojoEcecution;
+ protected MojoExecution mojoEcecution;
@Component
- private PluginDescriptor plugin;
+ protected PluginDescriptor plugin;
@Component
- private Settings settings;
+ protected Settings settings;
public void execute() {
if(mojoEcecution.getLifecyclePhase().equals(LifecyclePhase.COMPILE.id())) {
Copied:
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestCompileMojo.java
(from r1416070,
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java)
URL:
http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestCompileMojo.java?p2=incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestCompileMojo.java&p1=incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java&r1=1416070&r2=1416186&rev=1416186&view=diff
==============================================================================
---
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java
(original)
+++
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestCompileMojo.java
Sun Dec 2 14:59:32 2012
@@ -16,9 +16,10 @@
*/
package org.apache.flex.maven.plugins.flex.test;
-import org.apache.flex.maven.plugins.flex.AbstractFlexMojo;
+import org.apache.flex.maven.plugins.flex.compiler.CompilerMojo;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.maven.plugins.annotations.ResolutionScope;
/**
* Created with IntelliJ IDEA.
@@ -26,13 +27,24 @@ import org.apache.maven.plugins.annotati
* Date: 01.12.12
* Time: 17:48
*/
-@Mojo(name = "test",
- defaultPhase = LifecyclePhase.TEST,
+@Mojo(name = "test-compile",
+ defaultPhase = LifecyclePhase.TEST_COMPILE,
+ requiresDependencyResolution = ResolutionScope.TEST,
threadSafe = true)
-public class TestMojo extends AbstractFlexMojo {
+public class TestCompileMojo extends CompilerMojo {
public void execute() {
- getLog().debug("Executing test-mojo");
+ if (useLegacyCompiler) {
+ if (project.getPackaging().equalsIgnoreCase("SWC")) {
+ compilerMap.get("compc").compile();
+ } else if (project.getPackaging().equalsIgnoreCase("SWF")) {
+ compilerMap.get("mxmlc").compile();
+ } else {
+ throw new RuntimeException("Wrong packaging");
+ }
+ } else {
+ compilerMap.get("falcon").compile();
+ }
}
}
Copied:
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestRunnerMojo.java
(from r1416070,
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java)
URL:
http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestRunnerMojo.java?p2=incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestRunnerMojo.java&p1=incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java&r1=1416070&r2=1416186&rev=1416186&view=diff
==============================================================================
---
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestMojo.java
(original)
+++
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/java/org/apache/flex/maven/plugins/flex/test/TestRunnerMojo.java
Sun Dec 2 14:59:32 2012
@@ -29,7 +29,7 @@ import org.apache.maven.plugins.annotati
@Mojo(name = "test",
defaultPhase = LifecyclePhase.TEST,
threadSafe = true)
-public class TestMojo extends AbstractFlexMojo {
+public class TestRunnerMojo extends AbstractFlexMojo {
public void execute() {
getLog().debug("Executing test-mojo");
Modified:
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/resources/META-INF/plexus/components.xml
URL:
http://svn.apache.org/viewvc/incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/resources/META-INF/plexus/components.xml?rev=1416186&r1=1416185&r2=1416186&view=diff
==============================================================================
---
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/resources/META-INF/plexus/components.xml
(original)
+++
incubator/flex/utilities/trunk/maven-flex-plugin/plugins/maven-flex-plugin/src/main/resources/META-INF/plexus/components.xml
Sun Dec 2 14:59:32 2012
@@ -23,9 +23,9 @@
<generate-test-sources></generate-test-sources>
<process-test-sources></process-test-sources>
<generate-test-resources></generate-test-resources>
- <process-test-resources></process-test-resources>
- <test-compile></test-compile>
- <process-test-classes></process-test-classes>
+ <process-test-resources></process-test-resources-->
+
<test-compile>org.apache.maven.plugins:maven-flex-plugin:test-compile</test-compile>
+ <!--process-test-classes></process-test-classes>
<test></test>
<prepare-package></prepare-package>
<package></package>
@@ -61,9 +61,9 @@
<generate-test-sources></generate-test-sources>
<process-test-sources></process-test-sources>
<generate-test-resources></generate-test-resources>
- <process-test-resources></process-test-resources>
- <test-compile></test-compile>
- <process-test-classes></process-test-classes>
+ <process-test-resources></process-test-resources-->
+
<test-compile>org.apache.maven.plugins:maven-flex-plugin:test-compile</test-compile>
+ <!--process-test-classes></process-test-classes>
<test></test>
<prepare-package></prepare-package>
<package></package>