bool TryResolveFromPackagePath(CompilationLibrary library, string basePath, out IEnumerable <string> results) { var paths = new List <string>(); foreach (var assembly in library.Assemblies) { if (!ResolverUtils.TryResolveAssemblyFile(fileSystem, basePath, assembly, out var fullName)) { // if one of the files can't be found, skip this package path completely. // there are package paths that don't include all of the "ref" assemblies // (ex. ones created by 'dotnet store') results = null; return(false); } paths.Add(fullName); } results = paths; return(true); }
public bool TryResolveAssemblyPaths(CompilationLibrary library, List <string> assemblies) { if (nugetPackageDirectories.Count == 0 || !string.Equals(library.Type, "package", StringComparison.OrdinalIgnoreCase)) { return(false); } foreach (var directory in nugetPackageDirectories) { if (ResolverUtils.TryResolvePackagePath(fileSystem, library, directory, out var packagePath)) { if (TryResolveFromPackagePath(library, packagePath, out var fullPathsFromPackage)) { assemblies.AddRange(fullPathsFromPackage); return(true); } } } return(false); }