incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r549387 - in /incubator/nmaven/trunk/assemblies: NMaven.Artifact/ NMaven.Artifact/src/main/csharp/ NMaven.Artifact/src/main/csharp/NMaven/Artifact/ NMaven.Logging/ NMaven.Logging/src/main/csharp/ NMaven.Plugin.MojoGenerator/ NMaven.Plugin.M...
Date Thu, 21 Jun 2007 05:47:15 GMT
Author: sisbell
Date: Wed Jun 20 22:47:13 2007
New Revision: 549387

URL: http://svn.apache.org/viewvc?view=rev&rev=549387
Log:
Various updates to assemblies.

Added:
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactRepository.cs
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/IArtifactContext.cs
Modified:
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/NMaven.Artifact.sln
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/pom.xml
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven.Artifact.csproj
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/Artifact.cs
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactContext.cs
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/AssemblyRepositoryLayout.cs
    incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/JavaRepositoryLayout.cs
    incubator/nmaven/trunk/assemblies/NMaven.Logging/NMaven.Logging.sln
    incubator/nmaven/trunk/assemblies/NMaven.Logging/src/main/csharp/NMaven.Logging.csproj
    incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/NMaven.Plugin.MojoGenerator.sln
    incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/src/main/csharp/NMaven.Plugin.MojoGenerator.csproj
    incubator/nmaven/trunk/assemblies/NMaven.Plugin/NMaven.Plugin.sln
    incubator/nmaven/trunk/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj
    incubator/nmaven/trunk/assemblies/NMaven.Service/Embedder/src/main/csharp/NMaven.Service.Embedder.csproj
    incubator/nmaven/trunk/assemblies/NMaven.Solution/NMaven.Solution.suo
    incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/pom.xml
    incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/src/main/csharp/NMaven/VisualStudio/Addin/Connect.cs

Modified: incubator/nmaven/trunk/assemblies/NMaven.Artifact/NMaven.Artifact.sln
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/NMaven.Artifact.sln?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/NMaven.Artifact.sln (original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/NMaven.Artifact.sln Wed Jun 20 22:47:13
2007
@@ -1,6 +1,21 @@
 
 Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005
-# SharpDevelop 2.1.0.2376
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Artifact", "C:\Documents and
Settings\shane\nmaven-apache\trunk-new\assemblies\NMaven.Artifact\src\main\csharp\NMaven.Artifact.csproj",
"{b9da05df-af58-4063-8d51-b1bf17966e59}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Artifact", "C:\Documents and
Settings\shane\nmaven-apache\trunk-fix\assemblies\NMaven.Artifact\src\main\csharp\NMaven.Artifact.csproj",
"{819ACFA7-3FFC-4681-B169-1954486E7CB5}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Artifact-Test", "C:\Documents
and Settings\shane\nmaven-apache\trunk-fix\assemblies\NMaven.Artifact\src\test\csharp\NMaven.Artifact-Test.csproj",
"{3C1CA733-CFC6-4256-A767-37FFE8CBD21A}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{819ACFA7-3FFC-4681-B169-1954486E7CB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{819ACFA7-3FFC-4681-B169-1954486E7CB5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3C1CA733-CFC6-4256-A767-37FFE8CBD21A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3C1CA733-CFC6-4256-A767-37FFE8CBD21A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal

Modified: incubator/nmaven/trunk/assemblies/NMaven.Artifact/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/pom.xml?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/pom.xml (original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/pom.xml Wed Jun 20 22:47:13 2007
@@ -34,5 +34,11 @@
       <type>library</type>
       <version>${pom.version}</version>
     </dependency>
+    <dependency>
+      <groupId>NUnit</groupId>
+      <artifactId>NUnit.Framework</artifactId>
+      <type>library</type>
+      <version>2.2.8.0</version>
+    </dependency>
   </dependencies>  
 </project>

Modified: incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven.Artifact.csproj
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven.Artifact.csproj?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven.Artifact.csproj
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven.Artifact.csproj
Wed Jun 20 22:47:13 2007
@@ -1,6 +1,6 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectGuid>{b9da05df-af58-4063-8d51-b1bf17966e59}</ProjectGuid>
+    <ProjectGuid>{819ACFA7-3FFC-4681-B169-1954486E7CB5}</ProjectGuid>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <RootNameSpace>NMaven.Artifact</RootNameSpace>
     <AssemblyName>NMaven.Artifact</AssemblyName>
@@ -12,19 +12,23 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="NMaven.Model.Pom" />
+    <Reference Include="NUnit.Framework, Version=2.2.8.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\..\..\..\.m2\repository\NUnit\NUnit.Framework\2.2.8.0\NUnit.Framework.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
     <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="NMaven" />
-    <Folder Include="NMaven\Artifact" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="NMaven\Artifact\Artifact.cs" />
     <Compile Include="NMaven\Artifact\ArtifactContext.cs" />
+    <Compile Include="NMaven\Artifact\ArtifactRepository.cs" />
     <Compile Include="NMaven\Artifact\ArtifactRepositoryLayout.cs" />
     <Compile Include="NMaven\Artifact\ArtifactScope.cs" />
     <Compile Include="NMaven\Artifact\AssemblyRepositoryLayout.cs" />
+    <Compile Include="NMaven\Artifact\IArtifactContext.cs" />
     <Compile Include="NMaven\Artifact\JavaRepositoryLayout.cs" />
     <Compile Include="NMaven\Artifact\RepositoryType.cs" />
   </ItemGroup>

Modified: incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/Artifact.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/Artifact.cs?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/Artifact.cs
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/Artifact.cs
Wed Jun 20 22:47:13 2007
@@ -3,7 +3,7 @@
 
 namespace NMaven.Artifact
 {
-    public class Artifact
+    public sealed class Artifact
     {
         private string artifactId;
 

Modified: incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactContext.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactContext.cs?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactContext.cs
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactContext.cs
Wed Jun 20 22:47:13 2007
@@ -1,4 +1,5 @@
 using System;
+using System.IO;
 using System.Collections.Generic;
 using System.Text;
 
@@ -6,8 +7,16 @@
 
 namespace NMaven.Artifact
 {
-    public class ArtifactContext
+    public sealed class ArtifactContext : IArtifactContext
     {
+
+        //public void Init(File
+        public ArtifactRepository GetArtifactRepository()
+        {
+            ArtifactRepository artifactRepository = new ArtifactRepository();
+            artifactRepository.Init(this, new DirectoryInfo(@"C:\Documents and Settings\shane\.m2\repository"));
+            return artifactRepository;
+        }
 
         public Artifact GetArtifactFor(NMaven.Model.Model model)
         {

Added: incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactRepository.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactRepository.cs?view=auto&rev=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactRepository.cs
(added)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/ArtifactRepository.cs
Wed Jun 20 22:47:13 2007
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Text;
+using System.Xml;
+using System.Xml.Serialization;
+
+namespace NMaven.Artifact
+{
+    public sealed class ArtifactRepository
+    {
+        public List<Artifact> GetArtifactsFor()
+        {
+            return (GetArtifactsFromDirectories(localRepository.GetDirectories()));
+        }
+
+        public void Init(ArtifactContext artifactContext, DirectoryInfo localRepository)
+        {
+            this.artifactContext = artifactContext;
+            this.localRepository = localRepository;
+        }
+
+        private List<Artifact> GetArtifactsFromDirectories(DirectoryInfo[] directories)
+        {
+            List<Artifact> artifacts = new List<Artifact>();
+            foreach (DirectoryInfo directoryInfo in directories)
+            {
+                foreach(FileInfo fileInfo in directoryInfo.GetFiles())
+                {
+                    if (fileInfo.Name.EndsWith("pom"))
+                    {
+                        XmlReader reader = XmlReader.Create(fileInfo.FullName);
+		                XmlSerializer serializer = new XmlSerializer(typeof(NMaven.Model.Model));
+                        if (serializer.CanDeserialize(reader))
+                        {
+                            Artifact artifact = artifactContext.GetArtifactFor(
+                                (NMaven.Model.Model)serializer.Deserialize(reader));
+                            if (artifact.Extension.Equals("dll"))
+                            {
+                                artifacts.Add(artifact);
+                            }                           
+                        }
+                    }
+                }
+                artifacts.AddRange(GetArtifactsFromDirectories(directoryInfo.GetDirectories()));
+            }
+            return artifacts;
+        }
+
+        private ArtifactContext artifactContext;
+        private DirectoryInfo localRepository;
+    }
+}

Modified: incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/AssemblyRepositoryLayout.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/AssemblyRepositoryLayout.cs?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/AssemblyRepositoryLayout.cs
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/AssemblyRepositoryLayout.cs
Wed Jun 20 22:47:13 2007
@@ -3,7 +3,7 @@
 
 namespace NMaven.Artifact
 {
-    public class AssemblyRepositoryLayout : ArtifactRepositoryLayout 
+    public sealed class AssemblyRepositoryLayout : ArtifactRepositoryLayout 
     {
         public string pathOf(Artifact artifact)
         {

Added: incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/IArtifactContext.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/IArtifactContext.cs?view=auto&rev=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/IArtifactContext.cs
(added)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/IArtifactContext.cs
Wed Jun 20 22:47:13 2007
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace NMaven.Artifact
+{
+    interface IArtifactContext
+    {
+        ArtifactRepository GetArtifactRepository();
+
+        Artifact GetArtifactFor(NMaven.Model.Model model);
+
+        Artifact CreateArtifact(String groupId, String artifactId, String version, String
packaging);
+    }
+}

Modified: incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/JavaRepositoryLayout.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/JavaRepositoryLayout.cs?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/JavaRepositoryLayout.cs
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Artifact/src/main/csharp/NMaven/Artifact/JavaRepositoryLayout.cs
Wed Jun 20 22:47:13 2007
@@ -3,7 +3,7 @@
 
 namespace NMaven.Artifact
 {
-    public class JavaRepositoryLayout : ArtifactRepositoryLayout
+    public sealed class JavaRepositoryLayout : ArtifactRepositoryLayout
     {
         public string pathOf(Artifact artifact)
         {

Modified: incubator/nmaven/trunk/assemblies/NMaven.Logging/NMaven.Logging.sln
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Logging/NMaven.Logging.sln?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Logging/NMaven.Logging.sln (original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Logging/NMaven.Logging.sln Wed Jun 20 22:47:13
2007
@@ -2,5 +2,5 @@
 Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005
 # SharpDevelop 2.1.0.2376
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Logging", "C:\Documents and Settings\shane\nmaven-apache\trunk-new\assemblies\NMaven.Logging\src\main\csharp\NMaven.Logging.csproj",
"{dacc064f-ab41-42e3-b011-b346dc53bf47}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Logging", "C:\Documents and Settings\shane\nmaven-apache\trunk-fix\assemblies\NMaven.Logging\src\main\csharp\NMaven.Logging.csproj",
"{27f16b7e-0acc-4e9a-bc36-4c2d9b098cc2}"
 EndProject

Modified: incubator/nmaven/trunk/assemblies/NMaven.Logging/src/main/csharp/NMaven.Logging.csproj
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Logging/src/main/csharp/NMaven.Logging.csproj?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Logging/src/main/csharp/NMaven.Logging.csproj
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Logging/src/main/csharp/NMaven.Logging.csproj
Wed Jun 20 22:47:13 2007
@@ -1,6 +1,6 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectGuid>{dacc064f-ab41-42e3-b011-b346dc53bf47}</ProjectGuid>
+    <ProjectGuid>{C511B03B-8AB7-4E61-9F6E-5E6F9F65E8CE}</ProjectGuid>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <RootNameSpace>NMaven.Logging</RootNameSpace>
     <AssemblyName>NMaven.Logging</AssemblyName>
@@ -13,10 +13,6 @@
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="NMaven" />
-    <Folder Include="NMaven\Logging" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="NMaven\Logging\ConsoleHandler.cs" />

Modified: incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/NMaven.Plugin.MojoGenerator.sln
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/NMaven.Plugin.MojoGenerator.sln?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/NMaven.Plugin.MojoGenerator.sln
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/NMaven.Plugin.MojoGenerator.sln
Wed Jun 20 22:47:13 2007
@@ -2,5 +2,5 @@
 Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005
 # SharpDevelop 2.1.0.2376
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Plugin.MojoGenerator", "C:\Documents
and Settings\shane\nmaven-apache\trunk-new\assemblies\NMaven.Plugin.MojoGenerator\src\main\csharp\NMaven.Plugin.MojoGenerator.csproj",
"{93484dfe-e867-42b2-b7ac-4aff7a12f65c}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Plugin.MojoGenerator", "C:\Documents
and Settings\shane\nmaven-apache\trunk-fix\assemblies\NMaven.Plugin.MojoGenerator\src\main\csharp\NMaven.Plugin.MojoGenerator.csproj",
"{c279f231-0d56-490a-8bec-e54199f93618}"
 EndProject

Modified: incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/src/main/csharp/NMaven.Plugin.MojoGenerator.csproj
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/src/main/csharp/NMaven.Plugin.MojoGenerator.csproj?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/src/main/csharp/NMaven.Plugin.MojoGenerator.csproj
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Plugin.MojoGenerator/src/main/csharp/NMaven.Plugin.MojoGenerator.csproj
Wed Jun 20 22:47:13 2007
@@ -1,6 +1,6 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectGuid>{93484dfe-e867-42b2-b7ac-4aff7a12f65c}</ProjectGuid>
+    <ProjectGuid>{09887944-425A-45A0-870C-AE4C16DA63DF}</ProjectGuid>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <RootNameSpace>NMaven.Plugin</RootNameSpace>
     <AssemblyName>NMaven.Plugin.MojoGenerator</AssemblyName>
@@ -17,11 +17,6 @@
     <Reference Include="System.Runtime.Remoting" />
     <Reference Include="System.Windows.Forms" />
     <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="NMaven" />
-    <Folder Include="NMaven\Plugin" />
-    <Folder Include="NMaven\Plugin\MojoGenerator" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="NMaven\Plugin\MojoGenerator\Generator.cs" />

Modified: incubator/nmaven/trunk/assemblies/NMaven.Plugin/NMaven.Plugin.sln
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Plugin/NMaven.Plugin.sln?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Plugin/NMaven.Plugin.sln (original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Plugin/NMaven.Plugin.sln Wed Jun 20 22:47:13
2007
@@ -2,5 +2,5 @@
 Microsoft Visual Studio Solution File, Format Version 9.00
 # Visual Studio 2005
 # SharpDevelop 2.1.0.2376
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Plugin", "C:\Documents and Settings\shane\nmaven-apache\trunk-new\assemblies\NMaven.Plugin\src\main\csharp\NMaven.Plugin.csproj",
"{d7fc7c76-a5fc-4e0d-9a34-9525ed53654c}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMaven.Plugin", "C:\Documents and Settings\shane\nmaven-apache\trunk-fix\assemblies\NMaven.Plugin\src\main\csharp\NMaven.Plugin.csproj",
"{9f400405-41d4-4fe5-9998-0d6bf1da0129}"
 EndProject

Modified: incubator/nmaven/trunk/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj (original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Plugin/src/main/csharp/NMaven.Plugin.csproj Wed
Jun 20 22:47:13 2007
@@ -1,6 +1,6 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectGuid>{d7fc7c76-a5fc-4e0d-9a34-9525ed53654c}</ProjectGuid>
+    <ProjectGuid>{B760D54F-22AC-43E7-A0A6-DE313D4663AF}</ProjectGuid>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <RootNameSpace>NMaven.Plugin</RootNameSpace>
     <AssemblyName>NMaven.Plugin</AssemblyName>
@@ -16,13 +16,6 @@
     <Reference Include="System" />
     <Reference Include="System.Xml" />
     <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="NMaven" />
-    <Folder Include="NMaven\Plugin" />
-    <Folder Include="NMaven\Plugin\Generator" />
-    <Folder Include="NMaven\Plugin\Injector" />
-    <Folder Include="NMaven\Plugin\Injector\Impl" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="NMaven\Plugin\AbstractMojo.cs" />

Modified: incubator/nmaven/trunk/assemblies/NMaven.Service/Embedder/src/main/csharp/NMaven.Service.Embedder.csproj
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Service/Embedder/src/main/csharp/NMaven.Service.Embedder.csproj?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.Service/Embedder/src/main/csharp/NMaven.Service.Embedder.csproj
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.Service/Embedder/src/main/csharp/NMaven.Service.Embedder.csproj
Wed Jun 20 22:47:13 2007
@@ -1,6 +1,6 @@
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup>
-    <ProjectGuid>{65de94ba-7bd5-47bb-8b0a-4bb5b699c464}</ProjectGuid>
+    <ProjectGuid>{DF06BE45-AF6C-4DA4-8844-EA114F094C5F}</ProjectGuid>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <RootNameSpace>NMaven.Service</RootNameSpace>
     <AssemblyName>NMaven.Service.Embedder</AssemblyName>
@@ -12,11 +12,6 @@
   </PropertyGroup>
   <ItemGroup>
     <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Folder Include="NMaven" />
-    <Folder Include="NMaven\Service" />
-    <Folder Include="NMaven\Service\Embedder" />
   </ItemGroup>
   <ItemGroup>
     <Compile Include="NMaven\Service\Embedder\MavenEmbedder.cs" />

Modified: incubator/nmaven/trunk/assemblies/NMaven.Solution/NMaven.Solution.suo
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.Solution/NMaven.Solution.suo?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
Binary files - no diff available.

Modified: incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/pom.xml?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/pom.xml (original)
+++ incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/pom.xml Wed Jun 20 22:47:13
2007
@@ -85,6 +85,30 @@
       <artifactId>Extensibility</artifactId>
       <type>gac</type>
     </dependency>
+    <dependency>
+      <groupId>Castle</groupId>
+      <artifactId>Castle.Windsor</artifactId>
+      <type>library</type>
+      <version>2.0-rc2</version>
+    </dependency>
+    <dependency>
+      <groupId>Castle</groupId>
+      <artifactId>Castle.Core</artifactId>
+      <type>library</type>
+      <version>2.0-rc2</version>
+    </dependency>
+    <dependency>
+      <groupId>Castle</groupId>
+      <artifactId>Castle.MicroKernel</artifactId>
+      <type>library</type>
+      <version>2.0-rc2</version>
+    </dependency>
+    <dependency>
+      <groupId>Castle</groupId>
+      <artifactId>Castle.DynamicProxy</artifactId>
+      <type>library</type>
+      <version>2.0-rc2</version>
+    </dependency>
   </dependencies>
   <profiles>
     <profile>

Modified: incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/src/main/csharp/NMaven/VisualStudio/Addin/Connect.cs
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/src/main/csharp/NMaven/VisualStudio/Addin/Connect.cs?view=diff&rev=549387&r1=549386&r2=549387
==============================================================================
--- incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/src/main/csharp/NMaven/VisualStudio/Addin/Connect.cs
(original)
+++ incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.Addin/src/main/csharp/NMaven/VisualStudio/Addin/Connect.cs
Wed Jun 20 22:47:13 2007
@@ -3,6 +3,8 @@
 using EnvDTE80;
 
 using System;
+using System.Collections.Generic;
+using System.Diagnostics;
 using System.IO;
 using System.Net;
 using System.Resources;
@@ -10,18 +12,20 @@
 using System.Globalization;
 using System.Drawing;
 using System.Threading;
+using System.Web.Services.Protocols;
 
 using Microsoft.VisualStudio.CommandBars;
 
 using NMaven.Artifact;
-using NMaven.IDE;
-using NMaven.IDE.Controls;
-using NMaven.IDE.Commands;
-using NMaven.IDE.Impl;
-using NMaven.IDE.View;
 using NMaven.Logging;
+using NMaven.Service;
 using NMaven.VisualStudio.Logging;
-using System.Diagnostics;
+
+using NMaven.IDE;
+using NMaven.IDE.Impl;
+
+using Castle.Windsor;
+using Castle.Windsor.Configuration.Interpreters;
 
 namespace NMaven.VisualStudio.Addin
 {
@@ -29,12 +33,6 @@
     /// <seealso class='IDTExtensibility2' />
     public class Connect : IDTExtensibility2, IDTCommandTarget
     {
-        private Window _windowToolWindow;
-
-        private OutputWindowPane outputWindowPane;
-
-        private NMaven.Logging.Logger logger;
-
         /// <summary>Implements the constructor for the Add-in object. Place your initialization
code within this method.</summary>
         public Connect()
         {
@@ -50,7 +48,7 @@
         {
             _applicationObject = (DTE2)application;
             _addInInstance = (AddIn)addInInst;
-            
+            Command command = null;
             if (connectMode == ext_ConnectMode.ext_cm_UISetup)
             {
                 object[] contextGUIDS = new object[] { };
@@ -88,7 +86,11 @@
                 try
                 {
                     //Add a command to the Commands collection:
-                    Command command = commands.AddNamedCommand2(_addInInstance, "NMavenAddin",
"NMaven Build System", "Executes the command for NMavenAddin", true, 480, ref contextGUIDS,
(int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled,
(int)vsCommandStyle.vsCommandStylePictAndText, vsCommandControlType.vsCommandControlTypeButton);
+                    command = commands.AddNamedCommand2(_addInInstance, "NMavenAddin", 
+                        "NMaven Build System", "Executes the command for NMavenAddin", true,
480, ref contextGUIDS, 
+                        (int)vsCommandStatus.vsCommandStatusSupported + (int)vsCommandStatus.vsCommandStatusEnabled,

+                        (int)vsCommandStyle.vsCommandStylePictAndText, 
+                        vsCommandControlType.vsCommandControlTypeButton);
 
                     //Add a control for the command to the tools menu:
                     if ((command != null) && (toolsPopup != null))
@@ -117,11 +119,14 @@
 
                   String localRepository = Environment.GetEnvironmentVariable("HOMEDRIVE")
                     + Environment.GetEnvironmentVariable("HOMEPATH") + @"\.m2\repository\";
-                ArtifactContext artifactContext = new ArtifactContext();
+
+                IWindsorContainer container = new WindsorContainer(new XmlInterpreter(@"C:\Documents
and Settings\shane\nmaven-apache\trunk-fix\assemblies\NMaven.VisualStudio.Addin\src\main\resources\components.xml"));
+                ArtifactContext artifactContext = (ArtifactContext) container[typeof(ArtifactContext)];
+
                 NMaven.Artifact.Artifact artifactWar = artifactContext.CreateArtifact("org.apache.maven.dotnet",
"dotnet-service-embedder", "0.14-SNAPSHOT", "war");
                 FileInfo warFileInfo = new FileInfo(localRepository + "/" + new JavaRepositoryLayout().pathOf(artifactWar)
+ "war");
-                logger.Log(Level.INFO, "Executing external command plugin: " 
-                    + @"mvn org.apache.maven.dotnet.plugins:maven-embedder-plugin:start -Dport=8080
-DwarFile=""" 
+                logger.Log(Level.INFO, "Executing external command plugin: "
+                    + @"mvn org.apache.maven.dotnet.plugins:maven-embedder-plugin:start -Dport=8080
-DwarFile="""
                     + warFileInfo.FullName + @"""");
 
    			    ProcessStartInfo processStartInfo =
@@ -130,21 +135,136 @@
                 processStartInfo.WindowStyle = ProcessWindowStyle.Hidden;
                 System.Diagnostics.Process.Start(processStartInfo);
 
-                MavenBuildControl mavenBuildControl = new MavenBuildControl();
-                object programmableObject = null;
-
-                String guidstr = "{858C3FCD-8B39-4540-A592-F31C1520B174}";
                 EnvDTE80.Windows2 windows2 = (EnvDTE80.Windows2)_applicationObject.Windows;
-                System.Reflection.Assembly asm = System.Reflection.Assembly.GetAssembly(mavenBuildControl.GetType());
-                _windowToolWindow = windows2.CreateToolWindow2(_addInInstance, asm.Location,
"NMaven.IDE.Controls.MavenBuildControl", "Maven Build Tool", guidstr, ref programmableObject);
-
-                _windowToolWindow.Visible = true;
                 _applicationObject = (DTE2)application;
+               
+                ideContext = new IdeContextImpl();
+               
+                IIdeConfiguration configuration = Factory.CreateIdeConfiguration();
+                configuration.Logger = logger;
+                configuration.SocketLoggerPort = 9099;
+                ideContext.Init(configuration);
                 
-                mavenBuildControl = (MavenBuildControl)_windowToolWindow.Object;
-                mavenBuildControl.Init(warFileInfo, logger, 9099, new Size(400, 400), _applicationObject);
-                mavenBuildControl.ClearOutputWindow += new EventHandler(ClearOutputWindowPane);
-                mavenBuildControl.FocusOutputWindow += new EventHandler(ActivateOutputWindowPane);
+                DTE2 dte2 = _applicationObject;
+                addReferenceControls = new List<CommandBarButton>();
+                buildControls = new List<CommandBarControl>();
+                foreach (CommandBar commandBar in (CommandBars) dte2.CommandBars)
+                {
+                    foreach (CommandBarControl control in commandBar.Controls)
+                    {
+                        if (control.Caption.Equals("Add &Reference..."))
+                        {
+                            outputWindowPane.OutputString("Adding control reference: " +
commandBar.Name + Environment.NewLine);
+                            
+                            CommandBarButton ctl = (CommandBarButton)
+                                commandBar.Controls.Add(MsoControlType.msoControlButton,
+                                System.Type.Missing, System.Type.Missing, control.Index,
true);
+                            ctl.Click += new _CommandBarButtonEvents_ClickEventHandler(cbShowAddArtifactsForm_Click);
+                            ctl.Caption = "Add Maven Artifact...";
+                            ctl.Visible = true;
+                            addReferenceControls.Add(ctl);
+                        }
+                        else if (control.Caption.Equals("Clea&n"))
+                        {
+                            CommandBarPopup ctl = (CommandBarPopup)
+                                commandBar.Controls.Add(MsoControlType.msoControlPopup,
+                                System.Type.Missing, System.Type.Missing, control.Index +
1, true);
+                            ctl.Caption = "Maven Phase";
+                            ctl.Visible = true;
+                            buildControls.Add(ctl);
+
+                            CommandBarButton cleanButton = (CommandBarButton)ctl.Controls.Add(MsoControlType.msoControlButton,
+                                System.Type.Missing, System.Type.Missing, 1, true);
+                            cleanButton.Caption = "Clean";
+                            cleanButton.Visible = true;
+                            cleanButton.Click += new _CommandBarButtonEvents_ClickEventHandler(cbClean_Click);
+
+
+                            CommandBarButton testButton = (CommandBarButton)ctl.Controls.Add(MsoControlType.msoControlButton,
+                                System.Type.Missing, System.Type.Missing, 1, true);
+                            testButton.Caption = "Test";
+                            testButton.Visible = true;
+                            testButton.Click += new _CommandBarButtonEvents_ClickEventHandler(cbTest_Click);
+
+                            CommandBarButton installButton = (CommandBarButton)ctl.Controls.Add(MsoControlType.msoControlButton,
+                                System.Type.Missing, System.Type.Missing, 1, true);
+                            installButton.Caption = "Install";
+                            installButton.Visible = true;
+                            installButton.Click += new _CommandBarButtonEvents_ClickEventHandler(cbInstall_Click);
+
+                            CommandBarButton buildButton = (CommandBarButton)ctl.Controls.Add(MsoControlType.msoControlButton,
+                                System.Type.Missing, System.Type.Missing, 1, true);
+                            buildButton.Caption = "Build";
+                            buildButton.Visible = true;
+                            buildButton.FaceId = 645;
+                            buildButton.Click += new _CommandBarButtonEvents_ClickEventHandler(cbBuild_Click);
+
+                            buildControls.Add(buildButton);
+                            buildControls.Add(installButton);
+                            buildControls.Add(cleanButton);
+                            buildControls.Add(testButton);
+                        }
+                    }
+                    
+                }
+
+
+                nunitControls = new List<CommandBarButton>();
+                Window solutionExplorerWindow = dte2.Windows.Item(Constants.vsWindowKindSolutionExplorer);
+                _selectionEvents = dte2.Events.SelectionEvents;
+                _selectionEvents.OnChange += new _dispSelectionEvents_OnChangeEventHandler(this.OnChange);
               
+            }
+        }
+
+        public void OnChange()
+        {
+            foreach (SelectedItem item in _applicationObject.SelectedItems)
+            {
+                if (item.Name.EndsWith("Test.cs"))
+                {
+                    if (nunitControls.Count == 0)
+                    {
+                        DTE2 dte2 = _applicationObject;
+                        foreach (CommandBar commandBar in (CommandBars)dte2.CommandBars)
+                        {
+                            foreach (CommandBarControl control in commandBar.Controls)
+                            {
+                                if (control.Caption.Equals("View &Code"))
+                                {
+                                    CommandBarButton nunitControl = (CommandBarButton)
+                                        commandBar.Controls.Add(MsoControlType.msoControlButton,
+                                        System.Type.Missing, System.Type.Missing, control.Index,
true);
+                                    nunitControl.Click += new _CommandBarButtonEvents_ClickEventHandler(cbRunUnitTest_Click);
+                                    nunitControl.Caption = "Run Unit Test";
+                                    nunitControl.Visible = true;
+                                    CommandBarButton nunitCompileAndRunControl = (CommandBarButton)
+                                        commandBar.Controls.Add(MsoControlType.msoControlButton,
+                                        System.Type.Missing, System.Type.Missing, control.Index,
true);
+                                    nunitCompileAndRunControl.Click 
+                                        += new _CommandBarButtonEvents_ClickEventHandler(cbCompileAndRunUnitTest_Click);
+                                    nunitCompileAndRunControl.Caption = "Compile and Run
Unit Test";
+                                    nunitCompileAndRunControl.Visible = true;
+                                    nunitControls.Add(nunitControl);
+                                    nunitControls.Add(nunitCompileAndRunControl);
+                                }
+                            }
+                        }
+                    }
+                    else
+                    {
+                        foreach (CommandBarButton button in nunitControls)
+                        {
+                            button.Visible = true;
+                        }
+                    }
+                }
+                else
+                {
+                    foreach (CommandBarButton button in nunitControls)
+                    {
+                        button.Visible = false;
+                    }
+                }
             }
         }
 
@@ -179,6 +299,86 @@
         /// <seealso class='IDTExtensibility2' />
         public void OnStartupComplete(ref Array custom)
         {
+
+        }
+
+        private void executeBuildCommand(FileInfo pomFile, String goal)
+        {
+            MavenExecutionRequest request = new MavenExecutionRequest();
+            request.goal = goal;
+            request.pomFile = @pomFile.FullName;
+            request.loggerPort = 9099;
+            request.loggerPortSpecified = true;
+
+            try
+            {
+                ideContext.Build(request);
+            }
+            catch (SoapException e)
+            {
+                ideContext.GetLogger().Log(Level.INFO, "NMaven: Soap Error in build: " +
e.Code + ", " + e.SubCode
+                    + "," + e.StackTrace);
+            }
+            catch (Exception e)
+            {
+                ideContext.GetLogger().Log(Level.INFO, "NMaven: Error in build: " + e.Message
+ ", Pom File = " + pomFile.FullName + 
+                    "," + e.StackTrace);
+            }
+        }
+
+        private FileInfo getPomFile()
+        {
+            FileInfo projectFileInfo = null;
+            //TODO: Fix to handle multiple projects: NMAVEN-80
+            foreach (Project project in (Array)_applicationObject.ActiveSolutionProjects)
+            {
+                ideContext.GetLogger().Log(Level.INFO, "project.FileName = " + project.FileName);
+                projectFileInfo = new FileInfo(project.FileName);
+                break;
+            }
+            FileInfo pomFile = new FileInfo(projectFileInfo.DirectoryName + @"\pom.xml");
+            if (!pomFile.Exists)
+            {
+                pomFile = new FileInfo(projectFileInfo.Directory.Parent.Parent.Parent.FullName
+ @"\pom.xml");
+            }
+            return pomFile;
+        }
+
+        private void cbRunUnitTest_Click(CommandBarButton btn, ref bool Cancel)
+        {           
+            executeBuildCommand(getPomFile(), "org.apache.maven.dotnet.plugins:maven-test-plugin:test");

+        }
+
+        private void cbCompileAndRunUnitTest_Click(CommandBarButton btn, ref bool Cancel)
+        {
+            executeBuildCommand(getPomFile(), "test");
+        }
+
+        private void cbInstall_Click(CommandBarButton btn, ref bool Cancel)
+        {
+            executeBuildCommand(getPomFile(), "install");
+        }
+
+        private void cbClean_Click(CommandBarButton btn, ref bool Cancel)
+        {
+            executeBuildCommand(getPomFile(), "clean");
+        }
+
+        private void cbBuild_Click(CommandBarButton btn, ref bool Cancel)
+        {
+            executeBuildCommand(getPomFile(), "compile");
+        }
+
+        private void cbTest_Click(CommandBarButton btn, ref bool Cancel)
+        {
+            executeBuildCommand(getPomFile(), "test");
+        }
+
+        private void cbShowAddArtifactsForm_Click(CommandBarButton btn, ref bool Cancel)
+        {
+            outputWindowPane.OutputString("Show Artifacts.");
+            AddArtifactsForm form = new AddArtifactsForm();
+            form.Show();
         }
 
         /// <summary>Implements the OnBeginShutdown method of the IDTExtensibility2
interface. Receives notification that the host application is being unloaded.</summary>
@@ -217,6 +417,7 @@
         /// <seealso class='Exec' />
         public void Exec(string commandName, vsCommandExecOption executeOption, ref object
varIn, ref object varOut, ref bool handled)
         {
+            outputWindowPane.OutputString(commandName);
             handled = false;
             if (executeOption == vsCommandExecOption.vsCommandExecOptionDoDefault)
             {
@@ -225,9 +426,18 @@
                 handled = true;
 
             }
-            _windowToolWindow.Visible = true;
         }
+
         private DTE2 _applicationObject;
         private AddIn _addInInstance;
+        private OutputWindowPane outputWindowPane;
+        private NMaven.Logging.Logger logger;
+        private List<CommandBarButton> addReferenceControls;
+        private List<CommandBarButton> nunitControls;
+        private List<CommandBarControl> buildControls;
+        private EnvDTE.SelectionEvents _selectionEvents;
+        private IIdeContext ideContext;
+        //private DirectoryInfo baseDirectoryInfo;
+   
     }
 }



Mime
View raw message