Fix unix bug.

crossgen fails on unix if there is an empty path passed as input to
"-platform_assemblies_paths".
This commit is contained in:
Sridhar Periyasamy 2016-04-14 18:54:25 -07:00
parent 59f81484bb
commit afafe80084

View file

@ -92,11 +92,14 @@ namespace Microsoft.DotNet.Cli.Build
// The right fix -
// If the assembly has deps.json then parse the json file to get all the dependencies. Pass these dependencies as input to crossgen.
// else pass the current directory of assembly as input to crossgen.
string addtionalPaths = string.Join(";", Directory.GetDirectories(pathToAssemblies, "*", SearchOption.AllDirectories));
var addtionalPaths = Directory.GetDirectories(pathToAssemblies, "*", SearchOption.AllDirectories).ToList();
var paths = new List<string>() { sharedFxPath, pathToAssemblies };
paths.AddRange(addtionalPaths);
var platformAssembliesPaths = string.Join(";", paths.Distinct());
IList<string> crossgenArgs = new List<string> {
"-readytorun", "-in", file, "-out", tempPathName,
"-platform_assemblies_paths", $"{sharedFxPath};{pathToAssemblies};{addtionalPaths}"
"-platform_assemblies_paths", platformAssembliesPaths
};
var env = new Dictionary<string, string>()