Include project-2-project references when parsing csproj file

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-06-30 20:13:01 -07:00
parent afc5979c10
commit 188a0b5314

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
@@ -36,12 +35,21 @@ namespace Orchard.Environment.Extensions.Compilers {
}
private IEnumerable<ReferenceDescriptor> GetReferences(XDocument document) {
return document
var assemblyReferences = document
.Elements(ns("Project"))
.Elements(ns("ItemGroup"))
.Elements(ns("Reference"))
.Attributes("Include")
.Select(c => new ReferenceDescriptor { AssemblyName = ExtractAssemblyName(c.Value) });
var projectReferences = document
.Elements(ns("Project"))
.Elements(ns("ItemGroup"))
.Elements(ns("ProjectReference"))
.Attributes("Include")
.Select(c => new ReferenceDescriptor { AssemblyName = Path.GetFileNameWithoutExtension(c.Value) });
return assemblyReferences.Union(projectReferences);
}
private static string ExtractAssemblyName(string value) {