incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r488773 - in /incubator/nmaven/trunk: components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/ components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/ components/dotnet-assembler/src/test/ compo...
Date Tue, 19 Dec 2006 19:25:42 GMT
Author: sisbell
Date: Tue Dec 19 11:25:41 2006
New Revision: 488773

URL: http://svn.apache.org/viewvc?view=rev&rev=488773
Log:
Merge of branch SI_SIGNING.

Added:
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/org/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/org/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/org/apache/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/org/apache/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/org/apache/maven/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/org/apache/maven/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/assembler/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/assembler/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/assembler/impl/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/assembler/impl/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/assembler/impl/DefaultAssemblyInfoUnmarshallerTest.java
      - copied unchanged from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/java/org/apache/maven/dotnet/assembler/impl/DefaultAssemblyInfoUnmarshallerTest.java
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/resources/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/resources/
    incubator/nmaven/trunk/components/dotnet-assembler/src/test/resources/AssemblyInfo.cs
      - copied unchanged from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-assembler/src/test/resources/AssemblyInfo.cs
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/KeyInfo.java
      - copied unchanged from r488768, incubator/nmaven/branches/SI_SIGNING/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/KeyInfo.java
    incubator/nmaven/trunk/integration-tests/tests/it0022/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/
    incubator/nmaven/trunk/integration-tests/tests/it0022/goals.txt
      - copied unchanged from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/goals.txt
    incubator/nmaven/trunk/integration-tests/tests/it0022/pom.xml
      - copied unchanged from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/pom.xml
    incubator/nmaven/trunk/integration-tests/tests/it0022/sample.snk
      - copied unchanged from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/sample.snk
    incubator/nmaven/trunk/integration-tests/tests/it0022/src/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/src/
    incubator/nmaven/trunk/integration-tests/tests/it0022/src/main/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/src/main/
    incubator/nmaven/trunk/integration-tests/tests/it0022/src/main/csharp/
      - copied from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/src/main/csharp/
    incubator/nmaven/trunk/integration-tests/tests/it0022/src/main/csharp/It0022.cs
      - copied unchanged from r488768, incubator/nmaven/branches/SI_SIGNING/integration-tests/tests/it0022/src/main/csharp/It0022.cs
Modified:
    incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfo.java
    incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfoMarshaller.java
    incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java
    incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/DefaultAssemblyInfoMarshaller.java
    incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java
    incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java
    incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
    incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
    incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java
    incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java
    incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java
    incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/TestCompilerMojo.java
    incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml

Modified: incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfo.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfo.java (original)
+++ incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfo.java Tue Dec 19 11:25:41 2006
@@ -18,6 +18,8 @@
  */
 package org.apache.maven.dotnet.assembler;
 
+import java.io.File;
+
 /**
  * Provides the information to be included within the assembly. Class can be extended to add additional assembly info
  * parameters.
@@ -71,6 +73,10 @@
      */
     private String configuration;
 
+    private String keyName;
+
+    private File keyFile;
+
     /**
      * Default constructor
      */
@@ -93,6 +99,26 @@
         return sb.toString();
     }
 
+    public String getKeyName()
+    {
+        return keyName;
+    }
+
+    public void setKeyName( String keyName )
+    {
+        this.keyName = keyName;
+    }
+
+    public File getKeyFile()
+    {
+        return keyFile;
+    }
+
+    public void setKeyFile( File keyFile )
+    {
+        this.keyFile = keyFile;
+    }
+
     public String getVersion()
     {
         return ( version != null ) ? version : "";
@@ -182,6 +208,7 @@
     {
         this.configuration = configuration;
     }
+
 
     public boolean equals( Object o )
     {

Modified: incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfoMarshaller.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfoMarshaller.java (original)
+++ incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/AssemblyInfoMarshaller.java Tue Dec 19 11:25:41 2006
@@ -20,6 +20,7 @@
 
 import java.io.OutputStream;
 import java.io.IOException;
+import java.io.InputStream;
 
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.dotnet.model.assembly.plugins.AssemblyPlugin;
@@ -42,6 +43,8 @@
      */
     void marshal( AssemblyInfo assemblyInfo, MavenProject mavenProject, OutputStream outputStream )
         throws IOException;
+
+    AssemblyInfo unmarshall( InputStream inputStream) throws IOException;    
 
     /**
      * Initializes the marshaller.

Modified: incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java (original)
+++ incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/AssemblerContextImpl.java Tue Dec 19 11:25:41 2006
@@ -137,7 +137,7 @@
     {
         AssemblyPlugin plugin = repository.getAssemblyPluginFor( language );
         String className = plugin.getPluginClass();
-        AssemblyInfoMarshaller marshaller = null;
+        AssemblyInfoMarshaller marshaller;
         try
         {
             Class cc = Class.forName( className );

Modified: incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/DefaultAssemblyInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/DefaultAssemblyInfoMarshaller.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/DefaultAssemblyInfoMarshaller.java (original)
+++ incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/DefaultAssemblyInfoMarshaller.java Tue Dec 19 11:25:41 2006
@@ -26,8 +26,12 @@
 import java.io.IOException;
 import java.io.File;
 import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
 
 import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.FileUtils;
 
 /**
  * Provides services for writing out the AssemblyInfo entries using the bracket convention [assembly:
@@ -63,6 +67,9 @@
             .append( createEntry( "Culture", assemblyInfo.getCulture() ) )
             .append( createEntry( "Version", assemblyInfo.getVersion() ) )
             .append( createEntry( "Configuration", assemblyInfo.getConfiguration() ) );
+            if(assemblyInfo.getKeyName() != null) sb.append( createEntry( "KeyName", assemblyInfo.getKeyName() ) );
+            if(assemblyInfo.getKeyFile() != null)
+                sb.append(createEntry("KeyFile", assemblyInfo.getKeyFile().getAbsolutePath().replace( "\\", "\\\\")));
         FileOutputStream man = null;
         try
         {
@@ -91,6 +98,51 @@
     public void init( AssemblyPlugin plugin )
     {
         this.plugin = plugin;
+    }
+
+    public AssemblyInfo unmarshall( InputStream inputStream) throws IOException {
+        AssemblyInfo assemblyInfo = new AssemblyInfo();
+        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+        String line;
+        while ((line = reader.readLine()) != null) {
+            String[] tokens = line.split("[:]");
+
+            if (tokens.length == 2) {
+                String[] assemblyTokens = tokens[1].split("[(]");
+                String name = assemblyTokens[0].trim();
+                String value = assemblyTokens[1].trim().split("[\"]")[1].trim();
+                setAssemblyInfo(assemblyInfo, name, value);
+            }
+        }
+        return assemblyInfo;
+    }
+
+    private void setAssemblyInfo(AssemblyInfo assemblyInfo, String name, String value) throws IOException {
+        if (!name.startsWith("Assembly"))
+            throw new IOException("NMAVEN-xxx-xxx: Invalid assembly info parameter: Name = " + name + ", Value = " + value);
+        if(name.equals("AssemblyDescription")) {
+            assemblyInfo.setDescription(value);
+        } else if(name.equals("AssemblyTitle")) {
+            assemblyInfo.setTitle(value);
+        } else if(name.equals("AssemblyCompany")) {
+            assemblyInfo.setCompany(value);
+        } else if(name.equals("AssemblyProduct")) {
+            assemblyInfo.setProduct(value);
+        } else if(name.equals("AssemblyCopyright")) {
+            assemblyInfo.setCopyright(value);
+        } else if(name.equals("AssemblyTrademark")) {
+            assemblyInfo.setTrademark(value);
+        } else if(name.equals("AssemblyCulture")) {
+            assemblyInfo.setCulture(value);
+        } else if(name.equals("AssemblyVersion")) {
+            assemblyInfo.setVersion(value);
+        } else if(name.equals("AssemblyConfiguration")) {
+            assemblyInfo.setConfiguration(value);
+        } else if(name.equals("AssemblyKeyFile")) {
+            assemblyInfo.setConfiguration(value);
+        } else if(name.equals("AssemblyKeyName")) {
+            assemblyInfo.setConfiguration(value);
+        }
     }
 
     /**

Modified: incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java (original)
+++ incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/JavaAssemblyInfoMarshaller.java Tue Dec 19 11:25:41 2006
@@ -26,6 +26,7 @@
 import java.io.IOException;
 import java.io.FileOutputStream;
 import java.io.File;
+import java.io.InputStream;
 
 import org.apache.maven.project.MavenProject;
 
@@ -82,6 +83,12 @@
                 man.close();
             }
         }
+    }
+
+    public AssemblyInfo unmarshall( InputStream inputStream )
+        throws IOException
+    {
+        return null;
     }
 
     /**

Modified: incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java (original)
+++ incubator/nmaven/trunk/components/dotnet-assembler/src/main/java/org/apache/maven/dotnet/assembler/impl/VBAssemblyInfoMarshaller.java Tue Dec 19 11:25:41 2006
@@ -26,6 +26,7 @@
 import java.io.IOException;
 import java.io.FileOutputStream;
 import java.io.File;
+import java.io.InputStream;
 
 import org.apache.maven.project.MavenProject;
 
@@ -85,6 +86,12 @@
         }
     }
 
+    public AssemblyInfo unmarshall( InputStream inputStream )
+        throws IOException
+    {
+        return null;
+    }
+    
     /**
      * @see AssemblyInfoMarshaller#init(org.apache.maven.dotnet.model.assembly.plugins.AssemblyPlugin)
      */

Modified: incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/compiler-plugins.xml Tue Dec 19 11:25:41 2006
@@ -1,13 +1,12 @@
 <compilerPlugins>
     <compilerPlugin>
-        <identifier>MS-CS</identifier>
+        <identifier>MS-CS-1.1</identifier>
         <pluginClass>org.apache.maven.dotnet.executable.compiler.impl.DefaultCompiler</pluginClass>
         <vendor>MICROSOFT</vendor>
         <executable>csc</executable>
         <language>C_SHARP</language>
         <profile>FULL</profile>
         <frameworkVersions>
-            <frameworkVersion>2.0.50727</frameworkVersion>
             <frameworkVersion>1.1.4322</frameworkVersion>
         </frameworkVersions>
         <platforms>
@@ -20,6 +19,58 @@
             <includes>
                 <include>out</include>
                 <include>target</include>
+                <include>doc</include>
+                <include>recurse</include>
+                <include>reference</include>
+                <include>addmodule</include>
+                <include>win32res</include>
+                <include>win32icon</include>
+                <include>resource</include>
+                <include>linkresource</include>
+                <include>debug</include>
+                <include>optimize</include>
+                <include>warnaserror</include>
+                <include>warn</include>
+                <include>nowarn</include>
+                <include>checked</include>
+                <include>unsafe</include>
+                <include>define</include>
+                <include>noconfig</include>
+                <include>baseaddress</include>
+                <include>bugreport</include>
+                <include>codepage</include>
+                <include>utf8output</include>
+                <include>main</include>
+                <include>fullpaths</include>
+                <include>filealign</include>
+                <include>nostdlib</include>
+                <include>lib</include>
+                <include>errorreport</include>
+                <include>nologo</include>                
+           </includes>
+        </commandFilter>        
+    </compilerPlugin>
+
+    <compilerPlugin>
+        <identifier>MS-CS-2.0</identifier>
+        <pluginClass>org.apache.maven.dotnet.executable.compiler.impl.DefaultCompiler</pluginClass>
+        <vendor>MICROSOFT</vendor>
+        <executable>csc</executable>
+        <language>C_SHARP</language>
+        <profile>FULL</profile>
+        <frameworkVersions>
+            <frameworkVersion>2.0.50727</frameworkVersion>
+        </frameworkVersions>
+        <platforms>
+            <platform>
+                <operatingSystem>Windows</operatingSystem>
+                <architecture>x86</architecture>
+            </platform>
+        </platforms>
+        <commandFilter>
+            <includes>
+                <include>out</include>
+                <include>target</include>
                 <include>delaysign</include>
                 <include>doc</include>
                 <include>keyfile</include>
@@ -54,11 +105,10 @@
                 <include>lib</include>
                 <include>errorreport</include>
                 <include>moduleassemblyname</include>
-                <include>nologo</include>                
+                <include>nologo</include>
            </includes>
-        </commandFilter>        
+        </commandFilter>
     </compilerPlugin>
-
     <compilerPlugin>
         <identifier>MS-CS:COMPACT</identifier>
         <pluginClass>org.apache.maven.dotnet.executable.compiler.impl.CSharpCompilerForProfile</pluginClass>

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/ExecutableConfig.java Tue Dec 19 11:25:41 2006
@@ -20,6 +20,7 @@
 
 import org.apache.maven.dotnet.executable.compiler.CompilerConfig;
 import org.apache.maven.dotnet.executable.compiler.ArtifactType;
+import org.apache.maven.dotnet.executable.compiler.KeyInfo;
 
 import java.util.List;
 import java.io.File;
@@ -80,6 +81,8 @@
         {
             return new CompilerConfig()
             {
+                private KeyInfo keyInfo;
+
                 private List<String> commands;
 
                 private String executionPath;
@@ -138,6 +141,15 @@
                 public void setLocalRepository( File localRepository )
                 {
                     this.localRepository = localRepository;
+                }
+
+                public KeyInfo getKeyInfo()
+                {
+                    return keyInfo;
+                }
+
+                public void setKeyInfo(KeyInfo keyInfo) {
+                    this.keyInfo = keyInfo;
                 }
             };
         }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerConfig.java Tue Dec 19 11:25:41 2006
@@ -45,6 +45,8 @@
      * @return true if the compiler plugin should compile the test classes, otherwise returns false.
      */
     boolean isTestCompile();
+    
+    KeyInfo getKeyInfo();
 
     /**
      * Returns local repository
@@ -74,5 +76,6 @@
      */
     void setLocalRepository( File localRepository );
 
+    void setKeyInfo(KeyInfo keyInfo);
 
 }

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/CompilerContext.java Tue Dec 19 11:25:41 2006
@@ -81,6 +81,8 @@
      */
     List<Artifact> getDirectModuleDependencies();
 
+    KeyInfo getKeyInfo();
+
     /**
      * Returns a list of library (dll) dependencies of the class files.
      *

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java Tue Dec 19 11:25:41 2006
@@ -140,6 +140,13 @@
             commands.add( "/nologo" );
         }
 
+        if(compilerContext.getKeyInfo().getKeyFileUri() != null)
+        {
+            commands.add("/keyfile:" + compilerContext.getKeyInfo().getKeyFileUri());
+        } else if(compilerContext.getKeyInfo().getKeyContainerName() != null) {
+            commands.add("/keycontainer:" + compilerContext.getKeyInfo().getKeyContainerName());
+        }
+
         if ( config.getCommands() != null )
         {
             commands.addAll( config.getCommands() );

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java Tue Dec 19 11:25:41 2006
@@ -32,6 +32,7 @@
 import org.apache.maven.dotnet.registry.Repository;
 import org.apache.maven.dotnet.registry.RepositoryRegistry;
 import org.apache.maven.dotnet.RepositoryNotFoundException;
+import org.apache.maven.dotnet.vendor.Vendor;
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
 
@@ -133,6 +134,15 @@
             artifacts.add( project.getArtifact() );
         }
         return artifacts;
+    }
+
+    public KeyInfo getKeyInfo() {
+        if((compilerRequirement.getVendor().equals( Vendor.MICROSOFT )
+            && compilerRequirement.getFrameworkVersion().equals("1.1.4322")) || config.getKeyInfo() == null) {
+            return KeyInfo.Factory.createDefaultKeyInfo();
+        } else {
+            return config.getKeyInfo();
+        }
     }
 
     public List<Artifact> getLibraryDependencies()

Modified: incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java (original)
+++ incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/AssemblyInfoGeneratorMojo.java Tue Dec 19 11:25:41 2006
@@ -28,9 +28,11 @@
 import java.util.List;
 
 import org.apache.maven.dotnet.InitializationException;
+import org.apache.maven.dotnet.vendor.*;
 import org.apache.maven.dotnet.assembler.AssemblerContext;
 import org.apache.maven.dotnet.assembler.AssemblyInfoMarshaller;
 import org.apache.maven.dotnet.assembler.AssemblyInfoException;
+import org.apache.maven.dotnet.assembler.AssemblyInfo;
 
 /**
  * Generates an AssemblyInfo.* class based on information within the pom file.
@@ -39,7 +41,9 @@
  * @goal generate-assembly-info
  * @phase generate-sources
  */
-public class AssemblyInfoGeneratorMojo extends AbstractMojo {
+public class AssemblyInfoGeneratorMojo
+    extends AbstractMojo
+{
 
     /**
      * The maven project.
@@ -51,6 +55,16 @@
     private MavenProject project;
 
     /**
+     * @parameter expression = "${frameworkVersion}"
+     */
+    private String frameworkVersion;
+
+    /**
+     * @parameter expression = "${vendorVersion}"
+     */
+    private String vendorVersion;
+
+    /**
      * .NET Language. The default value is <code>C_SHARP</code>. Not case or white-space sensitive.
      *
      * @parameter expression="${language}" default-value = "C_SHARP"
@@ -59,11 +73,37 @@
     private String language;
 
     /**
+     * The Vendor for the Compiler. Not case or white-space sensitive.
+     *
+     * @parameter expression="${vendor}"
+     */
+    private String vendor;
+
+    /**
+     * Specify a strong name key file.
+     *
+     * @parameter expression = "${keyfile}"
+     */
+    private File keyfile;
+
+    /**
+     * Specifies a strong name key container. (not currently supported)
+     *
+     * @parameter expression = "${keycontainer}"
+     */
+    private String keycontainer;
+
+    /**
      * @component
      */
     private AssemblerContext assemblerContext;
 
     /**
+     * @component
+     */
+    private org.apache.maven.dotnet.vendor.StateMachineProcessor stateMachineProcessor;
+
+    /**
      * Source directory
      *
      * @parameter expression = "${sourceDirectory}" default-value="${project.build.sourceDirectory}"
@@ -76,37 +116,90 @@
      *
      * @throws MojoExecutionException
      */
-    public void execute() throws MojoExecutionException {
-        if (project.getArtifact().getType().equals("module")) {
+    public void execute()
+        throws MojoExecutionException
+    {
+        if ( project.getArtifact().getType().equals( "module" ) )
+        {
             return;
         }
 
-        File srcFile = new File(sourceDirectory);
-        if (srcFile.exists()) {
-            try {
-                List files = FileUtils.getFiles(srcFile, "**/AssemblyInfo.*", null);
-                if (files.size() != 0) {
-                    getLog().info("NMAVEN-902-001: Found AssemblyInfo file(s), so will not generate one");
+        File srcFile = new File( sourceDirectory );
+        if ( srcFile.exists() )
+        {
+            try
+            {
+                List files = FileUtils.getFiles( srcFile, "**/AssemblyInfo.*", null );
+                if ( files.size() != 0 )
+                {
+                    getLog().info( "NMAVEN-902-001: Found AssemblyInfo file(s), so will not generate one" );
                     return;
                 }
-            } catch (IOException e) {
-                throw new MojoExecutionException("NMAVEN-902-004: Could not determine whether an AssemblyInfo file exists",
-                        e);
+            }
+            catch ( IOException e )
+            {
+                throw new MojoExecutionException(
+                    "NMAVEN-902-004: Could not determine whether an AssemblyInfo file exists", e );
             }
         }
-        getLog().info("NMAVEN-902-000: Generating Assembly Info: Language = " + language.trim());
-        try {
-            try {
-                assemblerContext.init(project);
-            } catch (InitializationException e) {
-                throw new MojoExecutionException("NMAVEN-902-006: Failed to initialize the assembler context");
+        getLog().info( "NMAVEN-902-000: Generating Assembly Info: Language = " + language.trim() );
+
+        try
+        {
+            assemblerContext.init( project );
+        }
+        catch ( InitializationException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-902-006: Failed to initialize the assembler context" );
+        }
+
+        //TODO: Investigate the affect of not setting isDefault and profile. In the case of executables, this is
+        //managed by the framework. I intended to keep vendor info and state machine processor out of the
+        // Mojos. Unable to do so for this case. Look at new API.
+        VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
+        try
+        {
+            vendorInfo.setFrameworkVersion( frameworkVersion );
+            if ( vendor != null )
+            {
+                vendorInfo.setVendor( VendorFactory.createVendorFromName( vendor ) );
             }
-            AssemblyInfoMarshaller marshaller = assemblerContext.getAssemblyInfoMarshallerFor(language.trim());
-            marshaller.marshal(assemblerContext.getAssemblyInfo(), project, null);
-        } catch (IOException e) {
-            throw new MojoExecutionException("NMAVEN-902-002: Problem generating assembly info class", e);
-        } catch (AssemblyInfoException e) {
-            throw new MojoExecutionException("NMAVEN-902-005: Problem generating assembly info class", e);
+            vendorInfo.setVendorVersion( vendorVersion );
+        }
+        catch ( VendorUnsupportedException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-902-007: Vendor not supported: Vendor = " + vendor );
+        }
+
+        AssemblyInfo assemblyInfo = assemblerContext.getAssemblyInfo();
+        try
+        {
+            stateMachineProcessor.process( vendorInfo );
+        }
+        catch ( org.apache.maven.dotnet.vendor.IllegalStateException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-902-008: Illegal state of vendor info: Message =  " + e.getMessage() );
+        }
+
+        if ( vendorInfo.getVendor().equals( Vendor.MICROSOFT ) && vendorInfo.getVendorVersion().equals( "1.1.4322" ) )
+        {
+            System.out.println(keyfile + ":" + keycontainer);
+            assemblyInfo.setKeyFile( keyfile );
+            assemblyInfo.setKeyName( keycontainer );
+        }
+        try
+        {
+            AssemblyInfoMarshaller marshaller = assemblerContext.getAssemblyInfoMarshallerFor( language.trim() );
+            marshaller.marshal( assemblyInfo, project, null );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-902-002: Problem generating assembly info class", e );
+        }
+        catch ( AssemblyInfoException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-902-005: Problem generating assembly info class", e );
         }
 
     }

Modified: incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java (original)
+++ incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/CompilerMojo.java Tue Dec 19 11:25:41 2006
@@ -43,7 +43,9 @@
  * @phase compile
  * @description Maven Mojo for compiling Class files to the .NET Intermediate Language
  */
-public final class CompilerMojo extends AbstractMojo {
+public final class CompilerMojo
+    extends AbstractMojo
+{
 
     /**
      * @parameter expression="${settings.localRepository}"
@@ -72,12 +74,14 @@
     private boolean delaysign;
 
     /**
-     * Specify a strong name key file. (not currently supported)
+     * Specify a strong name key file.
+     * @parameter expression = "${keyfile}"
      */
     private File keyfile;
 
     /**
      * Specifies a strong name key container. (not currently supported)
+     * @parameter expression = "${keycontainer}"
      */
     private String keycontainer;
 
@@ -89,7 +93,7 @@
     private String platform;
 
     /**
-     * @parameter expression = "${frameworkVersion}" 
+     * @parameter expression = "${frameworkVersion}"
      */
     private String frameworkVersion;
 
@@ -110,7 +114,7 @@
     private String language;
 
     /**
-     * The Vendor for the Compiler. Supports MONO and MICROSOFT: the default value is <code>MICROSOFT</code>. Not
+     * The Vendor for the Compiler. Not
      * case or white-space sensitive.
      *
      * @parameter expression="${vendor}"
@@ -140,56 +144,94 @@
      * @throws MojoExecutionException thrown if MOJO is unable to compile the class files or if the environment is not
      *                                properly set.
      */
-    public void execute() throws MojoExecutionException {
-        if (profileAssemblyPath != null && !profileAssemblyPath.exists())
-            throw new MojoExecutionException("NMAVEN-900-007: Profile Assembly Path does not exist: Path = " +
-                    profileAssemblyPath.getAbsolutePath());
+    public void execute()
+        throws MojoExecutionException
+    {
+        if ( profileAssemblyPath != null && !profileAssemblyPath.exists() )
+        {
+            throw new MojoExecutionException( "NMAVEN-900-007: Profile Assembly Path does not exist: Path = " +
+                profileAssemblyPath.getAbsolutePath() );
+        }
 
         //Requirement
         CompilerRequirement compilerRequirement = CompilerRequirement.Factory.createDefaultCompilerRequirement();
-        compilerRequirement.setLanguage(language);
-        compilerRequirement.setFrameworkVersion(frameworkVersion);
-        compilerRequirement.setProfile(profile);
-        compilerRequirement.setVendorVersion(vendorVersion);
-        try {
-            if(vendor != null) compilerRequirement.setVendor(VendorFactory.createVendorFromName(vendor));
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("NMAVEN-900-000: Unknown Vendor: Vendor = " + vendor, e);
+        compilerRequirement.setLanguage( language );
+        compilerRequirement.setFrameworkVersion( frameworkVersion );
+        compilerRequirement.setProfile( profile );
+        compilerRequirement.setVendorVersion( vendorVersion );
+        try
+        {
+            if ( vendor != null )
+            {
+                compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) );
+            }
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-900-000: Unknown Vendor: Vendor = " + vendor, e );
         }
 
         //Config
         CompilerConfig compilerConfig = (CompilerConfig) CompilerConfig.Factory.createDefaultExecutableConfig();
-        compilerConfig.setLocalRepository(localRepository);
-        if (parameters != null) compilerConfig.setCommands(parameters);
+        compilerConfig.setLocalRepository( localRepository );
+        if ( parameters != null )
+        {
+            compilerConfig.setCommands( parameters );
+        }
         String artifactTypeName = project.getArtifact().getType();
 
-        if (artifactTypeName.equals(ArtifactType.MODULE.getArtifactTypeName())) {
-            compilerConfig.setArtifactType(ArtifactType.MODULE);
-        } else if (artifactTypeName.equals(ArtifactType.LIBRARY.getArtifactTypeName())) {
-            compilerConfig.setArtifactType(ArtifactType.LIBRARY);
-        } else if (artifactTypeName.equals(ArtifactType.EXE.getArtifactTypeName())) {
-            compilerConfig.setArtifactType(ArtifactType.EXE);
-        } else if (artifactTypeName.equals(ArtifactType.WINEXE.getArtifactTypeName())) {
-            compilerConfig.setArtifactType(ArtifactType.WINEXE);
-        } else if (artifactTypeName.equals(ArtifactType.NAR.getArtifactTypeName())) {
-            compilerConfig.setArtifactType(ArtifactType.LIBRARY);
-        } else {
-            throw new MojoExecutionException("NMAVEN-900-001: Unrecognized artifact type: Language = " + language
-                    + ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName);
-        }
-
-        try {
-            CompilerExecutable compilerExecutable = netExecutableFactory.getCompilerExecutableFor(compilerRequirement,
-                    compilerConfig, project, profileAssemblyPath);
+        if ( artifactTypeName.equals( ArtifactType.MODULE.getArtifactTypeName() ) )
+        {
+            compilerConfig.setArtifactType( ArtifactType.MODULE );
+        }
+        else if ( artifactTypeName.equals( ArtifactType.LIBRARY.getArtifactTypeName() ) )
+        {
+            compilerConfig.setArtifactType( ArtifactType.LIBRARY );
+        }
+        else if ( artifactTypeName.equals( ArtifactType.EXE.getArtifactTypeName() ) )
+        {
+            compilerConfig.setArtifactType( ArtifactType.EXE );
+        }
+        else if ( artifactTypeName.equals( ArtifactType.WINEXE.getArtifactTypeName() ) )
+        {
+            compilerConfig.setArtifactType( ArtifactType.WINEXE );
+        }
+        else if ( artifactTypeName.equals( ArtifactType.NAR.getArtifactTypeName() ) )
+        {
+            compilerConfig.setArtifactType( ArtifactType.LIBRARY );
+        }
+        else
+        {
+            throw new MojoExecutionException( "NMAVEN-900-001: Unrecognized artifact type: Language = " + language +
+                ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName );
+        }
+
+        if ( keyfile != null )
+        {
+            KeyInfo keyInfo = KeyInfo.Factory.createDefaultKeyInfo();
+            keyInfo.setKeyFileUri( keyfile.getAbsolutePath() );
+            compilerConfig.setKeyInfo( keyInfo );
+        }
+
+        try
+        {
+            CompilerExecutable compilerExecutable = netExecutableFactory.getCompilerExecutableFor( compilerRequirement,
+                                                                                                   compilerConfig,
+                                                                                                   project,
+                                                                                                   profileAssemblyPath );
             compilerExecutable.execute();
-            project.getArtifact().setFile(compilerExecutable.getCompiledArtifact());
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("NMAVEN-900-003: Unsupported Platform: Language = " + language
-                    + ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName, e);
-        } catch (ExecutionException e) {
-            throw new MojoExecutionException("NMAVEN-900-004: Unable to Compile: Language = " + language
-                    + ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName + ", Source Directory = "
-                    + project.getBuild().getSourceDirectory(), e);
+            project.getArtifact().setFile( compilerExecutable.getCompiledArtifact() );
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-900-003: Unsupported Platform: Language = " + language +
+                ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName, e );
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-900-004: Unable to Compile: Language = " + language +
+                ", Vendor = " + vendor + ", ArtifactType = " + artifactTypeName + ", Source Directory = " +
+                project.getBuild().getSourceDirectory(), e );
         }
     }
 }

Modified: incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java (original)
+++ incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/ComponentInitializerMojo.java Tue Dec 19 11:25:41 2006
@@ -36,7 +36,9 @@
  * @goal initialize
  * @phase compile
  */
-public class ComponentInitializerMojo extends AbstractMojo {
+public class ComponentInitializerMojo
+    extends AbstractMojo
+{
 
     /**
      * The maven project.
@@ -75,14 +77,21 @@
      */
     private org.apache.maven.dotnet.NMavenRepositoryRegistry nmavenRegistry;
 
-    public void execute() throws MojoExecutionException {
-        try {
-            assemblyResolver.resolveTransitivelyFor(project, project.getArtifact(), project.getDependencies(), pomFile,
-                    localRepository, true);
-        } catch (ArtifactResolutionException e) {
-            throw new MojoExecutionException("NMAVEN-901-000: Unable to resolve assemblies", e);
-        } catch (ArtifactNotFoundException e) {
-            throw new MojoExecutionException("NMAVEN-901-001: Unable to resolve assemblies", e);
+    public void execute()
+        throws MojoExecutionException
+    {
+        try
+        {
+            assemblyResolver.resolveTransitivelyFor( project, project.getArtifact(), project.getDependencies(), pomFile,
+                                                     localRepository, true );
+        }
+        catch ( ArtifactResolutionException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-901-000: Unable to resolve assemblies", e );
+        }
+        catch ( ArtifactNotFoundException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-901-001: Unable to resolve assemblies", e );
         }
     }
 }

Modified: incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/TestCompilerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/TestCompilerMojo.java?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/TestCompilerMojo.java (original)
+++ incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/TestCompilerMojo.java Tue Dec 19 11:25:41 2006
@@ -38,7 +38,9 @@
  * @phase test-compile
  * @description Maven Mojo for compiling Test Class files to the .NET Intermediate Language
  */
-public final class TestCompilerMojo extends AbstractMojo {
+public final class TestCompilerMojo
+    extends AbstractMojo
+{
 
     /**
      * @parameter expression="${settings.localRepository}"
@@ -69,7 +71,7 @@
     private boolean skipTestCompile;
 
     /**
-     * @parameter expression = "${testFrameworkVersion}" 
+     * @parameter expression = "${testFrameworkVersion}"
      */
     private String testFrameworkVersion;
 
@@ -120,47 +122,69 @@
      * @throws MojoExecutionException thrown if MOJO is unable to compile the class files or if the environment is not
      *                                properly set.
      */
-    public void execute() throws MojoExecutionException {
-        String skipTests = System.getProperty("maven.test.skip");
-        if ((skipTests != null && skipTests.equalsIgnoreCase("true")) || skipTestCompile) {
-            getLog().warn("NMAVEN-903-004: Disabled unit tests: -Dmaven.test.skip=true");
+    public void execute()
+        throws MojoExecutionException
+    {
+        String skipTests = System.getProperty( "maven.test.skip" );
+        if ( ( skipTests != null && skipTests.equalsIgnoreCase( "true" ) ) || skipTestCompile )
+        {
+            getLog().warn( "NMAVEN-903-004: Disabled unit tests: -Dmaven.test.skip=true" );
             return;
         }
-        FileUtils.mkdir("target");
+        FileUtils.mkdir( "target" );
 
-        if (testLanguage == null) testLanguage = language;
-        if (testVendor == null) testVendor = vendor;
+        if ( testLanguage == null )
+        {
+            testLanguage = language;
+        }
+        if ( testVendor == null )
+        {
+            testVendor = vendor;
+        }
 
         //Requirement
         CompilerRequirement compilerRequirement = CompilerRequirement.Factory.createDefaultCompilerRequirement();
-        compilerRequirement.setLanguage(language);
-        compilerRequirement.setFrameworkVersion(testFrameworkVersion);
-        compilerRequirement.setProfile("FULL");
-        compilerRequirement.setVendorVersion(testVendorVersion);
-        try {
-            if(vendor != null) compilerRequirement.setVendor(VendorFactory.createVendorFromName(vendor));
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("NMAVEN-900-000: Unknown Vendor: Vendor = " + vendor, e);
+        compilerRequirement.setLanguage( language );
+        compilerRequirement.setFrameworkVersion( testFrameworkVersion );
+        compilerRequirement.setProfile( "FULL" );
+        compilerRequirement.setVendorVersion( testVendorVersion );
+        try
+        {
+            if ( vendor != null )
+            {
+                compilerRequirement.setVendor( VendorFactory.createVendorFromName( vendor ) );
+            }
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "NMAVEN-900-000: Unknown Vendor: Vendor = " + vendor, e );
         }
-
 
         //Config
         CompilerConfig compilerConfig = (CompilerConfig) CompilerConfig.Factory.createDefaultExecutableConfig();
-        if (testParameters != null) compilerConfig.setCommands(testParameters);
-        compilerConfig.setArtifactType(ArtifactType.LIBRARY);
-        compilerConfig.setTestCompile(true);
-        compilerConfig.setLocalRepository(localRepository);
-
-        try {
-            CompilerExecutable compilerExecutable = netExecutableFactory.getCompilerExecutableFor(compilerRequirement,
-                    compilerConfig, project, null);
+        if ( testParameters != null )
+        {
+            compilerConfig.setCommands( testParameters );
+        }
+        compilerConfig.setArtifactType( ArtifactType.LIBRARY );
+        compilerConfig.setTestCompile( true );
+        compilerConfig.setLocalRepository( localRepository );
+
+        try
+        {
+            CompilerExecutable compilerExecutable =
+                netExecutableFactory.getCompilerExecutableFor( compilerRequirement, compilerConfig, project, null );
             compilerExecutable.execute();
-        } catch (PlatformUnsupportedException e) {
-            throw new MojoExecutionException("NMAVEN-903-003: Unsupported Platform: Language = " + language
-                    + ", Vendor = " + vendor, e);
-        } catch (ExecutionException e) {
-            throw new MojoExecutionException("NMAVEN-903-002: Unable to Compile: Language = " + language
-                    + ", Vendor = " + vendor, e);
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-903-003: Unsupported Platform: Language = " + language + ", Vendor = " + vendor, e );
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException(
+                "NMAVEN-903-002: Unable to Compile: Language = " + language + ", Vendor = " + vendor, e );
         }
     }
 }

Modified: incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=488773&r1=488772&r2=488773
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml (original)
+++ incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml Tue Dec 19 11:25:41 2006
@@ -211,5 +211,26 @@
                 </requirement>
             </requirements>
         </component>
+        <component>
+            <role>org.apache.maven.dotnet.vendor.VendorInfoRepository</role>
+            <implementation>org.apache.maven.dotnet.vendor.impl.VendorInfoRepositoryImpl</implementation>
+            <requirements>
+                <requirement>
+                    <role>org.apache.maven.dotnet.registry.RepositoryRegistry</role>
+                </requirement>
+            </requirements>
+        </component>
+        <component>
+            <role>org.apache.maven.dotnet.vendor.StateMachineProcessor</role>
+            <implementation>org.apache.maven.dotnet.vendor.impl.StateMachineProcessorImpl</implementation>
+            <requirements>
+                <requirement>
+                    <role>org.apache.maven.dotnet.vendor.VendorInfoRepository</role>
+                </requirement>
+                <requirement>
+                    <role>org.apache.maven.dotnet.registry.RepositoryRegistry</role>
+                </requirement>
+            </requirements>
+        </component>
     </components>
 </component-set>



Mime
View raw message