Author: brett
Date: Thu Jan 26 06:54:37 2012
New Revision: 1236053

URL: http://svn.apache.org/viewvc?rev=1236053&view=rev
Log:
support project references that do not have an explicit name, by deriving it 
from the filename of the project

Modified:
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/BaseProjectDigestAlgorithm.cs
    
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/ProjectDigester.cs

Modified: 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/BaseProjectDigestAlgorithm.cs
URL: 
http://svn.apache.org/viewvc/incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/BaseProjectDigestAlgorithm.cs?rev=1236053&r1=1236052&r2=1236053&view=diff
==============================================================================
--- 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/BaseProjectDigestAlgorithm.cs
 (original)
+++ 
incubator/npanday/trunk/dotnet/assemblies/NPanday.ProjectImporter/Engine/src/main/csharp/Digest/Algorithms/BaseProjectDigestAlgorithm.cs
 Thu Jan 26 06:54:37 2012
@@ -29,26 +29,24 @@ namespace NPanday.ProjectImporter.Digest
         {
             Project project = ProjectDigester.GetProject(projectFile);
 
-            if (project == null)
+            if (project != null)
             {
-                if (projectFile != null)
-                    return Path.GetFileNameWithoutExtension(projectFile);
-
-                return null;
-            }
-
-            foreach (BuildPropertyGroup buildPropertyGroup in 
project.PropertyGroups)
-            {
-                foreach (BuildProperty buildProperty in buildPropertyGroup)
+                foreach (BuildPropertyGroup buildPropertyGroup in 
project.PropertyGroups)
                 {
-                    if (!buildProperty.IsImported && 
"AssemblyName".Equals(buildProperty.Name))
+                    foreach (BuildProperty buildProperty in buildPropertyGroup)
                     {
-                        return buildProperty.Value;
-                    }
+                        if (!buildProperty.IsImported && 
"AssemblyName".Equals(buildProperty.Name))
+                        {
+                            return buildProperty.Value;
+                        }
 
+                    }
                 }
             }
 
+            if (projectFile != null)
+                return Path.GetFileNameWithoutExtension(projectFile);
+
             return null;
         }
     }

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=1236053&r1=1236052&r2=1236053&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
 Thu Jan 26 06:54:37 2012
@@ -34,6 +34,8 @@ namespace NPanday.ProjectImporter.Digest
 {
     public sealed class ProjectDigester
     {
+        private static readonly ILog log = 
LogManager.GetLogger(typeof(ProjectDigester));
+
         public delegate ProjectDigest DigestProject(Dictionary<string, object> 
project);
         private static readonly Dictionary<VisualStudioProjectTypeEnum, 
DigestProject> _digestAlgoritms;
 
@@ -103,18 +105,19 @@ namespace NPanday.ProjectImporter.Digest
             {
                 foreach (ProjectReference projectReference in 
projectDigest.ProjectReferences)
                 {
-                    if (string.IsNullOrEmpty(projectReference.Name) 
-                        || 
!projDigestDictionary.ContainsKey(projectReference.Name))
+                    string refName = projectReference.Name;
+
+                    if (!projDigestDictionary.ContainsKey(refName))
                     {
                         Project prjRef = 
GetProject(projectReference.ProjectFullPath);
                         if (prjRef == null)
                         {
                             // this might not be possible
                             warningMsg = string.Format(
-                            "{0}\n    Missing Project Reference {1} located at 
{2}!"+
-                            "\n        Note this might cause Missing Artifact 
Dependency!", 
+                            "{0}\n    Missing project reference {1} located at 
{2}!"+
+                            "\n        Note this might cause a missing 
artifact dependency!", 
                                 warningMsg,
-                                projectReference.Name,
+                                refName,
                                 projectReference.ProjectFullPath);
                             continue;
                         }
@@ -126,7 +129,7 @@ namespace NPanday.ProjectImporter.Digest
 
                         ProjectDigest prjRefDigest = digestProject(projectMap);
                         string errMsg = string.Format(
-                            "Project \"{0}\"  Requires \"{1}\" which is not 
included in the Solution File, "
+                            "Project \"{0}\"  requires \"{1}\" which is not 
included in the Solution File, "
                             + "\nWould you like to include \"{1}\" Generating 
NPanday Project Poms?"
                             + "\nNote: Not adding \"{1}\" will result to a 
missing Artifact Dependency \"{1}\"",
                             projectDigest.ProjectName,


Reply via email to