Fixed argument parsing issues with resources

This commit is contained in:
David Fowler 2015-11-07 01:52:59 -08:00
parent d244b07dc5
commit 8ebc1bf9f5
2 changed files with 8 additions and 9 deletions

View file

@ -38,7 +38,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Csc
syntax.DefineOption("out", ref outputName, "Name of the output assembly"); syntax.DefineOption("out", ref outputName, "Name of the output assembly");
syntax.DefineOptionList("r|reference", ref references, "Path to a compiler metadata reference"); syntax.DefineOptionList("reference", ref references, "Path to a compiler metadata reference");
syntax.DefineOptionList("resource", ref resources, "Resources to embed"); syntax.DefineOptionList("resource", ref resources, "Resources to embed");
@ -95,7 +95,6 @@ namespace Microsoft.DotNet.Tools.Compiler.Csc
? "-debug:full" ? "-debug:full"
: "-debug:portable"); : "-debug:portable");
// TODO: Move mono args to mcs compiler
args.Add("-nowarn:CS1701"); args.Add("-nowarn:CS1701");
args.Add("-nowarn:CS1702"); args.Add("-nowarn:CS1702");
args.Add("-nowarn:CS1705"); args.Add("-nowarn:CS1705");

View file

@ -186,25 +186,25 @@ namespace Microsoft.DotNet.Tools.Compiler
if (projectDependency.Project.Files.SourceFiles.Any()) if (projectDependency.Project.Files.SourceFiles.Any())
{ {
var projectOutputPath = GetProjectOutput(projectDependency.Project, projectDependency.Framework, configuration, outputPath); var projectOutputPath = GetProjectOutput(projectDependency.Project, projectDependency.Framework, configuration, outputPath);
compilerArgs.Add($"-r:{projectOutputPath}"); compilerArgs.Add($"--reference:{projectOutputPath}");
} }
} }
else else
{ {
compilerArgs.AddRange(dependency.CompilationAssemblies.Select(r => $"-r:{r.ResolvedPath}")); compilerArgs.AddRange(dependency.CompilationAssemblies.Select(r => $"--reference:{r.ResolvedPath}"));
} }
compilerArgs.AddRange(dependency.SourceReferences); compilerArgs.AddRange(dependency.SourceReferences);
} }
// Add project source files
var sourceFiles = context.ProjectFile.Files.SourceFiles;
compilerArgs.AddRange(sourceFiles);
if (!AddResources(context.ProjectFile, compilerArgs, intermediateOutputPath)) if (!AddResources(context.ProjectFile, compilerArgs, intermediateOutputPath))
{ {
return false; return false;
} }
// Add project source files
var sourceFiles = context.ProjectFile.Files.SourceFiles;
compilerArgs.AddRange(sourceFiles);
var compilerName = context.ProjectFile.CompilerName; var compilerName = context.ProjectFile.CompilerName;
compilerName = compilerName ?? "csc"; compilerName = compilerName ?? "csc";
@ -495,7 +495,7 @@ namespace Microsoft.DotNet.Tools.Compiler
} }
} }
compilerArgs.Add($"-resource:\"{fileName}\",{name}"); compilerArgs.Add($"--resource:\"{fileName}\",{name}");
} }
return true; return true;