You are viewing a plain text version of this content. The canonical link for it is here.
Posted to npanday-commits@incubator.apache.org by br...@apache.org on 2013/03/11 13:18:24 UTC

svn commit: r1455130 - in /incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp: ./ Digest/ Digest/Algorithms/

Author: brett
Date: Mon Mar 11 13:18:24 2013
New Revision: 1455130

URL: http://svn.apache.org/r1455130
Log:
[NPANDAY-578] apply GAC rule to project digest as well

Modified:
    incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/IProjectDigestAlgorithm.cs
    incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/NormalProjectDigestAlgorithm.cs
    incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/WebProjectDigestAlgorithm.cs
    incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/ProjectDigester.cs
    incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/NPandayImporter.cs

Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/IProjectDigestAlgorithm.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/IProjectDigestAlgorithm.cs?rev=1455130&r1=1455129&r2=1455130&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/IProjectDigestAlgorithm.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/IProjectDigestAlgorithm.cs Mon Mar 11 13:18:24 2013
@@ -30,6 +30,6 @@ namespace NPanday.ProjectImporter.Digest
 {
     public interface IProjectDigestAlgorithm
     {
-        ProjectDigest DigestProject(Dictionary<string, object> projectMap);
+        ProjectDigest DigestProject(Dictionary<string, object> projectMap, DependencySearchConfiguration depSearchConfig);
     }
 }

Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/NormalProjectDigestAlgorithm.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/NormalProjectDigestAlgorithm.cs?rev=1455130&r1=1455129&r2=1455130&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/NormalProjectDigestAlgorithm.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/NormalProjectDigestAlgorithm.cs Mon Mar 11 13:18:24 2013
@@ -40,7 +40,7 @@ namespace NPanday.ProjectImporter.Digest
     {
         private static readonly ILog log = LogManager.GetLogger(typeof(NormalProjectDigestAlgorithm));
 
-        public ProjectDigest DigestProject(Dictionary<string, object> projectMap)
+        public ProjectDigest DigestProject(Dictionary<string, object> projectMap, DependencySearchConfiguration depSearchConfig)
         {
             Project project = (Project)projectMap["Project"];
 
@@ -66,6 +66,8 @@ namespace NPanday.ProjectImporter.Digest
             if (projectMap.ContainsKey("Configuration"))
                 projectDigest.Configuration = projectMap["Configuration"].ToString();
 
+            projectDigest.DependencySearchConfig = depSearchConfig;
+
             FileInfo existingPomFile = new FileInfo(Path.Combine(projectDigest.FullDirectoryName, "pom.xml"));
             if (existingPomFile.Exists)
             {
@@ -279,6 +281,9 @@ namespace NPanday.ProjectImporter.Digest
                                 projectReferences.Add(prjRef);
                                 break;
                             case "Reference":
+                                // TODO: significant refactoring needed here - it should be calling the same resolution code that is in
+                                //   AbstractPomConverter to find the right artifact based on the simple name
+
                                 Reference reference = new Reference(projectBasePath);
                                 //set processorArchitecture property to platform, it will be used by GacUtility in 
                                 // order to resolve artifact to right processor architecture
@@ -303,7 +308,7 @@ namespace NPanday.ProjectImporter.Digest
                                         // complete name
                                         reference.SetAssemblyInfoValues(buildItem.Include);
                                     }
-                                    else if (!rsp.IsRspIncluded(buildItem.Include,projectDigest.Language))
+                                    else if (!rsp.IsRspIncluded(buildItem.Include,projectDigest.Language) && projectDigest.DependencySearchConfig.SearchGac)
                                     {
                                         // simple name needs to be resolved
                                         List<string> refs = GacUtility.GetInstance().GetAssemblyInfo(buildItem.Include, null, null);

Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/WebProjectDigestAlgorithm.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/WebProjectDigestAlgorithm.cs?rev=1455130&r1=1455129&r2=1455130&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/WebProjectDigestAlgorithm.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/WebProjectDigestAlgorithm.cs Mon Mar 11 13:18:24 2013
@@ -38,7 +38,7 @@ namespace NPanday.ProjectImporter.Digest
 {
     public class WebProjectDigestAlgorithm : BaseProjectDigestAlgorithm, IProjectDigestAlgorithm
     {
-        public ProjectDigest DigestProject(Dictionary<string, object> projectMap)
+        public ProjectDigest DigestProject(Dictionary<string, object> projectMap, DependencySearchConfiguration depSearchConfig)
         {
             ProjectDigest projectDigest = new ProjectDigest();
             projectDigest.ProjectType = (VisualStudioProjectTypeEnum)projectMap["ProjectType"];
@@ -48,6 +48,7 @@ namespace NPanday.ProjectImporter.Digest
                 projectDigest.TargetFramework = projectMap["TargetFramework"].ToString();
             if (projectMap.ContainsKey("Configuration"))
                 projectDigest.Configuration = projectMap["Configuration"].ToString();
+            projectDigest.DependencySearchConfig = depSearchConfig;
 
             FileInfo existingPomFile = new FileInfo(Path.Combine(projectDigest.FullDirectoryName, "pom.xml"));
             if(existingPomFile.Exists)

Modified: incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/ProjectDigester.cs
URL: http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/ProjectDigester.cs?rev=1455130&r1=1455129&r2=1455130&view=diff
==============================================================================
--- incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/ProjectDigester.cs (original)
+++ incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/ProjectDigester.cs Mon Mar 11 13:18:24 2013
@@ -36,7 +36,7 @@ namespace NPanday.ProjectImporter.Digest
     {
         private static readonly ILog log = LogManager.GetLogger(typeof(ProjectDigester));
 
-        public delegate ProjectDigest DigestProject(Dictionary<string, object> project);
+        public delegate ProjectDigest DigestProject(Dictionary<string, object> project, DependencySearchConfiguration depSearchConfig);
         private static readonly Dictionary<VisualStudioProjectTypeEnum, DigestProject> _digestAlgoritms;
 
         static ProjectDigester()
@@ -78,7 +78,7 @@ namespace NPanday.ProjectImporter.Digest
 
         
 
-        public static ProjectDigest[] DigestProjects(List<Dictionary<string, object>> projects, ref string warningMsg)
+        public static ProjectDigest[] DigestProjects(List<Dictionary<string, object>> projects, DependencySearchConfiguration depSearchConfig, ref string warningMsg)
         {
             List<ProjectDigest> projectDigests = new List<ProjectDigest>();
             Dictionary<string, ProjectDigest> projDigestDictionary = new Dictionary<string, ProjectDigest>();
@@ -87,7 +87,7 @@ namespace NPanday.ProjectImporter.Digest
             foreach (Dictionary<string, object> project in projects)
             {
                 DigestProject digestProject = _digestAlgoritms[(VisualStudioProjectTypeEnum)project["ProjectType"]];
-                ProjectDigest projDigest = digestProject(project);
+                ProjectDigest projDigest = digestProject(project, depSearchConfig);
                 projectDigests.Add(projDigest);
                 if (projDigestDictionary.ContainsKey(projDigest.ProjectName))
                 {
@@ -129,7 +129,7 @@ namespace NPanday.ProjectImporter.Digest
                         Dictionary<string, object> projectMap = new Dictionary<string, object>();
                         projectMap.Add("Project", prjRef);
 
-                        ProjectDigest prjRefDigest = digestProject(projectMap);
+                        ProjectDigest prjRefDigest = digestProject(projectMap, depSearchConfig);
                         string errMsg = string.Format(
                             "Project \"{0}\"  requires \"{1}\" which is not included in the Solution File, "
                             + "\nWould you like to include \"{1}\" Generating NPanday Project Poms?"

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=1455130&r1=1455129&r2=1455130&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 Mon Mar 11 13:18:24 2013
@@ -211,7 +211,7 @@ namespace NPanday.ProjectImporter
             //Checks for Invalid folder structure
             HasValidFolderStructure(list);
 
-            ProjectDigest[] prjDigests = DigestProjects(list, ref warningMsg);
+            ProjectDigest[] prjDigests = DigestProjects(list, depSearchConfig, ref warningMsg);
 
 
             ProjectStructureType structureType = GetProjectStructureType(solutionFile, prjDigests);
@@ -320,9 +320,9 @@ namespace NPanday.ProjectImporter
         /// </summary>
         /// <param name="projects">list retured from ParseSolution</param>
         /// <returns></returns>
-        public static ProjectDigest[] DigestProjects(List<Dictionary<string, object>> projects, ref string warningMsg)
+        public static ProjectDigest[] DigestProjects(List<Dictionary<string, object>> projects, DependencySearchConfiguration depSearchConfig, ref string warningMsg)
         {
-            return ProjectDigester.DigestProjects(projects, ref warningMsg);
+            return ProjectDigester.DigestProjects(projects, depSearchConfig, ref warningMsg);
         }
 
         /// <summary>