Author: brett
Date: Sat Mar  2 01:49:41 2013
New Revision: 1451814

URL: http://svn.apache.org/r1451814
Log:
[NPANDAY-579] add support for copying to the local repo

Modified:
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AbstractPomConverter.cs
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/DependencySearchConfiguration.cs
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPandayImporter.cs
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.Designer.cs
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.cs

Modified: 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AbstractPomConverter.cs
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AbstractPomConverter.cs?rev=1451814&r1=1451813&r2=1451814&view=diff
==============================================================================
--- 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AbstractPomConverter.cs
 (original)
+++ 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AbstractPomConverter.cs
 Sat Mar  2 01:49:41 2013
@@ -841,7 +841,7 @@ namespace NPanday.ProjectImporter.Conver
                     // Note that a "provided" scope may be more appropriate 
here, if NPanday were to support it
                     // This could likewise replace the GAC types as all of 
that lookup should occur at build time
 
-                    WarnNonPortableReference(path);
+                    WarnNonPortableReference(path, reference);
 
                     string var = "npanday." + entry.Key;
                     AddProperty(var, directory);
@@ -1002,10 +1002,15 @@ namespace NPanday.ProjectImporter.Conver
             return null;
         }
 
-        private void WarnNonPortableReference(string path)
+        private void WarnNonPortableReference(string path, Reference reference)
         {
             log.WarnFormat("Adding non-portable reference to POM: {0}", path);
 
+            if (projectDigest.DependencySearchConfig.CopyToMaven)
+            {
+                RepositoryUtility.InstallAssembly(path, reference.Name, 
reference.Name, reference.Version ?? "1.0.0.0");
+            }
+
             nonPortableReferences.Add(path);
         }
 
@@ -1017,7 +1022,7 @@ namespace NPanday.ProjectImporter.Conver
                 //verbose for new-import
                 if 
(!reference.HintFullPath.ToLower().StartsWith(prjRefPath.ToLower()) && 
!reference.Name.Contains("Interop"))
                 {
-                    WarnNonPortableReference(reference.HintFullPath);
+                    WarnNonPortableReference(reference.HintFullPath, 
reference);
 
                     return CreateDependencyFromSystemPath(reference, 
reference.HintFullPath);
                 }

Modified: 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/DependencySearchConfiguration.cs
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/DependencySearchConfiguration.cs?rev=1451814&r1=1451813&r2=1451814&view=diff
==============================================================================
--- 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/DependencySearchConfiguration.cs
 (original)
+++ 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/DependencySearchConfiguration.cs
 Sat Mar  2 01:49:41 2013
@@ -35,5 +35,8 @@ namespace NPanday.ProjectImporter
 
         private bool searchGac = true;
         public bool SearchGac { get { return searchGac; } set { searchGac = 
value; } }
+
+        private bool copyToMaven = false;
+        public bool CopyToMaven { get { return copyToMaven; } set { 
copyToMaven = value; } }
     }
 }

Modified: 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPandayImporter.cs
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPandayImporter.cs?rev=1451814&r1=1451813&r2=1451814&view=diff
==============================================================================
--- 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPandayImporter.cs
 (original)
+++ 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPandayImporter.cs
 Sat Mar  2 01:49:41 2013
@@ -188,6 +188,9 @@ namespace NPanday.ProjectImporter
         {
             string[] result = null;
 
+            if (depSearchConfig == null)
+                depSearchConfig = new DependencySearchConfiguration();
+
             FileInfo solutionFileInfo = new FileInfo(solutionFile);
 
             List<Dictionary<string, object>> list = 
ParseSolution(solutionFileInfo, ref warningMsg);
@@ -221,7 +224,7 @@ namespace NPanday.ProjectImporter
                     // set the project flag so that converters can look at it 
later
                     pDigest.UseMsDeploy = useMsDeploy;
                     pDigest.CloudConfig = cloudConfig;
-                    pDigest.DependencySearchConfig = depSearchConfig != null ? 
depSearchConfig : new DependencySearchConfiguration();
+                    pDigest.DependencySearchConfig = depSearchConfig;
                     filteredPrjDigests.Add(pDigest);
                 }
                 else
@@ -263,9 +266,18 @@ namespace NPanday.ProjectImporter
             }
             if (nonPortableReferences.Count > 0)
             {
-                warningMsg += "\nThe build may not be portable if local 
references are used:"
+                if (depSearchConfig.CopyToMaven)
+                {
+                    warningMsg += "The following artifacts were copied to the 
local Maven repository:"
+                         + "\n\t" + string.Join("\n\t", 
nonPortableReferences.ToArray())
+                         + "\nDeploying the reference to a Repository will 
make the code portable to other machines";
+                }
+                else
+                {
+                    warningMsg += "\nThe build may not be portable if local 
references are used:"
                          + "\n\t" + string.Join("\n\t", 
nonPortableReferences.ToArray())
                          + "\nDeploying the reference to a Repository will 
make the code portable to other machines";
+                }
             }
             return result;
         }

Modified: 
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.Designer.cs
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.Designer.cs?rev=1451814&r1=1451813&r2=1451814&view=diff
==============================================================================
--- 
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.Designer.cs
 (original)
+++ 
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.Designer.cs
 Sat Mar  2 01:49:41 2013
@@ -68,6 +68,7 @@ namespace NPanday.VisualStudio.Addin
             this.searchGacCheckBox = new System.Windows.Forms.CheckBox();
             this.searchRefAssembliesCheckBox = new 
System.Windows.Forms.CheckBox();
             this.searchFrameworkCheckBox = new System.Windows.Forms.CheckBox();
+            this.copyToMavenCheckBox = new System.Windows.Forms.CheckBox();
             this.groupBox1.SuspendLayout();
             this.SuspendLayout();
             // 
@@ -267,12 +268,23 @@ namespace NPanday.VisualStudio.Addin
             this.searchFrameworkCheckBox.Text = "Framework";
             this.searchFrameworkCheckBox.UseVisualStyleBackColor = true;
             // 
+            // copyToMavenCheckBox
+            // 
+            this.copyToMavenCheckBox.AutoSize = true;
+            this.copyToMavenCheckBox.Location = new System.Drawing.Point(549, 
118);
+            this.copyToMavenCheckBox.Name = "copyToMavenCheckBox";
+            this.copyToMavenCheckBox.Size = new System.Drawing.Size(180, 17);
+            this.copyToMavenCheckBox.TabIndex = 3;
+            this.copyToMavenCheckBox.Text = "Copy to Local Maven Repository";
+            this.copyToMavenCheckBox.UseVisualStyleBackColor = true;
+            // 
             // NPandayImportProjectForm
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(734, 280);
             this.ControlBox = false;
+            this.Controls.Add(this.copyToMavenCheckBox);
             this.Controls.Add(this.groupBox1);
             this.Controls.Add(this.cloudConfigComboBox);
             this.Controls.Add(this.configComboBox);
@@ -324,5 +336,6 @@ namespace NPanday.VisualStudio.Addin
         private System.Windows.Forms.CheckBox searchGacCheckBox;
         private System.Windows.Forms.CheckBox searchRefAssembliesCheckBox;
         private System.Windows.Forms.CheckBox searchFrameworkCheckBox;
+        private System.Windows.Forms.CheckBox copyToMavenCheckBox;
     }
 }

Modified: 
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.cs
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.cs?rev=1451814&r1=1451813&r2=1451814&view=diff
==============================================================================
--- 
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.cs
 (original)
+++ 
incubator/npanday/trunk/dotnet/assemblies/NPanday.VisualStudio.Addin/src/main/csharp/NPandayImportProjectForm.cs
 Sat Mar  2 01:49:41 2013
@@ -262,6 +262,7 @@ namespace NPanday.VisualStudio.Addin
             depSearchConfig.SearchFramework = searchFrameworkCheckBox.Checked;
             depSearchConfig.SearchReferenceAssemblies = 
searchRefAssembliesCheckBox.Checked;
             depSearchConfig.SearchGac = searchGacCheckBox.Checked;
+            depSearchConfig.CopyToMaven = copyToMavenCheckBox.Checked;
 
             //Refactored code for easier Unit Testing
             try


Reply via email to