Author: sisbell
Date: Wed Feb 28 13:32:14 2007
New Revision: 512983

URL: http://svn.apache.org/viewvc?view=rev&rev=512983
Log:
Added maven solution plugin for generating project and solution files. Expanded 
params for .NET solution plugins.

Added:
    incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/
    incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/pom.xml   
(with props)
    incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/
    incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/
    
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
   (with props)
Modified:
    
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
    
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
    incubator/nmaven/branches/SI_IDE/bootstrap-build.bat
    incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml
    incubator/nmaven/branches/SI_IDE/plugins/pom.xml
    incubator/nmaven/branches/SI_IDE/plugins/scripts/build-2.0.bat

Modified: 
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs?view=diff&rev=512983&r1=512982&r2=512983
==============================================================================
--- 
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
 (original)
+++ 
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Core/src/main/csharp/Core/Impl/ProjectGeneratorImpl.cs
 Wed Feb 28 13:32:14 2007
@@ -93,6 +93,7 @@
                        }
                        writer.Flush();
                        writer.Close();
+                       Console.WriteLine("NMAVEN-000-000: Generate solution 
file: File Name = " + fileInfo.FullName);
                }
                                        
                public NMaven.Model.Model createPomModelFor(string fileName)

Modified: 
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs?view=diff&rev=512983&r1=512982&r2=512983
==============================================================================
--- 
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
 (original)
+++ 
incubator/nmaven/branches/SI_IDE/assemblies/NMaven.Plugin.Solution/src/main/csharp/Plugin/Solution/SolutionPlugin.cs
 Wed Feb 28 13:32:14 2007
@@ -34,22 +34,6 @@
                {
                }
 
-               private string[] GetModulesForProfile(string profile,  
NMaven.Model.Model model)
-               {
-                       NMaven.Model.Profile[] profiles = model.profiles;
-                       if(profiles == null)
-                               return model.modules;
-                       
-                       foreach(NMaven.Model.Profile p in profiles)
-                       {
-                               if(p.activation.property.name.Equals(profile))
-                               {
-                                       return p.modules;
-                               }
-                       }
-                       return model.modules;
-        }
-               
                public List<IProjectReference> Execute(DirectoryInfo 
currentDirectory, NMaven.Model.Model model, string profile)
                {       
                        if(model == null)
@@ -63,7 +47,8 @@
                        }
                        if(!currentDirectory.Exists)
                        {
-                               throw new ExecutionException("NMAVEN-000-000: 
Could not find current directory: Path = " + currentDirectory.FullName);
+                               throw new ExecutionException("NMAVEN-000-000: 
Could not find current directory: Path = "
+                                   + currentDirectory.FullName);
                        }
                        
                        List<IProjectReference> projectReferences = new 
List<IProjectReference>();
@@ -73,7 +58,6 @@
                                foreach(String module in 
GetModulesForProfile(profile, model))
                                {
                                        DirectoryInfo newDir = new 
DirectoryInfo(currentDirectory.FullName + @"\" + module );
-                                       Console.WriteLine("NMAVEN-000-000: 
Generating model for pom: File Name = " + newDir.FullName + @"\pom.xml");
                                        NMaven.Model.Model m = 
projectGenerator.createPomModelFor(newDir.FullName + @"\pom.xml");
                                        
projectReferences.AddRange(Execute(newDir, m, profile));
                                }                                               
@@ -86,19 +70,16 @@
                                        IProjectReference projectReference = 
                                                
projectGenerator.generateProjectFor(model,
                                                                    new 
DirectoryInfo(currentDirectory.FullName + @"\src\main\csharp\"),
-                                                                   
model.artifactId + "T1", null);
-                                       Console.WriteLine("NMAVEN-000-000: 
Generated project: File Name = " 
-                                                         + 
projectReference.CsProjFile.FullName);
+                                                                   
model.artifactId, null);
                                        projectReferences.Add(projectReference);
                                }
                                if(new DirectoryInfo( 
@"src\test\csharp\").Exists)
-                               {                                       
-                                       Console.WriteLine("NMAVEN-000-000: 
Found test directory");
+                               {
                                        IProjectReference projectReference = 
                                                
projectGenerator.generateProjectFor(model,
                                                                    new 
DirectoryInfo(currentDirectory.FullName + @"src\test\csharp\"),
-                                                                   
model.artifactId + "-Test1", null);
-                                       Console.WriteLine("NMAVEN-000-000: 
Generated project: File Name = " 
+                                                                   
model.artifactId + "-Test", null);
+                                       Console.WriteLine("NMAVEN-000-000: 
Generated test project: File Name = "
                                                          + 
projectReference.CsProjFile.FullName);                                      
                                        
projectReferences.Add(projectReference);                                        
                                }
@@ -115,12 +96,14 @@
             string profile = plugin.GetArgFor("profile", args); ;
 
                        IProjectGenerator projectGenerator = new 
ProjectGeneratorImpl();
-                       NMaven.Model.Model rootPom = 
projectGenerator.createPomModelFor(pomFile);       
+                       NMaven.Model.Model rootPom = 
projectGenerator.createPomModelFor(@pomFile);
                                
-
-                       List<IProjectReference> projectReferences = 
plugin.Execute(new DirectoryInfo(Environment.CurrentDirectory), 
+            FileInfo pomFileInfo = new FileInfo(pomFile);
+                       List<IProjectReference> projectReferences = 
plugin.Execute(new DirectoryInfo(pomFileInfo.DirectoryName),
                                                                                
   rootPom, profile);
-                       projectGenerator.generateSolutionFor(new 
FileInfo(@rootPom.artifactId + "." + profile + ".sln"), projectReferences);     
               
+                       String solutionFile = (profile == null) ? 
pomFileInfo.DirectoryName + @"\" + @rootPom.artifactId  + ".sln" :
+                           pomFileInfo.DirectoryName + @"\" + 
@rootPom.artifactId + "." + profile + ".sln";
+                       projectGenerator.generateSolutionFor(new 
FileInfo(solutionFile), projectReferences);
                }
                
                private string GetArgFor(string name, string[] args)
@@ -133,5 +116,22 @@
                        }
             return null;
                }
+
+
+               private string[] GetModulesForProfile(string profile,  
NMaven.Model.Model model)
+               {
+                       NMaven.Model.Profile[] profiles = model.profiles;
+                       if(profiles == null)
+                               return model.modules;
+
+                       foreach(NMaven.Model.Profile p in profiles)
+                       {
+                               if(p.activation.property.name.Equals(profile))
+                               {
+                                       return p.modules;
+                               }
+                       }
+                       return model.modules;
+        }
        }
 }

Modified: incubator/nmaven/branches/SI_IDE/bootstrap-build.bat
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/bootstrap-build.bat?view=diff&rev=512983&r1=512982&r2=512983
==============================================================================
--- incubator/nmaven/branches/SI_IDE/bootstrap-build.bat (original)
+++ incubator/nmaven/branches/SI_IDE/bootstrap-build.bat Wed Feb 28 13:32:14 
2007
@@ -1,4 +1,5 @@
 call mvn -f ./components/pom.xml install
 call mvn -f ./plugins/pom-java-bootstrap.xml install
 call mvn org.apache.maven.dotnet.plugins:maven-install-plugin:install-file 
-Dfile=./plugins/imports/nunit-2.0/nunit.framework.dll -DgroupId=org.nunit 
-DartifactId=nunit.framework -Dpackaging=dll -Dversion=2.2.8.0
-call mvn -f ./assemblies/pom-net-bootstrap.xml -Dmaven.test.skip=true 
-Dbootstrap install %*
\ No newline at end of file
+call mvn -f ./assemblies/pom-net-bootstrap.xml -Dmaven.test.skip=true 
-Dbootstrap install %*
+#call mvn org.apache.maven.dotnet.plugins:maven-solution-plugin:solution
\ No newline at end of file

Added: incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/pom.xml?view=auto&rev=512983
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/pom.xml 
(added)
+++ incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/pom.xml Wed 
Feb 28 13:32:14 2007
@@ -0,0 +1,24 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  <parent>
+    <groupId>org.apache.maven.dotnet.plugins</groupId>
+    <version>0.14-SNAPSHOT</version>
+    <artifactId>maven-dotnet-plugins</artifactId>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.dotnet.plugins</groupId>
+  <artifactId>maven-solution-plugin</artifactId>
+  <packaging>maven-plugin</packaging>
+  <version>0.14-SNAPSHOT</version>
+  <name>maven-solution-plugin</name>
+  <description>
+    Maven Plugin for .NET
+  </description>
+  <distributionManagement>
+    <site>
+      <id>nmaven-apache-site</id>
+      <name>NMaven Site</name>
+      <url>file://${basedir}/../../../www/plugins/maven-solution-plugin</url>
+    </site>
+  </distributionManagement>
+</project>
\ No newline at end of file

Propchange: 
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java?view=auto&rev=512983
==============================================================================
--- 
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
 (added)
+++ 
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
 Wed Feb 28 13:32:14 2007
@@ -0,0 +1,87 @@
+package org.apache.maven.dotnet.plugin.solution;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.dotnet.vendor.VendorInfo;
+import org.apache.maven.dotnet.vendor.VendorFactory;
+import org.apache.maven.dotnet.PlatformUnsupportedException;
+import org.apache.maven.dotnet.executable.ExecutionException;
+import org.apache.maven.project.MavenProject;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.io.File;
+
+/**
+ * Generates resources
+ *
+ * @author Shane Isbell
+ * @goal solution
+ * @phase package
+ */
+public class SolutionMojo extends AbstractMojo
+{
+    /**
+     * @parameter expression="${settings.localRepository}"
+     * @required
+     */
+    private String localRepository;
+
+    /**
+     * The maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     */
+    private MavenProject project;
+
+    /**
+     * The Vendor for the executable. Supports MONO and MICROSOFT: the default 
value is <code>MICROSOFT</code>. Not
+     * case or white-space sensitive.
+     *
+     * @parameter expression="${vendor}"
+     */
+    private String vendor;
+
+    /**
+     * @parameter expression = "${vendorVersion}"
+     */
+    private String vendorVersion;
+
+    /**
+     * @parameter expression = "${frameworkVersion}"
+     */
+    private String frameworkVersion;
+
+    /**
+     * @component
+     */
+    private org.apache.maven.dotnet.executable.NetExecutableFactory 
netExecutableFactory;
+
+    public void execute() throws MojoExecutionException
+    {
+        String profile = System.getProperty( "Profile");
+        String pomFile = System.getProperty( "pomFile");
+        
+        String basedir = System.getProperty( "user.dir");
+        //String basedir1 = "C:\\Documents and 
Settings\\shane\\nmaven-apache\\SI_IDE\\assemblies";
+        List<String> commands = new ArrayList<String>();
+        commands.add("pomFile=" + new File(basedir).getAbsolutePath() + 
File.separator + "pom.xml");
+        if(profile != null) commands.add("profile=" + profile);
+        try
+        {
+            VendorInfo vendorInfo = 
VendorInfo.Factory.createDefaultVendorInfo();
+            vendorInfo.setVendor( VendorFactory.createVendorFromName( 
"MICROSOFT" ) );
+            netExecutableFactory.getNetExecutableFromRepository( 
"NMaven.Plugin", "NMaven.Plugin.Solution", vendorInfo,
+                                                                 project, 
localRepository, commands ).execute();
+        }
+        catch ( PlatformUnsupportedException e )
+        {
+            throw new MojoExecutionException( "", e );
+        }
+        catch ( ExecutionException e )
+        {
+            throw new MojoExecutionException( "", e );
+        }
+    }
+}

Propchange: 
incubator/nmaven/branches/SI_IDE/plugins/maven-solution-plugin/src/main/java/org/apache/maven/dotnet/plugin/solution/SolutionMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml?view=diff&rev=512983&r1=512982&r2=512983
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/pom-java-bootstrap.xml Wed Feb 28 
13:32:14 2007
@@ -17,6 +17,7 @@
     <module>maven-resolver-plugin</module>
     <module>maven-settings-plugin</module>
     <module>maven-vstudio-plugin</module>
+    <module>maven-solution-plugin</module>       
   </modules>
 
   <dependencies>

Modified: incubator/nmaven/branches/SI_IDE/plugins/pom.xml
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/pom.xml?view=diff&rev=512983&r1=512982&r2=512983
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/pom.xml (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/pom.xml Wed Feb 28 13:32:14 2007
@@ -18,6 +18,7 @@
     <module>maven-resgen-plugin</module>
     <module>maven-resolver-plugin</module>
     <module>maven-settings-plugin</module>
+    <module>maven-solution-plugin</module>      
     <module>maven-vstudio-plugin</module>    
   </modules>
 

Modified: incubator/nmaven/branches/SI_IDE/plugins/scripts/build-2.0.bat
URL: 
http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/plugins/scripts/build-2.0.bat?view=diff&rev=512983&r1=512982&r2=512983
==============================================================================
--- incubator/nmaven/branches/SI_IDE/plugins/scripts/build-2.0.bat (original)
+++ incubator/nmaven/branches/SI_IDE/plugins/scripts/build-2.0.bat Wed Feb 28 
13:32:14 2007
@@ -1,3 +1,3 @@
-call mvn -f ../pom-java-bootstrap.xml install
+call mvn -f ../pom.xml install
 call mvn org.apache.maven.dotnet.plugins:maven-install-plugin:install-file 
-Dfile=../imports/nunit-2.0/nunit.framework.dll -DgroupId=org.nunit 
-DartifactId=nunit.framework -Dpackaging=dll -Dversion=2.2.8.0
-call mvn -f ../../assemblies/pom-net-bootstrap.xml -Dmaven.test.skip=true 
-Dbootstrap install
\ No newline at end of file
+#call mvn -f ../../assemblies/pom-net-bootstrap.xml -Dmaven.test.skip=true 
-Dbootstrap install
\ No newline at end of file


Reply via email to