//
public List<Tuple<string, string>> AssemblyReferencesAliases;
+ public List<KeyValuePair<string, string>> PathMap;
+
//
// Modules to be embedded
//
void About ()
{
output.WriteLine (
- "The Mono C# compiler is Copyright 2001-2011, Novell, Inc.\n\n" +
+ "The Mono C# compiler is Copyright 2001-2011, Novell, Inc. 2011-2016 Xamarin Inc, 2016-2017 Microsoft Corp\n\n" +
"The compiler source code is released under the terms of the \n" +
"MIT X11 or GNU GPL licenses\n\n" +
public bool ProcessWarningsList (string text, Action<int> action)
{
- bool valid = true;
foreach (string wid in text.Split (numeric_value_separator, StringSplitOptions.RemoveEmptyEntries)) {
var warning = wid;
if (warning.Length == 6 && warning [0] == 'C' && warning [1] == 'S')
continue;
}
- if (report.CheckWarningCode (id, Location.Null)) {
- action (id);
- } else {
- report.Error (1904, "`{0}' is not a valid warning number", wid);
- valid = false;
- }
+ action (id);
}
- return valid;
+ return true;
}
void Error_RequiresArgument (string option)
return ParseResult.Success;
case "/debug":
- if (value.Equals ("full", StringComparison.OrdinalIgnoreCase) || value.Equals ("pdbonly", StringComparison.OrdinalIgnoreCase) || idx < 0) {
+ if (value.Equals ("full", StringComparison.OrdinalIgnoreCase) || value.Equals ("pdbonly", StringComparison.OrdinalIgnoreCase) || value.Equals ("portable", StringComparison.OrdinalIgnoreCase) || idx < 0) {
settings.GenerateDebugInfo = true;
return ParseResult.Success;
}
}
return ParseResult.Success;
- case "runtimemetadataversion":
+ case "/runtimemetadataversion":
if (value.Length == 0) {
Error_RequiresArgument (option);
return ParseResult.Error;
settings.RuntimeMetadataVersion = value;
return ParseResult.Success;
+ case "/pathmap":
+ if (value.Length == 0) {
+ return ParseResult.Success;
+ }
+
+ foreach (var pair in value.Split (',')) {
+ var kv = pair.Split ('=');
+ if (kv.Length != 2) {
+ report.Error (8101, "The pathmap option was incorrectly formatted");
+ return ParseResult.Error;
+ }
+
+ if (settings.PathMap == null)
+ settings.PathMap = new List<KeyValuePair<string, string>> ();
+
+ var key = kv [0].TrimEnd (Path.DirectorySeparatorChar);
+ var path = kv [1].TrimEnd (Path.DirectorySeparatorChar);
+ if (key.Length == 0 || path.Length == 0)
+ report.Error (8101, "The pathmap option was incorrectly formatted");
+
+ settings.PathMap.Add (new KeyValuePair<string, string> (key, path));
+ }
+
+ return ParseResult.Success;
+
// csc options that we don't support
- case "/utf8output":
- case "/subsystemversion":
+ case "/analyzer":
+ case "/appconfig":
+ case "/baseaddress":
+ case "/deterministic":
+ case "/deterministic+":
+ case "/deterministic-":
+ case "/errorendlocation":
+ case "/errorlog":
+ case "/features":
case "/highentropyva":
case "/highentropyva+":
case "/highentropyva-":
- case "/win32manifest":
+ case "/link":
+ case "/moduleassemblyname":
case "/nowin32manifest":
+ case "/pdb":
+ case "/preferreduilang":
+ case "/publicsign":
+ case "/publicsign+":
+ case "/publicsign-":
+ case "/reportanalyzer":
+ case "/ruleset":
+ case "/sqmsessionguid":
+ case "/subsystemversion":
+ case "/utf8output":
+ case "/win32manifest":
return ParseResult.Success;
default:
void Usage ()
{
output.WriteLine (
- "Mono C# compiler, Copyright 2001-2011 Novell, Inc., Copyright 2011-2012 Xamarin, Inc\n" +
+ "Mono C# compiler, Copyright 2001-2011 Novell, Inc., 2011-2016 Xamarin, Inc, 2016-2017 Microsoft Corp\n" +
"mcs [options] source-files\n" +
" --about About the Mono C# compiler\n" +
" -addmodule:M1[,Mn] Adds the module to the generated assembly\n" +
" -help Lists all compiler options (short: -?)\n" +
" -keycontainer:NAME The key pair container used to sign the output assembly\n" +
" -keyfile:FILE The key file used to strongname the ouput assembly\n" +
- " -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, 4, 5, Default or Experimental\n" +
+ " -langversion:TEXT Specifies language version: ISO-1, ISO-2, 3, 4, 5, 6, Default or Experimental\n" +
" -lib:PATH1[,PATHn] Specifies the location of referenced assemblies\n" +
" -main:CLASS Specifies the class with the Main method (short: -m)\n" +
" -noconfig Disables implicitly referenced assemblies\n" +
" -nowarn:W1[,Wn] Suppress one or more compiler warnings\n" +
" -optimize[+|-] Enables advanced compiler optimizations (short: -o)\n" +
" -out:FILE Specifies output assembly name\n" +
+ " -pathmap:K=V[,Kn=Vn] Sets a mapping for source path names used in generated output\n" +
" -pkg:P1[,Pn] References packages P1..Pn\n" +
" -platform:ARCH Specifies the target platform of the output assembly\n" +
" ARCH can be one of: anycpu, anycpu32bitpreferred, arm,\n" +