[Monodevelop-patches-list] r1447 - in trunk/MonoDevelop: . build/AddIns/AddIns/BackendBindings src/AddIns/BackendBindings src/AddIns/BackendBindings/ILAsmBinding src/AddIns/BackendBindings/ILAsmBinding/Gui src/AddIns/BackendBindings/ILAsmBinding/Project
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Mon Apr 12 18:11:01 EDT 2004
Author: jluke
Date: 2004-04-12 18:11:01 -0400 (Mon, 12 Apr 2004)
New Revision: 1447
Added:
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/AssemblyInfo.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Gui/
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs
Modified:
trunk/MonoDevelop/ChangeLog
trunk/MonoDevelop/build/AddIns/AddIns/BackendBindings/BackendBindings.addin.xml
trunk/MonoDevelop/configure.in
trunk/MonoDevelop/src/AddIns/BackendBindings/Makefile.am
Log:
import ILAsmBinding from SD
not tested or working
Modified: trunk/MonoDevelop/ChangeLog
===================================================================
--- trunk/MonoDevelop/ChangeLog 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/ChangeLog 2004-04-12 22:11:01 UTC (rev 1447)
@@ -1,3 +1,7 @@
+2004-04-12 John Luke <jluke at cfl.rr.com>
+
+ import ILAsmBinding from SD svn
+
2004-04-12 Todd Berman <tberman at sevenl.net>
* configure.in: bump to 0.18.99 gtk-sharp
Modified: trunk/MonoDevelop/build/AddIns/AddIns/BackendBindings/BackendBindings.addin.xml
===================================================================
--- trunk/MonoDevelop/build/AddIns/AddIns/BackendBindings/BackendBindings.addin.xml 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/build/AddIns/AddIns/BackendBindings/BackendBindings.addin.xml 2004-04-12 22:11:01 UTC (rev 1447)
@@ -11,6 +11,7 @@
<!-- ORIGINAL #D COMMENT <Import assembly = "JScriptLanguageModule.dll"/> -->
<!-- <Import assembly = "VBNetBinding.dll"/> -->
<Import assembly = "NemerleBinding.dll"/>
+<!-- <Import assembly = "ILAsmBinding.dll"/> -->
</Runtime>
<Extension path = "/SharpDevelop/Workbench/Ambiences">
@@ -119,6 +120,12 @@
_label = "Output"
class = "NemerleBinding.OutputPanel"/>
</Conditional>
+ <!-- <Conditional activeproject="ILAsm">
+ <DialogPanel id = "ILAsmCompilerParametersPanel"
+ label = "Compiler"
+ class = "ICSharpCode.ILAsmBinding.CompilerParametersPanel"/>
+
+ </Conditional> -->
</Extension>
@@ -222,6 +229,11 @@
<LanguageBinding id = "Nemerle"
supportedextensions = ".n"
class = "NemerleBinding.NemerleLanguageBinding" />
+ <!--
+ <LanguageBinding id = "ILAsm"
+ supportedextensions = ".il"
+ class = "MonoDevelop.ILAsmLanguageBinding" />
+ -->
</Extension>
<Extension path = "/SharpDevelop/Views/ProjectBrowser/NodeBuilders">
Modified: trunk/MonoDevelop/configure.in
===================================================================
--- trunk/MonoDevelop/configure.in 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/configure.in 2004-04-12 22:11:01 UTC (rev 1447)
@@ -133,6 +133,7 @@
src/AddIns/BackendBindings/Makefile
src/AddIns/BackendBindings/CSharpBinding/Makefile
src/AddIns/BackendBindings/JavaBinding/Makefile
+src/AddIns/BackendBindings/ILAsmBinding/Makefile
src/AddIns/BackendBindings/NemerleBinding/Makefile
src/AddIns/DisplayBindings/Makefile
src/AddIns/DisplayBindings/SourceEditor/Makefile
Property changes on: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding
___________________________________________________________________
Name: svn:ignore
+ Makefile
Makefile.in
ILAsmBinding.dll
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/AssemblyInfo.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/AssemblyInfo.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/AssemblyInfo.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,32 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+// Information about this assembly is defined by the following
+// attributes.
+//
+// change them to the information which is associated with the assembly
+// you compile.
+
+[assembly: AssemblyTitle("ILAsmBinding")]
+[assembly: AssemblyDescription("IL language binding for #develop")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("www.icsharpcode.net")]
+[assembly: AssemblyProduct("")]
+[assembly: AssemblyCopyright("(c) 2004 Mike Krueger")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// The assembly version has following format :
+//
+// Major.Minor.Build.Revision
+//
+// You can specify all values by your own or you can build default build and revision
+// numbers with the '*' character (the default):
+
+[assembly: AssemblyVersion("1.0.*")]
+
+// The following attributes specify the key for the sign of your assembly. See the
+// .NET Framework documentation for more information about signing.
+// This is not required, if you don't want signing let these attributes like they're.
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyFile("")]
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ChangeLog 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,4 @@
+
+ import from SD svn
+ not yet working and untested
+
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Gui/CompilerParametersPanel.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,40 @@
+// <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 Gtk;
+
+using MonoDevelop.Internal.Project;
+using MonoDevelop.Internal.ExternalTool;
+using MonoDevelop.Gui.Dialogs;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Core.Properties;
+using MonoDevelop.Core.AddIns.Codons;
+
+namespace MonoDevelop.ILAsmBinding
+{
+ public class CompilerParametersPanel : AbstractOptionPanel
+ {
+ ILAsmCompilerParameters compilerParameters = null;
+
+ public override void LoadPanelContents()
+ {
+ this.compilerParameters = (ILAsmCompilerParameters)((IProperties)CustomizationObject).GetProperty("Config");
+
+ //System.Windows.Forms.PropertyGrid grid = new System.Windows.Forms.PropertyGrid();
+ //grid.Dock = DockStyle.Fill;
+ //grid.SelectedObjects = new object[] { compilerParameters};
+ //Controls.Add(grid);
+ }
+
+ public override bool StorePanelContents()
+ {
+ return true;
+ }
+ }
+}
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmCompilerManager.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,174 @@
+// <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.Collections;
+using System.IO;
+using System.Diagnostics;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.CodeDom.Compiler;
+using Gtk;
+
+using MonoDevelop.Services;
+using MonoDevelop.Core.Services;
+using MonoDevelop.Internal.Project;
+using MonoDevelop.Gui;
+
+namespace MonoDevelop.ILAsmBinding
+{
+ /// <summary>
+ /// Description of ILAsmCompilerManager.
+ /// </summary>
+ public class ILAsmCompilerManager
+ {
+ FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.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)
+ {
+ // TODO: No response file possible ? @FILENAME seems not to work.
+ string output = String.Empty;
+ string error = String.Empty;
+ StringBuilder parameters = new StringBuilder();
+ foreach (string fileName in fileNames) {
+ parameters.Append('"');
+ parameters.Append(Path.GetFullPath(fileName));
+ parameters.Append("\" ");
+ }
+
+ string outputFile = Path.GetFullPath(fileUtilityService.GetDirectoryNameWithSeparator(compilerparameters.OutputDirectory) + compilerparameters.OutputAssembly + ".exe");
+ parameters.Append("/OUTPUT=\"" + outputFile + "\"");
+ parameters.Append(" ");
+ parameters.Append(compilerparameters.CurrentCompilerOptions.GenerateOptions());
+ string compilerName = GetCompilerName();
+ string outstr = compilerName + " " + parameters.ToString();
+
+ TempFileCollection tf = new TempFileCollection();
+ Executor.ExecWaitWithCapture(outstr, Path.GetFullPath(compilerparameters.OutputDirectory), tf, ref output, ref error);
+
+ ICompilerResult result = ParseOutput(tf, output);
+
+ File.Delete(output);
+ File.Delete(error);
+ return result;
+ }
+
+ public ICompilerResult CompileFile(string fileName, ILAsmCompilerParameters compilerparameters)
+ {
+ 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) {
+ if (finfo.Subtype != Subtype.Directory) {
+ switch (finfo.BuildAction) {
+ case BuildAction.Compile:
+ fileNames.Add(finfo.Name);
+ break;
+// TODO : Embedded resources ?
+// case BuildAction.EmbedAsResource:
+// writer.WriteLine("\"/res:" + finfo.Name + "\"");
+// break;
+ }
+ }
+ }
+
+ return Compile(compilerparameters, (string[])fileNames.ToArray(typeof(string)));
+ }
+
+ string GetCompilerName()
+ {
+ return "ilasm";
+ }
+
+ ICompilerResult ParseOutput(TempFileCollection tf, string file)
+ {
+ StringBuilder compilerOutput = new StringBuilder();
+
+ StreamReader sr = File.OpenText(file);
+
+ // skip fist whitespace line
+ sr.ReadLine();
+
+ CompilerResults cr = new CompilerResults(tf);
+
+ // we have 2 formats for the error output the csc gives :
+ Regex normalError = new Regex(@"(?<file>.*)\((?<line>\d+),(?<column>\d+)\):\s+(?<error>\w+)\s+(?<number>[\d\w]+):\s+(?<message>.*)", RegexOptions.Compiled);
+ Regex generalError = new Regex(@"(?<error>.+)\s+(?<number>[\d\w]+):\s+(?<message>.*)", RegexOptions.Compiled);
+
+ while (true) {
+ string curLine = sr.ReadLine();
+ compilerOutput.Append(curLine);
+ compilerOutput.Append('\n');
+ if (curLine == null) {
+ break;
+ }
+ // TODO : PARSE ERROR OUTPUT.
+
+// curLine = curLine.Trim();
+// if (curLine.Length == 0) {
+// continue;
+// }
+//
+// CompilerError error = new CompilerError();
+//
+// // try to match standard errors
+// Match match = normalError.Match(curLine);
+// if (match.Success) {
+// error.Column = Int32.Parse(match.Result("${column}"));
+// error.Line = Int32.Parse(match.Result("${line}"));
+// error.FileName = Path.GetFullPath(match.Result("${file}"));
+// error.IsWarning = match.Result("${error}") == "warning";
+// error.ErrorNumber = match.Result("${number}");
+// error.ErrorText = match.Result("${message}");
+// } else {
+// match = generalError.Match(curLine); // try to match general csc errors
+// if (match.Success) {
+// error.IsWarning = match.Result("${error}") == "warning";
+// error.ErrorNumber = match.Result("${number}");
+// error.ErrorText = match.Result("${message}");
+// } else { // give up and skip the line
+// continue;
+//// error.IsWarning = false;
+//// error.ErrorText = curLine;
+// }
+// }
+//
+// cr.Errors.Add(error);
+ }
+ sr.Close();
+ return new DefaultCompilerResult(cr, compilerOutput.ToString());
+ }
+ }
+}
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmExecutionManager.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,56 @@
+// <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 MonoDevelop.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.Services.GetService(typeof(FileUtilityService));
+
+ string exe = Path.GetFullPath(Path.Combine(parameters.OutputDirectory, parameters.OutputAssembly) + ".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);
+ }
+ }
+}
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/ILAsmLanguageBinding.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,107 @@
+// <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.Internal.Templates;
+using MonoDevelop.Gui;
+
+namespace MonoDevelop.ILAsmBinding
+{
+ public class ILAsmLanguageBinding : ILanguageBinding
+ {
+ public const string LanguageName = "ILAsm";
+
+ ILAsmExecutionManager executionManager = new ILAsmExecutionManager();
+ ILAsmCompilerManager compilerManager = new ILAsmCompilerManager();
+
+ 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)
+ {
+ Debug.Assert(compilerManager != null);
+ ILAsmCompilerParameters param = new ILAsmCompilerParameters();
+ param.OutputAssembly = Path.ChangeExtension(fileName, ".exe");
+ return compilerManager.CompileFile(fileName, param);
+ }
+
+ public ICompilerResult CompileProject(IProject project)
+ {
+ Debug.Assert(compilerManager != null);
+ return compilerManager.CompileProject(project);
+ }
+
+ public ICompilerResult RecompileProject(IProject project)
+ {
+ return CompileProject(project);
+ }
+
+ public IProject CreateProject(ProjectCreateInformation info, XmlElement projectOptions)
+ {
+ return new ILAsmProject(info, projectOptions);
+ }
+ }
+}
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Makefile.am 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,34 @@
+
+CSC = mcs /debug
+ASSEMBLY = ILAsmBinding.dll
+
+DLLS = /r:../../../../build/bin/MonoDevelop.Core.dll \
+ /r:../../../../build/bin/MonoDevelop.Base.dll \
+ /r:../../../../build/bin/MonoDevelop.SourceEditor.dll \
+ /r:../../../../build/bin/MonoDevelop.Gui.Widgets.dll \
+ /r:gtk-sharp.dll
+
+FILES = \
+./Gui/CompilerParametersPanel.cs \
+./Project/CompilationTarget.cs \
+./Project/ILAsmProject.cs \
+./Project/ILAsmCompilerParameters.cs \
+./ILAsmCompilerManager.cs \
+./AssemblyInfo.cs \
+./ILAsmLanguageBinding.cs \
+./ILAsmExecutionManager.cs
+
+build_sources = $(addprefix $(srcdir)/, $(FILES))
+
+assemblydir = $(libdir)/monodevelop/AddIns/AddIns/BackendBindings
+assembly_DATA = $(ASSEMBLY)
+
+all: $(ASSEMBLY)
+
+$(ASSEMBLY): $(build_sources)
+ $(CSC) $(FILES) $(DLLS) /out:$(ASSEMBLY) /target:library \
+ && cp $(ASSEMBLY) ../../../../build/AddIns/AddIns/BackendBindings/.
+
+CLEANFILES = $(ASSEMBLY)
+EXTRA_DIST = $(FILES)
+
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/CompilationTarget.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,11 @@
+using System;
+
+namespace MonoDevelop.ILAsmBinding
+{
+ public enum CompilationTarget
+ {
+ Exe,
+ Dll,
+ }
+}
+
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmCompilerParameters.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,119 @@
+// <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.Text;
+using System.Xml;
+using System.Diagnostics;
+using System.ComponentModel;
+using MonoDevelop.Gui.Components;
+using MonoDevelop.Internal.Project;
+
+namespace MonoDevelop.ILAsmBinding
+{
+ /// <summary>
+ /// This class handles project specific compiler parameters
+ /// </summary>
+ public class ILAsmCompilerParameters : AbstractProjectConfiguration
+ {
+ 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")]
+ internal CompilationTarget compilationTarget = CompilationTarget.Exe;
+
+ [XmlAttribute("includeDebugInformation")]
+ internal bool includeDebugInformation = false;
+
+ public string GenerateOptions()
+ {
+ StringBuilder options = new StringBuilder();
+ switch (compilationTarget) {
+ //case CompilationTarget.Dll:
+ // options.Append("/DLL ");
+ // break;
+ //case CompilationTarget.Exe:
+ // options.Append("/EXE ");
+ // break;
+ default:
+ throw new System.NotSupportedException("Unsupported compilation target : " + compilationTarget);
+ }
+
+ if (includeDebugInformation) {
+ options.Append("/DEBUG ");
+ }
+
+ return options.ToString();
+ }
+ }
+ }
+}
Added: trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/ILAsmBinding/Project/ILAsmProject.cs 2004-04-12 22:11:01 UTC (rev 1447)
@@ -0,0 +1,50 @@
+// <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 MonoDevelop.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;
+ }
+ }
+ }
+ }
+}
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/Makefile.am 2004-04-12 22:04:12 UTC (rev 1446)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/Makefile.am 2004-04-12 22:11:01 UTC (rev 1447)
@@ -1 +1,3 @@
-SUBDIRS = CSharpBinding JavaBinding NemerleBinding
+
+SUBDIRS = CSharpBinding JavaBinding NemerleBinding ILAsmBinding
+
More information about the Monodevelop-patches-list
mailing list