diff options
author | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-23 20:29:30 +0300 |
---|---|---|
committer | Lluis Sanchez Gual <lluis@xamarin.com> | 2015-04-23 20:29:30 +0300 |
commit | 3bcb0e8f5d636e7ea5b6b57892b323d108e93acf (patch) | |
tree | 33553fb071f5cf33b5c0a8444ee7c6050d3defff /main/src/addins/ILAsmBinding | |
parent | b18824abe23aa2b3e854d50331232e203984bbb9 (diff) |
Simplified language binding infrastructure
ILanguageBinding is now a class: LanguageBinding.
IDotNetLanguageBinding is gone. Most of its methods have been moved
to DotNetProject.
Added support for defining language bindings using only an extension node.
Custom LanguageBinding classes are still supported, but not required.
Diffstat (limited to 'main/src/addins/ILAsmBinding')
-rw-r--r-- | main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml | 4 | ||||
-rw-r--r-- | main/src/addins/ILAsmBinding/ILAsmBinding.csproj | 2 | ||||
-rw-r--r-- | main/src/addins/ILAsmBinding/ILAsmProject.cs (renamed from main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs) | 66 |
3 files changed, 19 insertions, 53 deletions
diff --git a/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml b/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml index 870e4e8bc6..733388310c 100644 --- a/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml +++ b/main/src/addins/ILAsmBinding/ILAsmBinding.addin.xml @@ -14,11 +14,11 @@ </Extension> <Extension path = "/MonoDevelop/ProjectModel/LanguageBindings"> - <LanguageBinding id = "ILAsm" supportedextensions = ".il" class = "ILAsmBinding.ILAsmLanguageBinding"/> + <LanguageBinding id = "ILAsm" extensions = ".il" singleLineCommentTag = "//" blockCommentStartTag = "/*" blockCommentEndTag = "*/" /> </Extension> <Extension path = "/MonoDevelop/ProjectModel/MSBuildItemTypes"> - <DotNetProjectType language="IL" extension="ilproj" guid="{B4EC64DC-6D44-11DD-AAB0-C9A155D89593}" tag="IL" /> + <DotNetProjectType language="IL" extension="ilproj" guid="{B4EC64DC-6D44-11DD-AAB0-C9A155D89593}" tag="IL" type="ILAsmBinding.ILAsmProject" /> </Extension> </ExtensionModel> diff --git a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj index 62a3fff13c..7eb5d92e8c 100644 --- a/main/src/addins/ILAsmBinding/ILAsmBinding.csproj +++ b/main/src/addins/ILAsmBinding/ILAsmBinding.csproj @@ -90,11 +90,11 @@ <Compile Include="Project\ILAsmCompilerParameters.cs" /> <Compile Include="ILAsmCompilerManager.cs" /> <Compile Include="AssemblyInfo.cs" /> - <Compile Include="ILAsmLanguageBinding.cs" /> <Compile Include="Gui\CompilerParametersPanelWidget.cs" /> <Compile Include="gtk-gui\generated.cs" /> <Compile Include="gtk-gui\ILAsmBinding.CompilerParametersPanelWidget.cs" /> <Compile Include="AddinInfo.cs" /> + <Compile Include="ILAsmProject.cs" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project> diff --git a/main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs b/main/src/addins/ILAsmBinding/ILAsmProject.cs index 04e3738c69..7db0dc160d 100644 --- a/main/src/addins/ILAsmBinding/ILAsmLanguageBinding.cs +++ b/main/src/addins/ILAsmBinding/ILAsmProject.cs @@ -1,21 +1,21 @@ -// -// ILAsmLanguageBinding.cs -// +// +// ILAsmProject.cs +// // Author: -// Mike Krüger <mkrueger@novell.com> -// -// Copyright (c) 2009 Novell, Inc (http://www.novell.com) -// +// Lluis Sanchez Gual <lluis@xamarin.com> +// +// Copyright (c) 2015 Xamarin, Inc (http://www.xamarin.com) +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -23,60 +23,25 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. - using System; -using System.IO; -using System.Xml; - using MonoDevelop.Projects; using MonoDevelop.Core; namespace ILAsmBinding { - class ILAsmLanguageBinding : IDotNetLanguageBinding + public class ILAsmProject: DotNetProject { - public string Language { - get { - return "IL"; - } - } - - public string ProjectStockIcon { - get { - return "md-project"; - } - } - - public bool IsSourceCodeFile (FilePath fileName) - { - return String.Compare (Path.GetExtension (fileName), ".il", StringComparison.OrdinalIgnoreCase) == 0; - } - - public BuildResult Compile (ProjectItemCollection projectItems, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor) + protected override BuildResult OnCompileSources (ProjectItemCollection items, DotNetProjectConfiguration configuration, ConfigurationSelector configSelector, ProgressMonitor monitor) { - return ILAsmCompilerManager.Compile (projectItems, configuration, configSelector, monitor); + return ILAsmCompilerManager.Compile (items, configuration, configSelector, monitor); } - - public DotNetCompilerParameters CreateCompilationParameters (XmlElement projectOptions) + + protected override DotNetCompilerParameters OnCreateCompilationParameters (System.Xml.XmlElement projectOptions) { return new ILAsmCompilerParameters(); } - public string SingleLineCommentTag { get { return "//"; } } - public string BlockCommentStartTag { get { return "/*"; } } - public string BlockCommentEndTag { get { return "*/"; } } - - public System.CodeDom.Compiler.CodeDomProvider GetCodeDomProvider () - { - return null; - } - - public FilePath GetFileName (FilePath baseName) - { - return baseName + ".il"; - } - - public ClrVersion[] GetSupportedClrVersions () + protected override ClrVersion[] OnGetSupportedClrVersions () { return new [] { ClrVersion.Net_1_1, @@ -88,3 +53,4 @@ namespace ILAsmBinding } } } + |