Author: lcorneliussen
Date: Mon May  2 21:56:41 2011
New Revision: 1098808

URL: http://svn.apache.org/viewvc?rev=1098808&view=rev
Log:
[NPANDAY-424] Bind concrete versions of npanday-plugins in npandays lifecycles

Modified:
    
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleConfigurationGenerator.groovy
    
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleMappingBuilder.groovy
    
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecyclePrinter.groovy
    
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/lifecycle/LifecycleMap.java
    
incubator/npanday/trunk/components/dotnet-core/src/test/groovy/npanday/lifecycle/CustomLifecycleMap.groovy
    
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/CustomLifecycleMap.groovy
    
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/DescribeMojo.groovy
    
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/script/plexus_component_xml.groovy
    
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/CompileLifecycleMap.groovy
    
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/DescribeMojo.groovy
    
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/script/plexus_component_xml.groovy

Modified: 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleConfigurationGenerator.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleConfigurationGenerator.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleConfigurationGenerator.groovy
 (original)
+++ 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleConfigurationGenerator.groovy
 Mon May  2 21:56:41 2011
@@ -107,14 +107,14 @@ class LifecycleConfigurationGenerator {
                currentXml = resultXml.toString()
        }
        
-       static void persistAllTypesAndLifecycles(Class lifecycleMap, File 
componentsXmlFile) {
+       static void persistAllTypesAndLifecycles(Class lifecycleMap, String 
npandayVersion, File componentsXmlFile) {
                def g = lifecycleMap.newInstance() as LifecycleMap
                
                def componentsXml = componentsXmlFile.text
                
                def generator = new 
LifecycleConfigurationGenerator(componentsXml)
                generator.configureAllTypes()
-               generator.configureMappings(g.buildMap())
+               generator.configureMappings(g.buildMap(npandayVersion))
                generator.saveTo(componentsXmlFile)
        }
        

Modified: 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleMappingBuilder.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleMappingBuilder.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleMappingBuilder.groovy
 (original)
+++ 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecycleMappingBuilder.groovy
 Mon May  2 21:56:41 2011
@@ -25,7 +25,6 @@ class LifecycleMappingBuilder {
        
        LifecycleMappingBuilder(ArtifactType type){
                mapping = new LifecycleMapping(type: type)
-
        }
        
        def methodMissing(String name, args) {

Modified: 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecyclePrinter.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecyclePrinter.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecyclePrinter.groovy
 (original)
+++ 
incubator/npanday/trunk/components/dotnet-core/src/main/groovy/npanday/lifecycle/LifecyclePrinter.groovy
 Mon May  2 21:56:41 2011
@@ -27,10 +27,10 @@ import npanday.ArtifactType 
  */
 class LifecyclePrinter {
        
-       static void printAll(Class lifecycleMap, Closure printLine) {
+       static void printAll(Class lifecycleMap, String npandayVersion, Closure 
printLine) {
                def g = lifecycleMap.newInstance() as LifecycleMap
                
-               new LifecyclePrinter().print(g.buildMap(), printLine)
+               new LifecyclePrinter().print(g.buildMap(npandayVersion), 
printLine)
        }
        
        void print(List<LifecycleMapping> lifecycleMappings, Closure printLine){

Modified: 
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/lifecycle/LifecycleMap.java
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/lifecycle/LifecycleMap.java?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/lifecycle/LifecycleMap.java
 (original)
+++ 
incubator/npanday/trunk/components/dotnet-core/src/main/java/npanday/lifecycle/LifecycleMap.java
 Mon May  2 21:56:41 2011
@@ -29,10 +29,10 @@ public abstract class LifecycleMap {
                map.add(mapping);
        }
        
-       protected abstract void defineMappings();
+       protected abstract void defineMappings(String npandayVersion);
        
-       public List<LifecycleMapping> buildMap() {
-               defineMappings();
+       public List<LifecycleMapping> buildMap(String npandayVersion) {
+               defineMappings(npandayVersion);
                return map;
        }
 }

Modified: 
incubator/npanday/trunk/components/dotnet-core/src/test/groovy/npanday/lifecycle/CustomLifecycleMap.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/components/dotnet-core/src/test/groovy/npanday/lifecycle/CustomLifecycleMap.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/components/dotnet-core/src/test/groovy/npanday/lifecycle/CustomLifecycleMap.groovy
 (original)
+++ 
incubator/npanday/trunk/components/dotnet-core/src/test/groovy/npanday/lifecycle/CustomLifecycleMap.groovy
 Mon May  2 21:56:41 2011
@@ -29,7 +29,7 @@ import org.junit.Test 
  */
 class TestLifecycleMap extends LifecycleMap
 {
-       void defineMappings() {
+       void defineMappings(String npandayVersion) {
            add(new LifecycleMapping(type: ArtifactType.DOTNET_LIBRARY, phases: 
null))
        }
        

Modified: 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/CustomLifecycleMap.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/CustomLifecycleMap.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/CustomLifecycleMap.groovy
 (original)
+++ 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/CustomLifecycleMap.groovy
 Mon May  2 21:56:41 2011
@@ -37,11 +37,11 @@ import static LifecycleMappingBuilder.bu
  */
 class CustomLifecycleMap extends LifecycleMap
 {
-    def self_setArtifact = 
'npanday.plugin:custom-lifecycle-maven-plugin:set-artifact'
-       def mv_install = 'org.apache.maven.plugins:maven-install-plugin:install'
-       def mv_deploy = 'org.apache.maven.plugins:maven-deploy-plugin:deploy'
-       
-       void defineMappings() {
+    void defineMappings(String npandayVersion) {
+        def self_setArtifact = 
"npanday.plugin:custom-lifecycle-maven-plugin:$npandayVersion:set-artifact"
+        def mv_install = 
"org.apache.maven.plugins:maven-install-plugin:install"
+        def mv_deploy = "org.apache.maven.plugins:maven-deploy-plugin:deploy"
+
            def phases = {LifecycleMappingBuilder b ->
             b._package( self_setArtifact )
             b.install( mv_install )

Modified: 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/DescribeMojo.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/DescribeMojo.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/DescribeMojo.groovy
 (original)
+++ 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/groovy/npanday/plugin/customlifecycle/DescribeMojo.groovy
 Mon May  2 21:56:41 2011
@@ -22,7 +22,8 @@ package npanday.plugin.customlifecycle;
 
 import npanday.lifecycle.LifecyclePrinter;
 
-import org.codehaus.gmaven.mojo.GroovyMojo;
+import org.codehaus.gmaven.mojo.GroovyMojo
+import org.apache.maven.project.MavenProject;
 /**
  * @author Lars Corneliussen
  * @goal describe
@@ -31,7 +32,15 @@ import org.codehaus.gmaven.mojo.GroovyMo
 class DescribeMojo
     extends GroovyMojo
 {
+     /**
+     * The maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     */
+    protected MavenProject project;
+
        void execute() {
-               LifecyclePrinter.printAll(CustomLifecycleMap, 
{getLog().info(it)})
+               LifecyclePrinter.printAll(CustomLifecycleMap, project.version, 
{getLog().info(it)})
        }
 }

Modified: 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/script/plexus_component_xml.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/script/plexus_component_xml.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/script/plexus_component_xml.groovy
 (original)
+++ 
incubator/npanday/trunk/plugins/custom-lifecycle-maven-plugin/src/main/script/plexus_component_xml.groovy
 Mon May  2 21:56:41 2011
@@ -34,4 +34,4 @@ plexus.mkdirs()
 def componentsXmlFile = new File(plexus, 'components.xml');
 
 LifecycleConfigurationGenerator
-               .persistAllTypesAndLifecycles(CustomLifecycleMap, 
componentsXmlFile)
\ No newline at end of file
+               .persistAllTypesAndLifecycles(CustomLifecycleMap, 
project.version, componentsXmlFile)
\ No newline at end of file

Modified: 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/CompileLifecycleMap.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/CompileLifecycleMap.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/CompileLifecycleMap.groovy
 (original)
+++ 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/CompileLifecycleMap.groovy
 Mon May  2 21:56:41 2011
@@ -35,30 +35,30 @@ import npanday.lifecycle.LifecycleMappin
  */
 class CompileLifecycleMap extends LifecycleMap
 {
-       def mv_install = 
"org.apache.maven.plugins:maven-install-plugin:install" 
-       def mv_deploy = "org.apache.maven.plugins:maven-deploy-plugin:deploy" 
-       
-       def np_generate_settings = 
"npanday.plugin:NPanday.Plugin.Settings.JavaBinding:generate-settings" 
-       def np_compile_init = "npanday.plugin:maven-compile-plugin:initialize"
-       def np_resolve = "npanday.plugin:maven-resolver-plugin:resolve" 
-       def np_generate_assemblyinfo = 
"npanday.plugin:maven-compile-plugin:generate-assembly-info" 
-       def np_compile_process_sources = 
"npanday.plugin:maven-compile-plugin:process-sources" 
-       def np_compile_process_test_sources = 
"npanday.plugin:maven-compile-plugin:process-test-sources" 
-       def np_resgen_copy = 
"npanday.plugin:maven-resgen-plugin:copy-resources" 
-       def np_resgen_generate = "npanday.plugin:maven-resgen-plugin:generate" 
-       def np_resgen_resx = 
"npanday.plugin:maven-resgen-plugin:generate-existing-resx-to-resource" 
-       def np_compile = "npanday.plugin:maven-compile-plugin:compile" 
-       def np_test_compile = "npanday.plugin:maven-compile-plugin:testCompile" 
-       def np_test = "npanday.plugin:maven-test-plugin:test" 
-       def np_convert = 
"npanday.plugin:maven-repository-plugin:convert-artifact"
-       
-       void defineMappings() {
-               
+       void defineMappings(String npandayVersion) {
+
+       def mv_install = "org.apache.maven.plugins:maven-install-plugin:install"
+        def mv_deploy = "org.apache.maven.plugins:maven-deploy-plugin:deploy"
+
+        def np_generate_settings = 
"npanday.plugin:NPanday.Plugin.Settings.JavaBinding:$npandayVersion:generate-settings"
+        def np_compile_init = 
"npanday.plugin:maven-compile-plugin:$npandayVersion:initialize"
+        def np_resolve = 
"npanday.plugin:maven-resolver-plugin:$npandayVersion:resolve"
+        def np_generate_assemblyinfo = 
"npanday.plugin:maven-compile-plugin:$npandayVersion:generate-assembly-info"
+        def np_compile_process_sources = 
"npanday.plugin:maven-compile-plugin:$npandayVersion:process-sources"
+        def np_compile_process_test_sources = 
"npanday.plugin:maven-compile-plugin:$npandayVersion:process-test-sources"
+        def np_resgen_copy = 
"npanday.plugin:maven-resgen-plugin:$npandayVersion:copy-resources"
+        def np_resgen_generate = 
"npanday.plugin:maven-resgen-plugin:$npandayVersion:generate"
+        def np_resgen_resx = 
"npanday.plugin:maven-resgen-plugin:$npandayVersion:generate-existing-resx-to-resource"
+        def np_compile = 
"npanday.plugin:maven-compile-plugin:$npandayVersion:compile"
+        def np_test_compile = 
"npanday.plugin:maven-compile-plugin:$npandayVersion:testCompile"
+        def np_test = "npanday.plugin:maven-test-plugin:$npandayVersion:test"
+        def np_convert = 
"npanday.plugin:maven-repository-plugin:$npandayVersion:convert-artifact"
+
                def default_validate = [np_compile_init, np_resolve, 
np_generate_settings]
                def default_generate_sources = [np_generate_assemblyinfo]
                def default_process_resources = [np_resgen_copy, 
np_resgen_generate, np_resgen_resx]
                def default_process_sources = [np_compile_process_sources, 
np_compile_process_test_sources]
-               def default_install = [np_convert, 
'npanday.plugin:maven-install-plugin:install', mv_install]
+               def default_install = [np_convert, 
"npanday.plugin:maven-install-plugin:$npandayVersion:install", mv_install]
                
                forTypes( [ArtifactType.DOTNET_LIBRARY, ArtifactType.LIBRARY] ) 
{
                        LifecycleMappingBuilder b->
@@ -81,8 +81,8 @@ class CompileLifecycleMap extends Lifecy
                        b.compile (np_compile)
                        b.test_compile (np_test_compile)
                        b.test (np_test)
-                       b._package 
('npanday.plugin:maven-webapp-plugin:package')
-                       b.deploy ('npanday.plugin:maven-webapp-plugin:deploy')
+                       b._package 
("npanday.plugin:maven-webapp-plugin:$npandayVersion:package")
+                       b.deploy 
("npanday.plugin:maven-webapp-plugin:$npandayVersion:deploy")
                }
                forTypes( [ArtifactType.DOTNET_MODULE, ArtifactType.MODULE] ) {
                        LifecycleMappingBuilder b->
@@ -92,7 +92,7 @@ class CompileLifecycleMap extends Lifecy
                        b.compile (np_compile)
                        b.test_compile (np_test_compile)
                        b.test (np_test)
-                       b._package ('npanday.plugin:maven-link-plugin:package')
+                       b._package 
("npanday.plugin:maven-link-plugin:$npandayVersion:package")
                        b.install (default_install)
                        b.deploy (mv_deploy)
                }
@@ -100,12 +100,12 @@ class CompileLifecycleMap extends Lifecy
                        LifecycleMappingBuilder b->
                        b.validate (default_validate)
                        b.generate_sources (default_generate_sources)
-                       b.process_sources (np_compile_process_sources, 
np_compile_process_test_sources, 
'npanday.plugin:maven-aspx-plugin:copy-dependency')
+                       b.process_sources (np_compile_process_sources, 
np_compile_process_test_sources, 
"npanday.plugin:maven-aspx-plugin:$npandayVersion:copy-dependency")
                        b.process_resources (default_process_resources)
-                       b.compile (np_compile, 
'npanday.plugin:maven-aspx-plugin:compile')
+                       b.compile (np_compile, 
"npanday.plugin:maven-aspx-plugin:$npandayVersion:compile")
                        b.test_compile (np_test_compile)
                        b.test (np_test)
-                       b._package ('npanday.plugin:maven-aspx-plugin:package')
+                       b._package 
("npanday.plugin:maven-aspx-plugin:$npandayVersion:package")
                        b.install (default_install)
                        b.deploy (mv_deploy)
                }
@@ -131,7 +131,7 @@ class CompileLifecycleMap extends Lifecy
                        b.test_compile (np_test_compile)
                        b.test (np_test)
                        b.install (default_install)
-                       b.package 
('npanday.plugin:maven-mojo-generator-plugin:generate-bindings')
+                       b._package 
("npanday.plugin:maven-mojo-generator-plugin:$npandayVersion:generate-bindings")
             b.deploy (mv_deploy)
                }
                forType( ArtifactType.VISUAL_STUDIO_ADDIN ) {

Modified: 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/DescribeMojo.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/DescribeMojo.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/DescribeMojo.groovy
 (original)
+++ 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/groovy/npanday/plugin/compile/DescribeMojo.groovy
 Mon May  2 21:56:41 2011
@@ -19,7 +19,8 @@
 package npanday.plugin.compile;
 
 import org.codehaus.gmaven.mojo.GroovyMojo;
-import npanday.lifecycle.LifecyclePrinter;
+import npanday.lifecycle.LifecyclePrinter
+ import org.apache.maven.project.MavenProject;
 /**
  * @author Lars Corneliussen
  * @goal describe
@@ -28,7 +29,15 @@ import npanday.lifecycle.LifecyclePrinte
 class DescribeMojo
     extends GroovyMojo
 {
+     /**
+     * The maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     */
+    protected MavenProject project;
+
        void execute() {
-               LifecyclePrinter.printAll(CompileLifecycleMap, 
{getLog().info(it)}) 
+               LifecyclePrinter.printAll(CompileLifecycleMap, project.version, 
{getLog().info(it)})
        }
 }

Modified: 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/script/plexus_component_xml.groovy
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/script/plexus_component_xml.groovy?rev=1098808&r1=1098807&r2=1098808&view=diff
==============================================================================
--- 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/script/plexus_component_xml.groovy
 (original)
+++ 
incubator/npanday/trunk/plugins/maven-compile-plugin/src/main/script/plexus_component_xml.groovy
 Mon May  2 21:56:41 2011
@@ -27,4 +27,4 @@ plexus.mkdirs()
 def componentsXmlFile = new File(plexus, 'components.xml');
 
 LifecycleConfigurationGenerator
-               .persistAllTypesAndLifecycles(CompileLifecycleMap, 
componentsXmlFile)
\ No newline at end of file
+               .persistAllTypesAndLifecycles(CompileLifecycleMap, 
project.version, componentsXmlFile)
\ No newline at end of file


Reply via email to