X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mcs%2Fmcs%2Fsettings.cs;h=98083a7e0ec4b46803e1d2eb34a312883e7d7151;hb=77515455734ec5dc00f4550a60a394f8b5a2a36a;hp=0c199017af9b1d4e3e19624afb3563ee9b7705ca;hpb=52cb2c951a414b8f2d6c95b5630c0d1688214a45;p=mono.git diff --git a/mcs/mcs/settings.cs b/mcs/mcs/settings.cs index 0c199017af9..98083a7e0ec 100644 --- a/mcs/mcs/settings.cs +++ b/mcs/mcs/settings.cs @@ -29,9 +29,10 @@ namespace Mono.CSharp { V_4 = 4, V_5 = 5, V_6 = 6, + V_7 = 7, Experimental = 100, - Default = LanguageVersion.V_6, + Default = V_7, } public enum RuntimeVersion @@ -87,6 +88,8 @@ namespace Mono.CSharp { // public List> AssemblyReferencesAliases; + public List> PathMap; + // // Modules to be embedded // @@ -343,7 +346,7 @@ namespace Mono.CSharp { void About () { output.WriteLine ( - "The Mono C# compiler is Copyright 2001-2011, Novell, Inc.\n\n" + + "The Turbo 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" + @@ -581,7 +584,6 @@ namespace Mono.CSharp { public bool ProcessWarningsList (string text, Action 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') @@ -592,15 +594,10 @@ namespace Mono.CSharp { 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) @@ -938,7 +935,7 @@ namespace Mono.CSharp { 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; } @@ -1167,15 +1164,15 @@ namespace Mono.CSharp { case "6": settings.Version = LanguageVersion.V_6; return ParseResult.Success; + case "7": + settings.Version = LanguageVersion.V_7; + return ParseResult.Success; case "experimental": settings.Version = LanguageVersion.Experimental; return ParseResult.Success; - case "future": - report.Warning (8000, 1, "Language version `future' is no longer supported"); - goto case "6"; } - report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 6", value); + report.Error (1617, "Invalid -langversion option `{0}'. It must be `ISO-1', `ISO-2', Default or value in range 1 to 7", value); return ParseResult.Error; case "/codepage": @@ -1201,7 +1198,7 @@ namespace Mono.CSharp { } return ParseResult.Success; - case "runtimemetadataversion": + case "/runtimemetadataversion": if (value.Length == 0) { Error_RequiresArgument (option); return ParseResult.Error; @@ -1210,11 +1207,38 @@ namespace Mono.CSharp { 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> (); + + 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 (key, path)); + } + + return ParseResult.Success; + // csc options that we don't support case "/analyzer": case "/appconfig": case "/baseaddress": case "/deterministic": + case "/deterministic+": + case "/deterministic-": case "/errorendlocation": case "/errorlog": case "/features": @@ -1224,10 +1248,11 @@ namespace Mono.CSharp { case "/link": case "/moduleassemblyname": case "/nowin32manifest": - case "/pathmap": case "/pdb": case "/preferreduilang": case "/publicsign": + case "/publicsign+": + case "/publicsign-": case "/reportanalyzer": case "/ruleset": case "/sqmsessionguid": @@ -1578,7 +1603,7 @@ namespace Mono.CSharp { void Usage () { output.WriteLine ( - "Mono C# compiler, Copyright 2001-2011 Novell, Inc., Copyright 2011-2012 Xamarin, Inc\n" + + "Turbo 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" + @@ -1593,7 +1618,7 @@ namespace Mono.CSharp { " -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" + @@ -1601,6 +1626,7 @@ namespace Mono.CSharp { " -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" +