Author: brett
Date: Thu Aug 15 09:03:52 2013
New Revision: 1514210

URL: http://svn.apache.org/r1514210
Log:
[NPANDAY-579] Don't add transitive dependency if copied to local repository

In this instance, the dependency will be available transitively, so there is
no need to add it to the POM. This is only required if we are using the
system pathed DLL where no transitive dependency information will be
available.

Modified:
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Converter/Algorithms/AbstractPomConverter.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=1514210&r1=1514209&r2=1514210&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
 Thu Aug 15 09:03:52 2013
@@ -919,7 +919,7 @@ namespace NPanday.ProjectImporter.Conver
 
                     if (warnNonPortable)
                     {
-                        WarnNonPortableReference(path, refDependency, 
GetReferencedAssemblies(path));
+                        WarnNonPortableReference(path, refDependency);
                     }
                     else
                     {
@@ -1109,8 +1109,10 @@ namespace NPanday.ProjectImporter.Conver
             return null;
         }
 
-        private void WarnNonPortableReference(string path, Dependency 
refDependency, List<Dependency> dependencies)
+        private void WarnNonPortableReference(string path, Dependency 
refDependency)
         {
+            List<Dependency> dependencies = GetReferencedAssemblies(path);
+
             if (projectDigest.DependencySearchConfig.CopyToMaven)
             {
                 log.InfoFormat("Copying to Maven local repository: {0} as 
{1}:{2}:{3}", path, refDependency.groupId, refDependency.artifactId, 
refDependency.version);
@@ -1132,6 +1134,12 @@ namespace NPanday.ProjectImporter.Conver
             }
             else
             {
+                // Add dependencies to the POM as well, in case transitive 
dependency is not available later
+                foreach (Dependency d in dependencies)
+                {
+                    AddDependency(d);
+                }
+
                 // if it is in the project, we still consider it non-portable 
because packaging plugins will exclude system dependencies
                 // it would be nice to adjust the path to be a bit more 
portable across different checkouts like below, however basedir
                 // will not resolve correctly as a transitive dependency
@@ -1168,10 +1176,7 @@ namespace NPanday.ProjectImporter.Conver
 
                     log.DebugFormat("Resolved {0} from hint path: 
{1}:{2}:{3}", name, refDependency.groupId, refDependency.artifactId, 
refDependency.version);
 
-                    // this will pick up some NuGet packaged references
-                    List<Dependency> dependencies = 
GetReferencedAssemblies(hintFullPath);
-
-                    WarnNonPortableReference(hintFullPath, refDependency, 
dependencies);
+                    WarnNonPortableReference(hintFullPath, refDependency);
 
                     return refDependency;
                 }
@@ -1218,9 +1223,6 @@ namespace NPanday.ProjectImporter.Conver
                 if (d != null)
                 {
                     dependencies.Add(d);
-
-                    // Add it to the POM as well, in case transitive 
dependency is not available later
-                    AddDependency(d);
                 }
             }
 


Reply via email to