| Newsgroups |
gmane.comp.gnome.mono.patches |
| Message-ID |
<0000014211be6c63-6c97b708-d282-4544-96ce-790bb2630c3f-000000@email.amazonses.com> |
Branch: refs/heads/master
Home: https://github.com/mono/monodevelop
Compare: https://github.com/mono/monodevelop/compare/101c89171005...cb3a3768de46
Commit: c6bc93447f80cbd3685716ab7b4b9a4b264023ad
Author: Therzok <[email protected]> (Therzok)
Date: 2013-11-01 03:34:53 GMT
URL: https://github.com/mono/monodevelop/commit/c6bc93447f80cbd3685716ab7b4b9a4b264023ad
[ILAsmBinding] Cleanup in files.
Changed paths:
M main/src/addins/ILAsmBinding/AddinInfo.cs
M main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
M main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
M main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs
M main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs
Modified: main/src/addins/ILAsmBinding/AddinInfo.cs
===================================================================
@@ -1,7 +1,5 @@
-using System;
using Mono.Addins;
-using Mono.Addins.Description;
[assembly:Addin ("ILAsmBinding",
Namespace = "MonoDevelop",
Modified: main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
===================================================================
@@ -24,7 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using Gtk;
@@ -32,17 +31,17 @@
namespace ILAsmBinding
{
[System.ComponentModel.ToolboxItem(true)]
- partial class CompilerParametersPanelWidget : Gtk.Bin
+ partial class CompilerParametersPanelWidget : Bin
{
public CompilerParametersPanelWidget()
{
this.Build();
- ListStore store = new ListStore (typeof (string));
+ var store = new ListStore (typeof (string));
store.AppendValues (GettextCatalog.GetString ("Executable"));
store.AppendValues (GettextCatalog.GetString ("Library"));
compileTargetCombo.Model = store;
- CellRendererText cr = new CellRendererText ();
+ var cr = new CellRendererText ();
compileTargetCombo.PackStart (cr, true);
compileTargetCombo.AddAttribute (cr, "text", 0);
}
@@ -59,11 +58,7 @@ public void Load (DotNetProject project, DotNetProjectConfiguration configuratio
public void Store ()
{
- if (compileTargetCombo.Active == 0) {
- project.CompileTarget = CompileTarget.Exe;
- } else {
- project.CompileTarget = CompileTarget.Library;
- }
+ project.CompileTarget = compileTargetCombo.Active == 0 ? CompileTarget.Exe : CompileTarget.Library;
configuration.DebugMode = checkbuttonIncludeDebugInfo.Active;
}
}
Modified: main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
===================================================================
@@ -53,10 +53,10 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
// ILAsmCompilerParameters compilerParameters = (ILAsmCompilerParameters)configuration.CompilationParameters ?? new ILAsmCompilerParameters ();
string outputName = configuration.CompiledOutputName;
- StringBuilder sb = new StringBuilder ();
+ var sb = new StringBuilder ();
sb.AppendFormat ("\"/output:{0}\" ", outputName);
- List<string> gacRoots = new List<string> ();
+ var gacRoots = new List<string> ();
switch (configuration.CompileTarget) {
@@ -90,13 +90,13 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
string ilasm = configuration.TargetRuntime.GetToolPath (configuration.TargetFramework, "ilasm");
if (ilasm == null) {
- BuildResult res = new BuildResult ();
+ var res = new BuildResult ();
res.AddError (GettextCatalog.GetString ("IL compiler (ilasm) not found."));
if (configuration.TargetRuntime is MsNetTargetRuntime)
res.AddError (GettextCatalog.GetString ("You may need to install the .NET SDK."));
return res;
}
- string outstr = ilasm + " " + sb.ToString ();
+ string outstr = ilasm + " " + sb;
monitor.Log.WriteLine (outstr);
string workingDir = ".";
@@ -110,7 +110,7 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
workingDir = ".";
}
- LoggingService.LogInfo ("ilasm " + sb.ToString ());
+ LoggingService.LogInfo ("ilasm " + sb);
var envVars = configuration.TargetRuntime.GetToolsExecutionEnvironment (configuration.TargetFramework);
int exitCode = DoCompilation (outstr, workingDir, envVars, gacRoots, ref output, ref error);
@@ -134,11 +134,11 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
static BuildResult ParseOutput (string stdout, string stderr)
{
- BuildResult result = new BuildResult ();
+ var result = new BuildResult ();
- StringBuilder compilerOutput = new StringBuilder ();
+ var compilerOutput = new StringBuilder ();
bool typeLoadException = false;
- foreach (string s in new string[] { stdout, stderr }) {
+ foreach (string s in new [] { stdout, stderr }) {
StreamReader sr = File.OpenText (s);
while (true) {
if (typeLoadException) {
@@ -155,8 +155,8 @@ static BuildResult ParseOutput (string stdout, string stderr)
if (curLine.Length == 0)
continue;
- if (curLine.StartsWith ("Unhandled Exception: System.TypeLoadException") ||
- curLine.StartsWith ("Unhandled Exception: System.IO.FileNotFoundException")) {
+ if (curLine.StartsWith ("Unhandled Exception: System.TypeLoadException", StringComparison.Ordinal) ||
+ curLine.StartsWith ("Unhandled Exception: System.IO.FileNotFoundException", StringComparison.Ordinal)) {
result.ClearErrors ();
typeLoadException = true;
}
@@ -169,7 +169,7 @@ static BuildResult ParseOutput (string stdout, string stderr)
sr.Close();
}
if (typeLoadException) {
- Regex reg = new Regex (@".*WARNING.*used in (mscorlib|System),.*", RegexOptions.Multiline);
+ var reg = new Regex (@".*WARNING.*used in (mscorlib|System),.*", RegexOptions.Multiline);
if (reg.Match (compilerOutput.ToString ()).Success)
result.AddError ("", 0, 0, "", "Error: A referenced assembly may be built with an incompatible CLR version. See the compilation output for more details.");
else
@@ -179,19 +179,19 @@ static BuildResult ParseOutput (string stdout, string stderr)
return result;
}
- static int DoCompilation (string outstr, string working_dir, ExecutionEnvironment envVars, List<string> gacRoots, ref string output, ref string error)
+ static int DoCompilation (string outstr, string workingDir, ExecutionEnvironment envVars, List<string> gacRoots, ref string output, ref string error)
{
output = Path.GetTempFileName();
error = Path.GetTempFileName();
- StreamWriter outwr = new StreamWriter (output);
- StreamWriter errwr = new StreamWriter (error);
+ var outwr = new StreamWriter (output);
+ var errwr = new StreamWriter (error);
string[] tokens = outstr.Split (' ');
outstr = outstr.Substring (tokens[0].Length+1);
- ProcessStartInfo pinfo = new ProcessStartInfo (tokens[0], outstr);
- pinfo.WorkingDirectory = working_dir;
+ var pinfo = new ProcessStartInfo (tokens[0], outstr);
+ pinfo.WorkingDirectory = workingDir;
if (gacRoots.Count > 0) {
// Create the gac prefix string
@@ -208,7 +208,7 @@ static int DoCompilation (string outstr, string working_dir, ExecutionEnvironmen
pinfo.RedirectStandardOutput = true;
pinfo.RedirectStandardError = true;
- MonoDevelop.Core.Execution.ProcessWrapper pw = Runtime.ProcessService.StartProcess (pinfo, outwr, errwr, null);
+ ProcessWrapper pw = Runtime.ProcessService.StartProcess (pinfo, outwr, errwr, null);
pw.WaitForOutput();
int exitCode = pw.ExitCode;
outwr.Close();
@@ -217,21 +217,21 @@ static int DoCompilation (string outstr, string working_dir, ExecutionEnvironmen
return exitCode;
}
- static Regex regexError = new Regex (@"^(\s*(?<file>.*?)\s?\((?<line>\d*)(,\s(?<column>\d*[\+]*))?\)\s(:|)\s+)*(?<level>\w+)\s*(:|(--))\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
- static BuildError CreateErrorFromString (string error_string)
+ static readonly Regex regexError = new Regex (@"^(\s*(?<file>.*?)\s?\((?<line>\d*)(,\s(?<column>\d*[\+]*))?\)\s(:|)\s+)*(?<level>\w+)\s*(:|(--))\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
+ static BuildError CreateErrorFromString (string errorString)
{
// When IncludeDebugInformation is true, prevents the debug symbols stats from breaking this.
- if (error_string.StartsWith ("WROTE SYMFILE") ||
- error_string.StartsWith ("OffsetTable") ||
- error_string.StartsWith ("Compilation succeeded") ||
- error_string.StartsWith ("Compilation failed"))
+ if (errorString.StartsWith ("WROTE SYMFILE", StringComparison.Ordinal) ||
+ errorString.StartsWith ("OffsetTable", StringComparison.Ordinal) ||
+ errorString.StartsWith ("Compilation succeeded", StringComparison.Ordinal) ||
+ errorString.StartsWith ("Compilation failed", StringComparison.Ordinal))
return null;
- Match match = regexError.Match(error_string);
+ Match match = regexError.Match(errorString);
if (!match.Success)
return null;
- BuildError error = new BuildError ();
+ var error = new BuildError ();
error.FileName = match.Result ("${file}") ?? "";
string line = match.Result ("${line}");
Modified: main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs
===================================================================
@@ -49,7 +49,7 @@ class ILAsmLanguageBinding : IDotNetLanguageBinding
public bool IsSourceCodeFile (FilePath fileName)
{
- return string.Compare (Path.GetExtension (fileName), ".il", true) == 0;
+ return String.Compare (Path.GetExtension (fileName), ".il", StringComparison.OrdinalIgnoreCase) == 0;
}
public BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
@@ -83,7 +83,7 @@ public FilePath GetFileName (FilePath baseName)
public ClrVersion[] GetSupportedClrVersions ()
{
- return new ClrVersion[] {
+ return new [] {
ClrVersion.Net_1_1,
ClrVersion.Net_2_0,
ClrVersion.Clr_2_1,
Modified: main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs
===================================================================
@@ -24,8 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-
namespace ILAsmBinding
{
class ILAsmCompilerParameters : MonoDevelop.Projects.ConfigurationParameters
Commit: cb3a3768de4631d3ee592c486cf0ddb4baa5223e
Author: Ungureanu Marius <[email protected]> (Therzok)
Date: 2013-11-01 03:36:23 GMT
URL: https://github.com/mono/monodevelop/commit/cb3a3768de4631d3ee592c486cf0ddb4baa5223e
Merge pull request #425 from mono/ilasmCleanup
[ILAsmBinding] Cleanup in files.
Changed paths:
M main/src/addins/ILAsmBinding/AddinInfo.cs
M main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
M main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
M main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs
M main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs
Modified: main/src/addins/ILAsmBinding/AddinInfo.cs
===================================================================
@@ -1,7 +1,5 @@
-using System;
using Mono.Addins;
-using Mono.Addins.Description;
[assembly:Addin ("ILAsmBinding",
Namespace = "MonoDevelop",
Modified: main/src/addins/ILAsmBinding/Gui/CompilerParametersPanelWidget.cs
===================================================================
@@ -24,7 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
using MonoDevelop.Core;
using MonoDevelop.Projects;
using Gtk;
@@ -32,17 +31,17 @@
namespace ILAsmBinding
{
[System.ComponentModel.ToolboxItem(true)]
- partial class CompilerParametersPanelWidget : Gtk.Bin
+ partial class CompilerParametersPanelWidget : Bin
{
public CompilerParametersPanelWidget()
{
this.Build();
- ListStore store = new ListStore (typeof (string));
+ var store = new ListStore (typeof (string));
store.AppendValues (GettextCatalog.GetString ("Executable"));
store.AppendValues (GettextCatalog.GetString ("Library"));
compileTargetCombo.Model = store;
- CellRendererText cr = new CellRendererText ();
+ var cr = new CellRendererText ();
compileTargetCombo.PackStart (cr, true);
compileTargetCombo.AddAttribute (cr, "text", 0);
}
@@ -59,11 +58,7 @@ public void Load (DotNetProject project, DotNetProjectConfiguration configuratio
public void Store ()
{
- if (compileTargetCombo.Active == 0) {
- project.CompileTarget = CompileTarget.Exe;
- } else {
- project.CompileTarget = CompileTarget.Library;
- }
+ project.CompileTarget = compileTargetCombo.Active == 0 ? CompileTarget.Exe : CompileTarget.Library;
configuration.DebugMode = checkbuttonIncludeDebugInfo.Active;
}
}
Modified: main/src/addins/ILAsmBinding/ILAsmCompilerManager.cs
===================================================================
@@ -53,10 +53,10 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
// ILAsmCompilerParameters compilerParameters = (ILAsmCompilerParameters)configuration.CompilationParameters ?? new ILAsmCompilerParameters ();
string outputName = configuration.CompiledOutputName;
- StringBuilder sb = new StringBuilder ();
+ var sb = new StringBuilder ();
sb.AppendFormat ("\"/output:{0}\" ", outputName);
- List<string> gacRoots = new List<string> ();
+ var gacRoots = new List<string> ();
switch (configuration.CompileTarget) {
@@ -90,13 +90,13 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
string ilasm = configuration.TargetRuntime.GetToolPath (configuration.TargetFramework, "ilasm");
if (ilasm == null) {
- BuildResult res = new BuildResult ();
+ var res = new BuildResult ();
res.AddError (GettextCatalog.GetString ("IL compiler (ilasm) not found."));
if (configuration.TargetRuntime is MsNetTargetRuntime)
res.AddError (GettextCatalog.GetString ("You may need to install the .NET SDK."));
return res;
}
- string outstr = ilasm + " " + sb.ToString ();
+ string outstr = ilasm + " " + sb;
monitor.Log.WriteLine (outstr);
string workingDir = ".";
@@ -110,7 +110,7 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
workingDir = ".";
}
- LoggingService.LogInfo ("ilasm " + sb.ToString ());
+ LoggingService.LogInfo ("ilasm " + sb);
var envVars = configuration.TargetRuntime.GetToolsExecutionEnvironment (configuration.TargetFramework);
int exitCode = DoCompilation (outstr, workingDir, envVars, gacRoots, ref output, ref error);
@@ -134,11 +134,11 @@ public static BuildResult Compile (ProjectItemCollection projectItems, DotNetPro
static BuildResult ParseOutput (string stdout, string stderr)
{
- BuildResult result = new BuildResult ();
+ var result = new BuildResult ();
- StringBuilder compilerOutput = new StringBuilder ();
+ var compilerOutput = new StringBuilder ();
bool typeLoadException = false;
- foreach (string s in new string[] { stdout, stderr }) {
+ foreach (string s in new [] { stdout, stderr }) {
StreamReader sr = File.OpenText (s);
while (true) {
if (typeLoadException) {
@@ -155,8 +155,8 @@ static BuildResult ParseOutput (string stdout, string stderr)
if (curLine.Length == 0)
continue;
- if (curLine.StartsWith ("Unhandled Exception: System.TypeLoadException") ||
- curLine.StartsWith ("Unhandled Exception: System.IO.FileNotFoundException")) {
+ if (curLine.StartsWith ("Unhandled Exception: System.TypeLoadException", StringComparison.Ordinal) ||
+ curLine.StartsWith ("Unhandled Exception: System.IO.FileNotFoundException", StringComparison.Ordinal)) {
result.ClearErrors ();
typeLoadException = true;
}
@@ -169,7 +169,7 @@ static BuildResult ParseOutput (string stdout, string stderr)
sr.Close();
}
if (typeLoadException) {
- Regex reg = new Regex (@".*WARNING.*used in (mscorlib|System),.*", RegexOptions.Multiline);
+ var reg = new Regex (@".*WARNING.*used in (mscorlib|System),.*", RegexOptions.Multiline);
if (reg.Match (compilerOutput.ToString ()).Success)
result.AddError ("", 0, 0, "", "Error: A referenced assembly may be built with an incompatible CLR version. See the compilation output for more details.");
else
@@ -179,19 +179,19 @@ static BuildResult ParseOutput (string stdout, string stderr)
return result;
}
- static int DoCompilation (string outstr, string working_dir, ExecutionEnvironment envVars, List<string> gacRoots, ref string output, ref string error)
+ static int DoCompilation (string outstr, string workingDir, ExecutionEnvironment envVars, List<string> gacRoots, ref string output, ref string error)
{
output = Path.GetTempFileName();
error = Path.GetTempFileName();
- StreamWriter outwr = new StreamWriter (output);
- StreamWriter errwr = new StreamWriter (error);
+ var outwr = new StreamWriter (output);
+ var errwr = new StreamWriter (error);
string[] tokens = outstr.Split (' ');
outstr = outstr.Substring (tokens[0].Length+1);
- ProcessStartInfo pinfo = new ProcessStartInfo (tokens[0], outstr);
- pinfo.WorkingDirectory = working_dir;
+ var pinfo = new ProcessStartInfo (tokens[0], outstr);
+ pinfo.WorkingDirectory = workingDir;
if (gacRoots.Count > 0) {
// Create the gac prefix string
@@ -208,7 +208,7 @@ static int DoCompilation (string outstr, string working_dir, ExecutionEnvironmen
pinfo.RedirectStandardOutput = true;
pinfo.RedirectStandardError = true;
- MonoDevelop.Core.Execution.ProcessWrapper pw = Runtime.ProcessService.StartProcess (pinfo, outwr, errwr, null);
+ ProcessWrapper pw = Runtime.ProcessService.StartProcess (pinfo, outwr, errwr, null);
pw.WaitForOutput();
int exitCode = pw.ExitCode;
outwr.Close();
@@ -217,21 +217,21 @@ static int DoCompilation (string outstr, string working_dir, ExecutionEnvironmen
return exitCode;
}
- static Regex regexError = new Regex (@"^(\s*(?<file>.*?)\s?\((?<line>\d*)(,\s(?<column>\d*[\+]*))?\)\s(:|)\s+)*(?<level>\w+)\s*(:|(--))\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
- static BuildError CreateErrorFromString (string error_string)
+ static readonly Regex regexError = new Regex (@"^(\s*(?<file>.*?)\s?\((?<line>\d*)(,\s(?<column>\d*[\+]*))?\)\s(:|)\s+)*(?<level>\w+)\s*(:|(--))\s*(?<message>.*)", RegexOptions.Compiled | RegexOptions.ExplicitCapture);
+ static BuildError CreateErrorFromString (string errorString)
{
// When IncludeDebugInformation is true, prevents the debug symbols stats from breaking this.
- if (error_string.StartsWith ("WROTE SYMFILE") ||
- error_string.StartsWith ("OffsetTable") ||
- error_string.StartsWith ("Compilation succeeded") ||
- error_string.StartsWith ("Compilation failed"))
+ if (errorString.StartsWith ("WROTE SYMFILE", StringComparison.Ordinal) ||
+ errorString.StartsWith ("OffsetTable", StringComparison.Ordinal) ||
+ errorString.StartsWith ("Compilation succeeded", StringComparison.Ordinal) ||
+ errorString.StartsWith ("Compilation failed", StringComparison.Ordinal))
return null;
- Match match = regexError.Match(error_string);
+ Match match = regexError.Match(errorString);
if (!match.Success)
return null;
- BuildError error = new BuildError ();
+ var error = new BuildError ();
error.FileName = match.Result ("${file}") ?? "";
string line = match.Result ("${line}");
Modified: main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs
===================================================================
@@ -49,7 +49,7 @@ class ILAsmLanguageBinding : IDotNetLanguageBinding
public bool IsSourceCodeFile (FilePath fileName)
{
- return string.Compare (Path.GetExtension (fileName), ".il", true) == 0;
+ return String.Compare (Path.GetExtension (fileName), ".il", StringComparison.OrdinalIgnoreCase) == 0;
}
public BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, IProgressMonitor monitor)
@@ -83,7 +83,7 @@ public FilePath GetFileName (FilePath baseName)
public ClrVersion[] GetSupportedClrVersions ()
{
- return new ClrVersion[] {
+ return new [] {
ClrVersion.Net_1_1,
ClrVersion.Net_2_0,
ClrVersion.Clr_2_1,
Modified: main/src/addins/ILAsmBinding/Project/ILAsmCompilerParameters.cs
===================================================================
@@ -24,8 +24,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-using System;
-
namespace ILAsmBinding
{
class ILAsmCompilerParameters : MonoDevelop.Projects.ConfigurationParameters
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches