Fixed compilation issues with source exports
- Dependencies can have multiple parents. Fix the object model for that. - Also moved shared file resolution to the right spot
This commit is contained in:
parent
25d9b419bc
commit
adaf7f9be4
3 changed files with 9 additions and 10 deletions
|
@ -51,12 +51,11 @@ namespace Microsoft.Extensions.ProjectModel.Compilation
|
|||
private IEnumerable<LibraryExport> ExportLibraries(Func<LibraryDescription, bool> condition)
|
||||
{
|
||||
var seenMetadataReferences = new HashSet<string>();
|
||||
var seenRuntimeReferences = new HashSet<string>();
|
||||
|
||||
// Iterate over libraries in the library manager
|
||||
foreach (var library in LibraryManager.GetLibraries())
|
||||
{
|
||||
if(!condition(library))
|
||||
if (!condition(library))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -78,7 +77,7 @@ namespace Microsoft.Extensions.ProjectModel.Compilation
|
|||
}
|
||||
}
|
||||
|
||||
if (library.Parent != null && Equals(library.Parent.Identity, _rootProject.Identity))
|
||||
if (library.Parents.Contains(_rootProject))
|
||||
{
|
||||
// Only process source references for direct dependencies
|
||||
foreach (var sourceReference in libraryExport.SourceReferences)
|
||||
|
@ -153,12 +152,12 @@ namespace Microsoft.Extensions.ProjectModel.Compilation
|
|||
{
|
||||
compileAssemblies.Add(outputPath);
|
||||
}
|
||||
}
|
||||
|
||||
// Add shared sources
|
||||
foreach (var sharedFile in project.Project.Files.SharedFiles)
|
||||
{
|
||||
sourceReferences.Add(sharedFile);
|
||||
}
|
||||
// Add shared sources
|
||||
foreach (var sharedFile in project.Project.Files.SharedFiles)
|
||||
{
|
||||
sourceReferences.Add(sharedFile);
|
||||
}
|
||||
|
||||
// No support for ref or native in projects, so runtimeAssemblies is just the same as compileAssemblies and nativeLibraries are empty
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace Microsoft.Extensions.ProjectModel
|
|||
|
||||
public LibraryRange RequestedRange { get; }
|
||||
public LibraryIdentity Identity { get; }
|
||||
public LibraryDescription Parent { get; set; }
|
||||
public List<LibraryDescription> Parents { get; set; } = new List<LibraryDescription>();
|
||||
public string Path { get; }
|
||||
public IEnumerable<LibraryRange> Dependencies { get; }
|
||||
public bool Compatible { get; }
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace Microsoft.Extensions.ProjectModel
|
|||
}
|
||||
}
|
||||
|
||||
dep.Parent = library;
|
||||
dep.Parents.Add(library);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue