[Monodevelop-patches-list] r2130 - in trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding: . Gui Project
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Thu Jan 13 19:28:21 EST 2005
Author: lluis
Date: 2005-01-13 19:28:21 -0500 (Thu, 13 Jan 2005)
New Revision: 2130
Removed:
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs
Modified:
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmBinding.addin.xml
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am
trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs
Log:
2005-01-11 Lluis Sanchez Gual <lluis at novell.com>
* ILAsmCompilerManager.cs:
* Gui/CompilerParametersPanel.cs:
* ILAsmBinding.addin.xml:
* ILAsmLanguageBinding.cs: Follow architecture changes.
* Project/ILAsmProject.cs: Removed. Not needed any more.
* Project/ILAsmCompilerParameters.cs: All parameters have been moved to
DotNetProjectConfiguration.
* Project/CompilationTarget.cs: Moved to Monodevelop.Base.
* Makefile.am: Updated.
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog 2005-01-14 00:28:21 UTC (rev 2130)
@@ -1,3 +1,16 @@
+2005-01-11 Lluis Sanchez Gual <lluis at novell.com>
+
+ * ILAsmCompilerManager.cs:
+ * Gui/CompilerParametersPanel.cs:
+ * ILAsmBinding.addin.xml:
+ * ILAsmLanguageBinding.cs: Follow architecture changes.
+
+ * Project/ILAsmProject.cs: Removed. Not needed any more.
+ * Project/ILAsmCompilerParameters.cs: All parameters have been moved to
+ DotNetProjectConfiguration.
+ * Project/CompilationTarget.cs: Moved to Monodevelop.Base.
+ * Makefile.am: Updated.
+
2004-12-13 Lluis Sanchez Gual <lluis at novell.com>
* ILAsmCompilerManager.cs: StatusBarService.ProgressMonitor is not a
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs 2005-01-14 00:28:21 UTC (rev 2130)
@@ -22,6 +22,8 @@
public class CompilerParametersPanel : AbstractOptionPanel
{
ILAsmCompilerParameters compilerParameters = null;
+ DotNetProjectConfiguration configuration;
+
Entry outputPath = new Entry ();
Entry assemblyName = new Entry ();
RadioButton exeTarget = new RadioButton ("exe");
@@ -30,7 +32,8 @@
public override void LoadPanelContents()
{
- this.compilerParameters = (ILAsmCompilerParameters)((IProperties)CustomizationObject).GetProperty("Config");
+ configuration = (DotNetProjectConfiguration)((IProperties)CustomizationObject).GetProperty("Config");
+ compilerParameters = (ILAsmCompilerParameters) configuration.CompilationParameters;
dllTarget = new RadioButton (exeTarget, "dll");
SetupUI ();
@@ -40,13 +43,13 @@
public override bool StorePanelContents()
{
- compilerParameters.AssemblyName = assemblyName.Text;
- compilerParameters.OutputPath = outputPath.Text;
- compilerParameters.IncludeDebugInformation = debug.Active;
+ configuration.OutputAssembly = assemblyName.Text;
+ configuration.OutputDirectory = outputPath.Text;
+ configuration.DebugMode = debug.Active;
if (exeTarget.Active)
- compilerParameters.CompilationTarget = CompilationTarget.Exe;
+ configuration.CompileTarget = CompileTarget.Exe;
else
- compilerParameters.CompilationTarget = CompilationTarget.Dll;
+ configuration.CompileTarget = CompileTarget.Library;
return true;
}
@@ -73,13 +76,13 @@
void RestoreValues ()
{
- assemblyName.Text = compilerParameters.AssemblyName;
- outputPath.Text = compilerParameters.OutputPath;
- if (compilerParameters.CompilationTarget == CompilationTarget.Exe)
+ assemblyName.Text = configuration.OutputAssembly;
+ outputPath.Text = configuration.OutputDirectory;
+ if (configuration.CompileTarget == CompileTarget.Exe)
exeTarget.Active = true;
else
dllTarget.Active = true;
- debug.Active = compilerParameters.IncludeDebugInformation;
+ debug.Active = configuration.DebugMode;
}
}
}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmBinding.addin.xml
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmBinding.addin.xml 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmBinding.addin.xml 2005-01-14 00:28:21 UTC (rev 2130)
@@ -15,7 +15,7 @@
</Extension>
<Extension path = "/SharpDevelop/Workbench/ProjectOptions/ConfigurationProperties">
- <Conditional activeproject = "ILAsm">
+ <Conditional activelanguage = "ILAsm">
<DialogPanel id = "ILAsmCompilerParametersPanel"
_label = "Compiler"
class = "ILAsmBinding.CompilerParametersPanel"/>
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs 2005-01-14 00:28:21 UTC (rev 2130)
@@ -29,25 +29,12 @@
{
FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
- public string GetCompiledOutputName(string fileName)
- {
- return Path.ChangeExtension(fileName, ".exe");
- }
-
- public string GetCompiledOutputName(IProject project)
- {
- ILAsmProject p = (ILAsmProject)project;
- ILAsmCompilerParameters compilerparameters = (ILAsmCompilerParameters)p.ActiveConfiguration;
- string exe = fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + ".exe";
- return exe;
- }
-
public bool CanCompile(string fileName)
{
return Path.GetExtension(fileName).ToUpper() == ".IL";
}
- ICompilerResult Compile(ILAsmCompilerParameters compilerparameters, string[] fileNames)
+ ICompilerResult Compile (DotNetProjectConfiguration configuration, string[] fileNames)
{
// TODO: No response file possible ? @FILENAME seems not to work.
StringBuilder parameters = new StringBuilder();
@@ -57,11 +44,25 @@
parameters.Append("\" ");
}
- string outputFile = Path.GetFullPath(fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + ".exe");
+ string outputFile = configuration.CompiledOutputName;
Console.WriteLine (outputFile);
parameters.Append("/out:" + outputFile);
parameters.Append(" ");
- parameters.Append(compilerparameters.CurrentCompilerOptions.GenerateOptions());
+
+ switch (configuration.CompileTarget) {
+ case CompileTarget.Library:
+ parameters.Append("/dll ");
+ break;
+ case CompileTarget.Exe:
+ parameters.Append("/exe ");
+ break;
+ default:
+ throw new System.NotSupportedException("Unsupported compilation target : " + configuration.CompileTarget);
+ }
+
+ if (configuration.DebugMode)
+ parameters.Append("/DEBUG ");
+
string outstr = parameters.ToString();
TempFileCollection tf = new TempFileCollection();
@@ -103,22 +104,11 @@
p.WaitForExit ();
}
- public ICompilerResult CompileFile(string fileName, ILAsmCompilerParameters compilerparameters)
+ public ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration)
{
- compilerparameters.OutputDirectory = Path.GetDirectoryName(fileName);
- compilerparameters.OutputAssembly = Path.GetFileNameWithoutExtension(fileName);
-
- return Compile(compilerparameters, new string[] { fileName });
- }
-
- public ICompilerResult CompileProject(IProject project)
- {
- ILAsmProject p = (ILAsmProject)project;
- ILAsmCompilerParameters compilerparameters = (ILAsmCompilerParameters)p.ActiveConfiguration;
-
ArrayList fileNames = new ArrayList();
- foreach (ProjectFile finfo in p.ProjectFiles) {
+ foreach (ProjectFile finfo in projectFiles) {
if (finfo.Subtype != Subtype.Directory) {
switch (finfo.BuildAction) {
case BuildAction.Compile:
@@ -132,7 +122,7 @@
}
}
- return Compile(compilerparameters, (string[])fileNames.ToArray(typeof(string)));
+ return Compile (configuration, (string[])fileNames.ToArray(typeof(string)));
}
string GetCompilerName()
Deleted: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs 2005-01-14 00:28:21 UTC (rev 2130)
@@ -1,59 +0,0 @@
-// <file>
-// <copyright see="prj:///doc/copyright.txt"/>
-// <license see="prj:///doc/license.txt"/>
-// <owner name="Mike Krueger" email="mike at icsharpcode.net"/>
-// <version value="$version"/>
-// </file>
-
-using System;
-using System.IO;
-using System.Diagnostics;
-using System.Collections;
-using System.Reflection;
-using System.Resources;
-using System.Xml;
-using System.CodeDom.Compiler;
-using System.Threading;
-using Gtk;
-
-using MonoDevelop.Internal.Project;
-using MonoDevelop.Gui;
-using MonoDevelop.Services;
-using MonoDevelop.Core.Services;
-
-namespace ILAsmBinding
-{
- /// <summary>
- /// This class describes the main functionalaty of a language codon
- /// </summary>
- public class ILAsmExecutionManager
- {
- public void Execute(string filename, bool debug)
- {
- string exe = Path.ChangeExtension(filename, ".exe");
- ProcessStartInfo psi = new ProcessStartInfo("\"" + exe + "\"");
- psi.WorkingDirectory = Path.GetDirectoryName(exe);
- psi.UseShellExecute = true;
-
- //DebuggerService debuggerService = (DebuggerService)ServiceManager.Services.GetService(typeof(DebuggerService));
- //debuggerService.StartWithoutDebugging(psi);
- }
-
- public void Execute(IProject project, bool debug)
- {
- ILAsmCompilerParameters parameters = (ILAsmCompilerParameters)project.ActiveConfiguration;
- FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-
- string exe = Path.GetFullPath(Path.Combine(parameters.OutputDirectory, parameters.OutputAssembly) + ".exe");
- string fullCommand = String.Format ("-e \"mono {0};read -p 'press any key to continue...' -n1\"", exe);
- Console.WriteLine (fullCommand);
- ProcessStartInfo psi = new ProcessStartInfo("xterm", fullCommand);
- psi.WorkingDirectory = Path.GetDirectoryName (exe);
- psi.UseShellExecute = false;
- Process p = Process.Start (psi);
- p.WaitForExit ();
- //DebuggerService debuggerService = (DebuggerService)ServiceManager.Services.GetService(typeof(DebuggerService));
- //debuggerService.StartWithoutDebugging(psi);
- }
- }
-}
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs 2005-01-14 00:28:21 UTC (rev 2130)
@@ -19,6 +19,7 @@
using MonoDevelop.Internal.Project;
using MonoDevelop.Internal.Templates;
using MonoDevelop.Gui;
+using MonoDevelop.Services;
namespace ILAsmBinding
{
@@ -26,89 +27,41 @@
{
public const string LanguageName = "ILAsm";
- ILAsmExecutionManager executionManager = new ILAsmExecutionManager();
ILAsmCompilerManager compilerManager = new ILAsmCompilerManager();
+ public ILAsmLanguageBinding ()
+ {
+ Runtime.ProjectService.DataContext.IncludeType (typeof(ILAsmCompilerParameters));
+ }
+
public string Language {
get {
return LanguageName;
}
}
- public void Execute(string filename)
- {
- Execute (filename, false);
- }
-
- public void Execute(string filename, bool debug)
- {
- Debug.Assert(executionManager != null);
- executionManager.Execute(filename, debug);
- }
-
- public void Execute (IProject project)
- {
- Execute (project, false);
- }
-
- public void DebugProject (IProject project)
- {
- Execute (project, true);
- }
-
- public void Execute(IProject project, bool debug)
- {
- Debug.Assert(executionManager != null);
- executionManager.Execute(project, debug);
- }
-
- public string GetCompiledOutputName(string fileName)
- {
- Debug.Assert(compilerManager != null);
- return compilerManager.GetCompiledOutputName(fileName);
- }
-
- public string GetCompiledOutputName(IProject project)
- {
- Debug.Assert(compilerManager != null);
- return compilerManager.GetCompiledOutputName(project);
- }
-
public bool CanCompile(string fileName)
{
Debug.Assert(compilerManager != null);
return compilerManager.CanCompile(fileName);
}
- public ICompilerResult CompileFile(string fileName)
+ public ICompilerResult Compile (ProjectFileCollection projectFiles, ProjectReferenceCollection references, DotNetProjectConfiguration configuration)
{
Debug.Assert(compilerManager != null);
- ILAsmCompilerParameters param = new ILAsmCompilerParameters();
- param.OutputAssembly = Path.ChangeExtension(fileName, ".exe");
- return compilerManager.CompileFile(fileName, param);
+ return compilerManager.Compile (projectFiles, references, configuration);
}
- public ICompilerResult CompileProject(IProject project)
+ public void GenerateMakefile (Project project, Combine parentCombine)
{
- Debug.Assert(compilerManager != null);
- return compilerManager.CompileProject(project);
+ // Not supported
}
- public ICompilerResult RecompileProject(IProject project)
+ public object CreateCompilationParameters (XmlElement projectOptions)
{
- return CompileProject(project);
+ return new ILAsmCompilerParameters();
}
- public IProject CreateProject(ProjectCreateInformation info, XmlElement projectOptions)
- {
- return new ILAsmProject(info, projectOptions);
- }
-
- public void GenerateMakefile (IProject project, Combine parentCombine)
- {
- throw new NotImplementedException ();
- }
-
// source: irc
public string CommentTag
{
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am 2005-01-14 00:28:21 UTC (rev 2130)
@@ -9,13 +9,10 @@
FILES = \
Gui/CompilerParametersPanel.cs \
-Project/CompilationTarget.cs \
-Project/ILAsmProject.cs \
Project/ILAsmCompilerParameters.cs \
ILAsmCompilerManager.cs \
AssemblyInfo.cs \
-ILAsmLanguageBinding.cs \
-ILAsmExecutionManager.cs
+ILAsmLanguageBinding.cs
TEMPLATES = \
ILAsmConsoleProject.xpt.xml
Deleted: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs 2005-01-14 00:28:21 UTC (rev 2130)
@@ -1,11 +0,0 @@
-using System;
-
-namespace ILAsmBinding
-{
- public enum CompilationTarget
- {
- Exe,
- Dll,
- }
-}
-
Modified: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs 2005-01-14 00:28:21 UTC (rev 2130)
@@ -13,107 +13,15 @@
using System.ComponentModel;
using MonoDevelop.Gui.Components;
using MonoDevelop.Internal.Project;
+using MonoDevelop.Internal.Serialization;
namespace ILAsmBinding
{
/// <summary>
/// This class handles project specific compiler parameters
/// </summary>
- public class ILAsmCompilerParameters : AbstractProjectConfiguration
+ public class ILAsmCompilerParameters
{
- CompilerOptions compilerOptions = new CompilerOptions();
-
- [Browsable(false)]
- public CompilerOptions CurrentCompilerOptions {
- get {
- return compilerOptions;
- }
- }
-
- [LocalizedProperty("Output path",
- Description = "The path where the assembly is created.")]
- public string OutputPath {
- get {
- return OutputDirectory;
- }
- set {
- OutputDirectory = value;
- }
- }
-
- [LocalizedProperty("Output assembly",
- Description = "The assembly name.")]
- public string AssemblyName {
- get {
- return OutputAssembly;
- }
- set {
- OutputAssembly = value;
- }
- }
-
- [DefaultValue(CompilationTarget.Exe)]
- [LocalizedProperty("Compilation Target",
- Description = "The compilation target of the source code. (/dll, /exe)")]
- public CompilationTarget CompilationTarget {
- get {
- return compilerOptions.compilationTarget;
- }
- set {
- compilerOptions.compilationTarget = value;
- }
- }
-
- [DefaultValue(false)]
- [LocalizedProperty("Include debug information",
- Description = "Specifies if debug information should be omited. (/DEBUG)")]
- public bool IncludeDebugInformation {
- get {
- return compilerOptions.includeDebugInformation;
- }
- set {
- compilerOptions.includeDebugInformation = value;
- }
- }
-
- public ILAsmCompilerParameters()
- {
- }
-
- public ILAsmCompilerParameters(string name)
- {
- this.name = name;
- }
-
- [XmlNodeName("CompilerOptions")]
- public class CompilerOptions
- {
- [XmlAttribute("compilationTarget")]
- public CompilationTarget compilationTarget = CompilationTarget.Exe;
-
- [XmlAttribute("includeDebugInformation")]
- internal bool includeDebugInformation = false;
-
- public string GenerateOptions()
- {
- StringBuilder options = new StringBuilder();
- switch (compilationTarget) {
- case ILAsmBinding.CompilationTarget.Dll:
- options.Append("/dll ");
- break;
- case ILAsmBinding.CompilationTarget.Exe:
- options.Append("/exe ");
- break;
- default:
- throw new System.NotSupportedException("Unsupported compilation target : " + compilationTarget);
- }
-
- if (includeDebugInformation) {
- options.Append("/DEBUG ");
- }
-
- return options.ToString();
- }
- }
+ // Add options here
}
}
Deleted: trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs
===================================================================
--- trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs 2005-01-14 00:28:05 UTC (rev 2129)
+++ trunk/MonoDevelop/Core/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs 2005-01-14 00:28:21 UTC (rev 2130)
@@ -1,50 +0,0 @@
-// <file>
-// <copyright see="prj:///doc/copyright.txt"/>
-// <license see="prj:///doc/license.txt"/>
-// <owner name="Mike Krueger" email="mike at icsharpcode.net"/>
-// <version value="$version"/>
-// </file>
-
-using System;
-using System.IO;
-using System.Collections;
-using System.Diagnostics;
-using System.ComponentModel;
-using System.Xml;
-
-using MonoDevelop.Internal.Project;
-using MonoDevelop.Internal.Templates;
-
-namespace ILAsmBinding
-{
- public class ILAsmProject : AbstractProject
- {
- public override string ProjectType {
- get {
- return ILAsmLanguageBinding.LanguageName;
- }
- }
-
- public ILAsmProject()
- {
- }
-
- public override IConfiguration CreateConfiguration()
- {
- return new ILAsmCompilerParameters();
- }
-
- public ILAsmProject(ProjectCreateInformation info, XmlElement projectOptions)
- {
- if (info != null) {
- Name = info.ProjectName;
- Configurations.Add(CreateConfiguration("Debug"));
- Configurations.Add(CreateConfiguration("Release"));
- foreach (ILAsmCompilerParameters parameter in Configurations) {
- parameter.OutputDirectory = info.BinPath + Path.DirectorySeparatorChar + parameter.Name;
- parameter.OutputAssembly = Name;
- }
- }
- }
- }
-}
More information about the Monodevelop-patches-list
mailing list