Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@2754 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61shortcuts
83 changed files with 2791 additions and 1726 deletions
@ -1,99 +0,0 @@
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Matt Ward" |
||||
created = "15/02/2006" |
||||
lastModified = "15/02/2006"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>${res:Templates.Project.GtkSharpProject.Name}</Name> |
||||
<Category>VBNet</Category> |
||||
<Subcategory>Mono</Subcategory> |
||||
<Icon>VBNet.Project.Form</Icon> |
||||
<Description>${res:Templates.Project.GtkSharpProject.Description}</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "MainWindow.vb"/> |
||||
</Actions> |
||||
|
||||
<Project language="VBNet"> |
||||
<PropertyGroup> |
||||
<OutputType>WinExe</OutputType> |
||||
<TargetFrameworkVersion>Mono v1.1</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
|
||||
<Imports clear="True"> |
||||
<Import Project="$(SharpDevelopBinPath)\SharpDevelop.Build.VisualBasic.targets" /> |
||||
</Imports> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="atk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="glib-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="gtk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="pango-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" /> |
||||
<Reference Include="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> |
||||
|
||||
<Import Include="Microsoft.VisualBasic" /> |
||||
<Import Include="System" /> |
||||
<Import Include="System.Collections" /> |
||||
</ProjectItems> |
||||
|
||||
<Files> |
||||
<File name="MainWindow.vb"><![CDATA[${StandardHeader.VBNET} |
||||
Imports Gtk |
||||
Imports System |
||||
|
||||
Public Class MainWindow |
||||
Inherits Window |
||||
|
||||
Public Sub New |
||||
MyBase.New("MainWindow") |
||||
AddHandler MyBase.DeleteEvent, AddressOf MainWindowDelete |
||||
Me.ShowAll() |
||||
End Sub |
||||
|
||||
Public Shared Sub Main |
||||
Application.Init() |
||||
Dim mainWindow As New MainWindow |
||||
Application.Run() |
||||
End Sub |
||||
|
||||
Private Sub MainWindowDelete(ByVal o As Object, ByVal args As DeleteEventArgs) |
||||
Application.Quit() |
||||
args.RetVal = true |
||||
End Sub |
||||
End Class |
||||
]]></File> |
||||
<File name="AssemblyInfo.vb"> |
||||
<![CDATA[Imports System.Reflection |
||||
Imports 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("")> |
||||
<assembly: AssemblyDescription("")> |
||||
<assembly: AssemblyConfiguration("")> |
||||
<assembly: AssemblyCompany("")> |
||||
<assembly: AssemblyProduct("")> |
||||
<assembly: AssemblyCopyright("")> |
||||
<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.*")> |
||||
]]></File> |
||||
</Files> |
||||
</Project> |
||||
</Template> |
@ -0,0 +1,105 @@
@@ -0,0 +1,105 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>Mono.AddIn</RootNamespace> |
||||
<AssemblyName>Mono.AddIn</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{082DCD64-EE32-4151-A50F-E139CF754CC0}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>121110528</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>..\..\..\AddIns\Samples\Mono.AddIn</OutputPath> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>..\..\..\AddIns\Samples\Mono.AddIn</OutputPath> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>false</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="ICSharpCode.Core"> |
||||
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="ICSharpCode.SharpDevelop"> |
||||
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="ICSharpCode.SharpDevelop.Dom"> |
||||
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Core" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<Compile Include="Src\AddMonoReferenceCommand.cs" /> |
||||
<Compile Include="Src\IsMonoInstalledCondition.cs" /> |
||||
<Compile Include="Src\MonoGacReferencePanel.cs" /> |
||||
<Compile Include="Src\MonoProjectContentRegistry.cs" /> |
||||
<Compile Include="Src\SelectMonoReferenceDialog.cs" /> |
||||
<None Include="Templates\DefaultApp.config"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\DefaultAssemblyInfo.cs"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Mono.addin"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\CSharp.Console.Project.xpt"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\CSharp.Gtk.Window.xft"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\CSharpGladeProject.xpt"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\CSharpGtkProject.xpt"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\DefaultAssemblyInfo.vb"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\VBNet.Console.Project.xpt"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\VBNet.Gtk.Window.xft"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Templates\VBNetGtkProject.xpt"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\Mono.Build.Tasks\Mono.Build.Tasks.csproj"> |
||||
<Project>{BF6F814C-B89F-475E-ADC4-AEE81D10CB94}</Project> |
||||
<Name>Mono.Build.Tasks</Name> |
||||
</ProjectReference> |
||||
<Folder Include="Templates" /> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -0,0 +1,58 @@
@@ -0,0 +1,58 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace Mono.AddIn |
||||
{ |
||||
/// <summary>
|
||||
/// Displays the AddMonoReference dialog allowing the user to add
|
||||
/// a Mono GAC reference to the project
|
||||
/// </summary>
|
||||
public class AddMonoReferenceCommand : AbstractMenuCommand |
||||
{ |
||||
public override void Run() |
||||
{ |
||||
AbstractProjectBrowserTreeNode node = Owner as AbstractProjectBrowserTreeNode; |
||||
IProject project = (node != null) ? node.Project : ProjectService.CurrentProject; |
||||
if (project == null) { |
||||
return; |
||||
} |
||||
using (SelectMonoReferenceDialog selDialog = new SelectMonoReferenceDialog(project)) { |
||||
if (selDialog.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm) == DialogResult.OK) { |
||||
foreach (ReferenceProjectItem reference in selDialog.ReferenceInformations) { |
||||
ProjectService.AddProjectItem(project, reference); |
||||
} |
||||
project.Save(); |
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,44 @@
@@ -0,0 +1,44 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using Mono.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace Mono.AddIn |
||||
{ |
||||
/// <summary>
|
||||
/// Determines whether Mono is installed.
|
||||
/// </summary>
|
||||
public class IsMonoInstalledCondition : IConditionEvaluator |
||||
{ |
||||
public bool IsValid(object caller, Condition condition) |
||||
{ |
||||
return MonoToolLocationHelper.IsMonoInstalled; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,52 @@
@@ -0,0 +1,52 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Windows.Forms; |
||||
using Mono.Build.Tasks; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace Mono.AddIn |
||||
{ |
||||
public class MonoGacReferencePanel : GacReferencePanel |
||||
{ |
||||
public MonoGacReferencePanel(ISelectReferenceDialog selectDialog) : base(selectDialog) |
||||
{ |
||||
} |
||||
|
||||
protected override IList<DomAssemblyName> GetCacheContent() |
||||
{ |
||||
List<DomAssemblyName> list = new List<DomAssemblyName>(); |
||||
foreach (MonoAssemblyName assemblyName in MonoGlobalAssemblyCache.GetAssemblyNames()) { |
||||
list.Add(new DomAssemblyName(assemblyName.FullName)); |
||||
} |
||||
return list; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,56 @@
@@ -0,0 +1,56 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using Mono.Build.Tasks; |
||||
|
||||
namespace Mono.AddIn |
||||
{ |
||||
public class MonoProjectContentRegistry : ProjectContentRegistry |
||||
{ |
||||
protected override IProjectContent LoadProjectContent(string itemInclude, string itemFileName) |
||||
{ |
||||
if (File.Exists(itemFileName)) { |
||||
return ParserService.DefaultProjectContentRegistry.GetProjectContentForReference(itemInclude, itemFileName); |
||||
} |
||||
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(itemInclude); |
||||
if (assemblyName != null && assemblyName.FileName != null) { |
||||
return CecilReader.LoadAssembly(assemblyName.FileName, this); |
||||
} else { |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
HostCallback.ShowAssemblyLoadError(itemFileName, itemInclude, "Could not find assembly in Mono's GAC."); |
||||
} else { |
||||
HostCallback.ShowAssemblyLoadError(itemFileName, itemInclude, "Could not find assembly in Mono's GAC - Mono is not installed."); |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,320 @@
@@ -0,0 +1,320 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
using System.Windows.Forms; |
||||
|
||||
using Mono.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
using ICSharpCode.SharpDevelop.Project; |
||||
|
||||
namespace Mono.AddIn |
||||
{ |
||||
public class SelectMonoReferenceDialog : System.Windows.Forms.Form, ISelectReferenceDialog |
||||
{ |
||||
private System.Windows.Forms.ListView referencesListView; |
||||
private System.Windows.Forms.Button selectButton; |
||||
private System.Windows.Forms.Button removeButton; |
||||
private System.Windows.Forms.TabPage gacTabPage; |
||||
private System.Windows.Forms.TabPage projectTabPage; |
||||
private System.Windows.Forms.TabPage browserTabPage; |
||||
private System.Windows.Forms.Label referencesLabel; |
||||
private System.Windows.Forms.ColumnHeader referenceHeader; |
||||
private System.Windows.Forms.ColumnHeader typeHeader; |
||||
private System.Windows.Forms.ColumnHeader locationHeader; |
||||
private System.Windows.Forms.TabControl referenceTabControl; |
||||
private System.Windows.Forms.Button okButton; |
||||
private System.Windows.Forms.Button cancelButton; |
||||
private System.Windows.Forms.Button helpButton; |
||||
private System.ComponentModel.Container components = null; |
||||
|
||||
List<ReferenceProjectItem> gacReferences = new List<ReferenceProjectItem>(); |
||||
IProject configureProject; |
||||
|
||||
public ArrayList ReferenceInformations { |
||||
get { |
||||
ArrayList referenceInformations = new ArrayList(); |
||||
foreach (ListViewItem item in referencesListView.Items) { |
||||
System.Diagnostics.Debug.Assert(item.Tag != null); |
||||
referenceInformations.Add(item.Tag); |
||||
} |
||||
return referenceInformations; |
||||
} |
||||
} |
||||
|
||||
public IProject ConfigureProject { |
||||
get { return configureProject; } |
||||
} |
||||
|
||||
public List<ReferenceProjectItem> GacReferences { |
||||
get { return gacReferences; } |
||||
} |
||||
|
||||
public SelectMonoReferenceDialog(IProject configureProject) |
||||
{ |
||||
this.configureProject = configureProject; |
||||
|
||||
InitializeComponent(); |
||||
|
||||
gacTabPage.Controls.Add(new MonoGacReferencePanel(this)); |
||||
projectTabPage.Controls.Add(new ProjectReferencePanel(this)); |
||||
browserTabPage.Controls.Add(new AssemblyReferencePanel(this)); |
||||
} |
||||
|
||||
public void AddReference(string referenceName, string referenceType, string referenceLocation, ReferenceProjectItem projectItem) |
||||
{ |
||||
if (projectItem == null) |
||||
throw new ArgumentNullException("projectItem"); |
||||
|
||||
foreach (ListViewItem item in referencesListView.Items) { |
||||
if (referenceLocation == item.SubItems[2].Text && referenceName == item.Text) { |
||||
return; |
||||
} |
||||
} |
||||
|
||||
ListViewItem newItem = new ListViewItem(new string[] {referenceName, referenceType, referenceLocation}); |
||||
newItem.Tag = projectItem; |
||||
referencesListView.Items.Add(newItem); |
||||
|
||||
if (referenceType == "Gac") { |
||||
// Add hint path so we can build against Microsoft's Csc too.
|
||||
projectItem.HintPath = FileUtility.GetRelativePath(configureProject.Directory, GetAssemblyLocation(referenceLocation)); |
||||
} |
||||
} |
||||
|
||||
void SelectReference(object sender, EventArgs e) |
||||
{ |
||||
IReferencePanel refPanel = (IReferencePanel)referenceTabControl.SelectedTab.Controls[0]; |
||||
refPanel.AddReference(); |
||||
} |
||||
|
||||
void RemoveReference(object sender, EventArgs e) |
||||
{ |
||||
ArrayList itemsToDelete = new ArrayList(); |
||||
|
||||
foreach (ListViewItem item in referencesListView.SelectedItems) { |
||||
itemsToDelete.Add(item); |
||||
} |
||||
|
||||
foreach (ListViewItem item in itemsToDelete) { |
||||
referencesListView.Items.Remove(item); |
||||
ReferenceProjectItem referenceItem = item.Tag as ReferenceProjectItem; |
||||
if (referenceItem != null) { |
||||
gacReferences.Remove(referenceItem); |
||||
} |
||||
} |
||||
} |
||||
|
||||
string GetAssemblyLocation(string name) |
||||
{ |
||||
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(name); |
||||
if (assemblyName != null) { |
||||
return assemblyName.FileName; |
||||
} |
||||
return String.Empty; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
protected override void Dispose(bool disposing) |
||||
{ |
||||
if (disposing) { |
||||
if (components != null) { |
||||
components.Dispose(); |
||||
} |
||||
} |
||||
base.Dispose( disposing ); |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() |
||||
{ |
||||
this.referenceTabControl = new System.Windows.Forms.TabControl(); |
||||
this.referencesListView = new System.Windows.Forms.ListView(); |
||||
this.selectButton = new System.Windows.Forms.Button(); |
||||
this.removeButton = new System.Windows.Forms.Button(); |
||||
this.gacTabPage = new System.Windows.Forms.TabPage(); |
||||
this.projectTabPage = new System.Windows.Forms.TabPage(); |
||||
this.browserTabPage = new System.Windows.Forms.TabPage(); |
||||
this.referencesLabel = new System.Windows.Forms.Label(); |
||||
this.referenceHeader = new System.Windows.Forms.ColumnHeader(); |
||||
this.typeHeader = new System.Windows.Forms.ColumnHeader(); |
||||
this.locationHeader = new System.Windows.Forms.ColumnHeader(); |
||||
this.okButton = new System.Windows.Forms.Button(); |
||||
this.cancelButton = new System.Windows.Forms.Button(); |
||||
this.helpButton = new System.Windows.Forms.Button(); |
||||
this.referenceTabControl.SuspendLayout(); |
||||
this.SuspendLayout(); |
||||
//
|
||||
// referenceTabControl
|
||||
//
|
||||
this.referenceTabControl.Controls.AddRange(new System.Windows.Forms.Control[] { |
||||
this.gacTabPage, |
||||
this.projectTabPage, |
||||
this.browserTabPage, |
||||
}); |
||||
this.referenceTabControl.Location = new System.Drawing.Point(8, 8); |
||||
this.referenceTabControl.SelectedIndex = 0; |
||||
this.referenceTabControl.Size = new System.Drawing.Size(472, 224); |
||||
this.referenceTabControl.TabIndex = 0; |
||||
//
|
||||
// referencesListView
|
||||
//
|
||||
this.referencesListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { |
||||
this.referenceHeader, |
||||
this.typeHeader, |
||||
this.locationHeader}); |
||||
this.referencesListView.Location = new System.Drawing.Point(8, 256); |
||||
this.referencesListView.Size = new System.Drawing.Size(472, 97); |
||||
this.referencesListView.TabIndex = 3; |
||||
this.referencesListView.View = System.Windows.Forms.View.Details; |
||||
this.referencesListView.FullRowSelect = true; |
||||
|
||||
|
||||
//
|
||||
// selectButton
|
||||
//
|
||||
this.selectButton.Location = new System.Drawing.Point(488, 32); |
||||
this.selectButton.TabIndex = 1; |
||||
this.selectButton.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.SelectButton"); |
||||
this.selectButton.Click += new EventHandler(SelectReference); |
||||
this.selectButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// removeButton
|
||||
//
|
||||
this.removeButton.Location = new System.Drawing.Point(488, 256); |
||||
this.removeButton.TabIndex = 4; |
||||
this.removeButton.Text = ResourceService.GetString("Global.RemoveButtonText"); |
||||
this.removeButton.Click += new EventHandler(RemoveReference); |
||||
this.removeButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// gacTabPage
|
||||
//
|
||||
this.gacTabPage.Location = new System.Drawing.Point(4, 22); |
||||
this.gacTabPage.Size = new System.Drawing.Size(464, 198); |
||||
this.gacTabPage.TabIndex = 0; |
||||
this.gacTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.GacTabPage"); |
||||
this.gacTabPage.UseVisualStyleBackColor = true; |
||||
//
|
||||
// projectTabPage
|
||||
//
|
||||
this.projectTabPage.Location = new System.Drawing.Point(4, 22); |
||||
this.projectTabPage.Size = new System.Drawing.Size(464, 198); |
||||
this.projectTabPage.TabIndex = 1; |
||||
this.projectTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ProjectTabPage"); |
||||
this.projectTabPage.UseVisualStyleBackColor = true; |
||||
//
|
||||
// browserTabPage
|
||||
//
|
||||
this.browserTabPage.Location = new System.Drawing.Point(4, 22); |
||||
this.browserTabPage.Size = new System.Drawing.Size(464, 198); |
||||
this.browserTabPage.TabIndex = 2; |
||||
this.browserTabPage.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.BrowserTabPage"); |
||||
this.browserTabPage.UseVisualStyleBackColor = true; |
||||
//
|
||||
// referencesLabel
|
||||
//
|
||||
this.referencesLabel.Location = new System.Drawing.Point(8, 240); |
||||
this.referencesLabel.Size = new System.Drawing.Size(472, 16); |
||||
this.referencesLabel.TabIndex = 2; |
||||
this.referencesLabel.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ReferencesLabel"); |
||||
//
|
||||
// referenceHeader
|
||||
//
|
||||
this.referenceHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.ReferenceHeader"); |
||||
this.referenceHeader.Width = 183; |
||||
//
|
||||
// typeHeader
|
||||
//
|
||||
this.typeHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.TypeHeader"); |
||||
this.typeHeader.Width = 57; |
||||
//
|
||||
// locationHeader
|
||||
//
|
||||
this.locationHeader.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.LocationHeader"); |
||||
this.locationHeader.Width = 228; |
||||
//
|
||||
// okButton
|
||||
//
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK; |
||||
this.okButton.Location = new System.Drawing.Point(312, 368); |
||||
this.okButton.TabIndex = 5; |
||||
this.okButton.Text = ResourceService.GetString("Global.OKButtonText"); |
||||
this.okButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
||||
this.cancelButton.Location = new System.Drawing.Point(400, 368); |
||||
this.cancelButton.TabIndex = 6; |
||||
this.cancelButton.Text = ResourceService.GetString("Global.CancelButtonText"); |
||||
this.cancelButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// helpButton
|
||||
//
|
||||
this.helpButton.Location = new System.Drawing.Point(488, 368); |
||||
this.helpButton.TabIndex = 7; |
||||
this.helpButton.Text = ResourceService.GetString("Global.HelpButtonText"); |
||||
this.helpButton.FlatStyle = FlatStyle.System; |
||||
|
||||
//
|
||||
// SelectReferenceDialog
|
||||
//
|
||||
this.AcceptButton = this.okButton; |
||||
this.CancelButton = this.cancelButton; |
||||
this.ClientSize = new System.Drawing.Size(570, 399); |
||||
this.Controls.AddRange(new System.Windows.Forms.Control[] { |
||||
this.helpButton, |
||||
this.cancelButton, |
||||
this.okButton, |
||||
this.referencesLabel, |
||||
this.removeButton, |
||||
this.selectButton, |
||||
this.referencesListView, |
||||
this.referenceTabControl}); |
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; |
||||
this.MaximizeBox = false; |
||||
this.MinimizeBox = false; |
||||
this.ShowInTaskbar = false; |
||||
this.Text = ResourceService.GetString("Dialog.SelectReferenceDialog.DialogName"); |
||||
this.referenceTabControl.ResumeLayout(false); |
||||
this.ResumeLayout(false); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator="Mike Krueger"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Console Application</Name> |
||||
<Category>C#</Category> |
||||
<Subcategory>Mono</Subcategory> |
||||
<Icon>C#.Project.DOSProject</Icon> |
||||
<Description>Console project for Mono.</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "Program.cs"/> |
||||
<RunCommand path = "/SharpDevelop/BackendBindings/TemplateCommands/AddDotNet35ReferencesIfTargetFrameworkIs35"/> |
||||
</Actions> |
||||
|
||||
<!-- Template Content --> |
||||
<Project language = "C#"> |
||||
<PropertyGroup> |
||||
<OutputType>Exe</OutputType> |
||||
<MonoTargetFrameworkVersion>v2.0</MonoTargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
<ProjectItems> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ProjectItems> |
||||
<Imports clear="True"> |
||||
<Import Project="$(MonoBuildTasksPath)\Mono.Build.CSharp.targets" /> |
||||
</Imports> |
||||
<Files> |
||||
<File name="Program.cs"><![CDATA[${StandardHeader.C#} |
||||
|
||||
using System; |
||||
|
||||
namespace ${StandardNamespace} |
||||
{ |
||||
class Program |
||||
{ |
||||
public static void Main(string[] args) |
||||
{ |
||||
Console.WriteLine("Hello World!"); |
||||
|
||||
// TODO: Implement Functionality Here |
||||
} |
||||
} |
||||
}]]></File> |
||||
<File name="AssemblyInfo.cs" src="DefaultAssemblyInfo.cs"/> |
||||
</Files> |
||||
</Project> |
||||
</Template> |
@ -0,0 +1,10 @@
@@ -0,0 +1,10 @@
|
||||
<configuration> |
||||
<runtime> |
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
<dependentAssembly> |
||||
<assemblyIdentity name="System" publicKeyToken="b77a5c561934e089" culture="neutral"/> |
||||
<bindingRedirect oldVersion="1.0.5000.0" newVersion="2.0.0.0" /> |
||||
</dependentAssembly> |
||||
</assemblyBinding> |
||||
</runtime> |
||||
</configuration> |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
#region Using directives
|
||||
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
#endregion
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("${ProjectName}")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("${ProjectName}")] |
||||
[assembly: AssemblyCopyright("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all the values or you can use the default the Revision and
|
||||
// Build Numbers by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")] |
@ -0,0 +1,31 @@
@@ -0,0 +1,31 @@
|
||||
Imports System.Reflection |
||||
Imports System.Runtime.CompilerServices |
||||
Imports System.Runtime.InteropServices |
||||
|
||||
' 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("${ProjectName}")> |
||||
<assembly: AssemblyDescription("")> |
||||
<assembly: AssemblyConfiguration("")> |
||||
<assembly: AssemblyCompany("")> |
||||
<assembly: AssemblyProduct("${ProjectName}")> |
||||
<assembly: AssemblyCopyright("")> |
||||
<assembly: AssemblyTrademark("")> |
||||
<assembly: AssemblyCulture("")> |
||||
|
||||
' This sets the default COM visibility of types in the assembly to invisible. |
||||
' If you need to expose a type to COM, use <ComVisible(true)> on that type. |
||||
<assembly: ComVisible(False)> |
||||
|
||||
' 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.*")> |
@ -0,0 +1,59 @@
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Shinsaku Nakagawa" |
||||
created = "11/28/2002" |
||||
lastModified = "07/20/2005"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Console Application</Name> |
||||
<Category>VBNet</Category> |
||||
<Subcategory>Mono</Subcategory> |
||||
<Icon>VBNet.Project.DOSProject</Icon> |
||||
<Description>Console project for Mono.</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "Program.vb"/> |
||||
</Actions> |
||||
|
||||
<!-- Template Content --> |
||||
<Project language = "VBNet"> |
||||
<PropertyGroup> |
||||
<OutputType>Exe</OutputType> |
||||
<MonoTargetFrameworkVersion>v2.0</MonoTargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Xml" /> |
||||
|
||||
<Import Include="Microsoft.VisualBasic" /> |
||||
<Import Include="System" /> |
||||
<Import Include="System.Collections" /> |
||||
<Import Include="System.Collections.Generic" /> |
||||
<Import Include="System.Data" /> |
||||
<Import Include="System.Diagnostics" /> |
||||
</ProjectItems> |
||||
|
||||
<Imports clear="True"> |
||||
<Import Project="$(MonoBuildTasksPath)\Mono.Build.VBNet.targets" /> |
||||
</Imports> |
||||
|
||||
<Files> |
||||
<File name="Program.vb"> |
||||
<![CDATA[${StandardHeader.VBNET} |
||||
|
||||
Module Program |
||||
Sub Main() |
||||
Console.WriteLine("Hello World!") |
||||
|
||||
' TODO: Implement Functionality Here |
||||
End Sub |
||||
End Module |
||||
]]></File> |
||||
<File name="AssemblyInfo.vb" src="DefaultAssemblyInfo.vb"/> |
||||
</Files> |
||||
</Project> |
||||
</Template> |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0"?> |
||||
<Template originator = "Matt Ward" |
||||
created = "15/02/2006" |
||||
lastModified = "15/02/2006"> |
||||
|
||||
<!-- Template Header --> |
||||
<TemplateConfiguration> |
||||
<Name>Gtk# Application</Name> |
||||
<Category>VBNet</Category> |
||||
<Subcategory>Mono</Subcategory> |
||||
<Icon>VBNet.Project.Form</Icon> |
||||
<Description>A project that creates a Gtk# application.</Description> |
||||
</TemplateConfiguration> |
||||
|
||||
<!-- Actions --> |
||||
<Actions> |
||||
<Open filename = "MainWindow.vb"/> |
||||
</Actions> |
||||
|
||||
<Project language="VBNet"> |
||||
<PropertyGroup> |
||||
<OutputType>WinExe</OutputType> |
||||
<MonoTargetFrameworkVersion>v2.0</MonoTargetFrameworkVersion> |
||||
<StartupObject>${StandardNamespace}.MainWindow</StartupObject> |
||||
</PropertyGroup> |
||||
|
||||
<Imports clear="True"> |
||||
<Import Project="$(MonoBuildTasksPath)\Mono.Build.VBNet.targets" /> |
||||
</Imports> |
||||
|
||||
<ProjectItems> |
||||
<Reference Include="atk-sharp" /> |
||||
<Reference Include="gdk-sharp" /> |
||||
<Reference Include="glib-sharp" /> |
||||
<Reference Include="gtk-sharp" /> |
||||
<Reference Include="pango-sharp" /> |
||||
<Reference Include="System" /> |
||||
|
||||
<Import Include="System" /> |
||||
<Import Include="System.Collections" /> |
||||
</ProjectItems> |
||||
|
||||
<Files> |
||||
<File name="MainWindow.vb"><![CDATA[${StandardHeader.VBNET} |
||||
Imports Gtk |
||||
Imports System |
||||
|
||||
Public Class MainWindow |
||||
Inherits Window |
||||
|
||||
Public Sub New |
||||
MyBase.New("MainWindow") |
||||
AddHandler MyBase.DeleteEvent, AddressOf MainWindowDelete |
||||
Me.ShowAll() |
||||
End Sub |
||||
|
||||
Public Shared Sub Main |
||||
Application.Init() |
||||
Dim mainWindow As New MainWindow |
||||
Application.Run() |
||||
End Sub |
||||
|
||||
Private Sub MainWindowDelete(ByVal o As Object, ByVal args As DeleteEventArgs) |
||||
Application.Quit() |
||||
args.RetVal = true |
||||
End Sub |
||||
End Class |
||||
]]></File> |
||||
<File name="AssemblyInfo.vb" src="DefaultAssemblyInfo.vb"/> |
||||
<File name="app.config" src="DefaultApp.config"/> |
||||
</Files> |
||||
</Project> |
||||
</Template> |
@ -0,0 +1,67 @@
@@ -0,0 +1,67 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using Mono.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace Mono.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class GeneralMonoErrorParseTestFixture |
||||
{ |
||||
Match match; |
||||
|
||||
[TestFixtureSetUp] |
||||
public void FixtureSetUp() |
||||
{ |
||||
string error = "error CS1904: `CS0169' is not a valid warning number"; |
||||
|
||||
Regex regex = new Regex(MonoCSharpCompilerResultsParser.GeneralErrorPattern, RegexOptions.Compiled); |
||||
match = regex.Match(error); |
||||
} |
||||
|
||||
[Test] |
||||
public void Error() |
||||
{ |
||||
Assert.AreEqual("error", match.Result("${error}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorNumber() |
||||
{ |
||||
Assert.AreEqual("CS1904", match.Result("${number}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorText() |
||||
{ |
||||
Assert.AreEqual("`CS0169' is not a valid warning number", match.Result("${message}")); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,48 @@
@@ -0,0 +1,48 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using Mono.Build.Tasks; |
||||
using System; |
||||
|
||||
namespace Mono.Build.Tasks.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Helper class that allows us to test protected methods of the
|
||||
/// Mbas class.
|
||||
/// </summary>
|
||||
public class MockMbas : Vbnc |
||||
{ |
||||
/// <summary>
|
||||
/// Generates the Mbas command line arguments via the protected
|
||||
/// GenerateCommandLineArguments method.
|
||||
/// </summary>
|
||||
public string GetCommandLine() |
||||
{ |
||||
return base.GenerateResponseFileCommands(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,57 @@
@@ -0,0 +1,57 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using Mono.Build.Tasks; |
||||
using System; |
||||
|
||||
namespace Mono.Build.Tasks.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Helper class that allows us to test protected methods of the
|
||||
/// MonoCSharpCompilerTask class.
|
||||
/// </summary>
|
||||
public class MockMonoCSharpCompilerTask : MonoCSharpCompilerTask |
||||
{ |
||||
/// <summary>
|
||||
/// Generates the MonoCSharpCompilerTask command line arguments via the
|
||||
/// protected GenerateCommandLineArguments method.
|
||||
/// </summary>
|
||||
public string GetCommandLine() |
||||
{ |
||||
return base.GenerateResponseFileCommands(); |
||||
} |
||||
|
||||
protected override string ToolName { |
||||
get { return "MonoCSharp.exe"; } |
||||
} |
||||
|
||||
protected override string GenerateFullPathToTool() |
||||
{ |
||||
return MonoToolLocationHelper.GetPathToTool(ToolName); |
||||
} |
||||
} |
||||
} |
@ -1,17 +1,37 @@
@@ -1,17 +1,37 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using Mono.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.Build.Tasks.Tests |
||||
namespace Mono.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class MonoBasicCommandLineTestFixture |
@ -1,17 +1,37 @@
@@ -1,17 +1,37 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using Mono.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.Build.Tasks.Tests |
||||
namespace Mono.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class MonoCSharpCompilerCommandLineTestFixture |
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using Mono.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace Mono.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class NormalMbasErrorParseTestFixture |
||||
{ |
||||
Match match; |
||||
|
||||
[TestFixtureSetUp] |
||||
public void FixtureSetUp() |
||||
{ |
||||
string error = "Form1.vb(38,3) error BC30201: Expression expected"; |
||||
|
||||
Regex regex = new Regex(MonoBasicCompilerResultsParser.NormalErrorPattern, RegexOptions.Compiled); |
||||
match = regex.Match(error); |
||||
} |
||||
|
||||
[Test] |
||||
public void Column() |
||||
{ |
||||
Assert.AreEqual("3", match.Result("${column}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Line() |
||||
{ |
||||
Assert.AreEqual("38", match.Result("${line}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void FileName() |
||||
{ |
||||
Assert.AreEqual("Form1.vb", match.Result("${file}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Warning() |
||||
{ |
||||
Assert.AreEqual("error", match.Result("${error}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorNumber() |
||||
{ |
||||
Assert.AreEqual("BC30201", match.Result("${number}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorText() |
||||
{ |
||||
Assert.AreEqual("Expression expected", match.Result("${message}")); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using Mono.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace Mono.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class NormalMonoErrorParseTestFixture |
||||
{ |
||||
Match match; |
||||
|
||||
[TestFixtureSetUp] |
||||
public void FixtureSetUp() |
||||
{ |
||||
string error = "MyClass.cs(19,7): warning CS0169: The private field `Foo.MyClass.foo' is never used"; |
||||
|
||||
Regex regex = new Regex(MonoCSharpCompilerResultsParser.NormalErrorPattern, RegexOptions.Compiled); |
||||
match = regex.Match(error); |
||||
} |
||||
|
||||
[Test] |
||||
public void Column() |
||||
{ |
||||
Assert.AreEqual("7", match.Result("${column}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Line() |
||||
{ |
||||
Assert.AreEqual("19", match.Result("${line}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void FileName() |
||||
{ |
||||
Assert.AreEqual("MyClass.cs", match.Result("${file}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Warning() |
||||
{ |
||||
Assert.AreEqual("warning", match.Result("${error}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorNumber() |
||||
{ |
||||
Assert.AreEqual("CS0169", match.Result("${number}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorText() |
||||
{ |
||||
Assert.AreEqual("The private field `Foo.MyClass.foo' is never used", match.Result("${message}")); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
using System; |
||||
using System.Reflection; |
||||
using System.Runtime.InteropServices; |
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Mono.Build.Tasks")] |
||||
[assembly: AssemblyDescription("")] |
||||
[assembly: AssemblyConfiguration("")] |
||||
[assembly: AssemblyCompany("")] |
||||
[assembly: AssemblyProduct("SharpDevelop")] |
||||
[assembly: AssemblyCopyright("")] |
||||
[assembly: AssemblyTrademark("")] |
||||
[assembly: AssemblyCulture("")] |
||||
|
||||
// This sets the default COM visibility of types in the assembly to invisible.
|
||||
// If you need to expose a type to COM, use [ComVisible(true)] on that type.
|
||||
[assembly: ComVisible(false)] |
||||
|
||||
// The assembly version has following format :
|
||||
//
|
||||
// Major.Minor.Build.Revision
|
||||
//
|
||||
// You can specify all the values or you can use the default the Revision and
|
||||
// Build Numbers by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.0.*")] |
@ -0,0 +1,93 @@
@@ -0,0 +1,93 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the path to the Mono Framework assemblies.
|
||||
/// </summary>
|
||||
public class GetMonoFrameworkPath : Task |
||||
{ |
||||
public const string TargetMonoFrameworkVersion11 = "v1.1"; |
||||
public const string TargetMonoFrameworkVersion20 = "v2.0"; |
||||
|
||||
string path = String.Empty; |
||||
TargetMonoFrameworkVersion targetFrameworkVersion = TargetMonoFrameworkVersion.VersionLatest; |
||||
|
||||
public GetMonoFrameworkPath() |
||||
{ |
||||
} |
||||
|
||||
[Output] |
||||
public string Path { |
||||
get { return path; } |
||||
set { path = value; } |
||||
} |
||||
|
||||
public string TargetFrameworkVersion { |
||||
get { return ConvertToString(targetFrameworkVersion); } |
||||
set { targetFrameworkVersion = ConvertToEnum(value); } |
||||
} |
||||
|
||||
public override bool Execute() |
||||
{ |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
System.Diagnostics.Debug.WriteLine("TargetFrameworkVersion: " + targetFrameworkVersion.ToString()); |
||||
path = MonoToolLocationHelper.GetPathToMonoFramework(targetFrameworkVersion); |
||||
System.Diagnostics.Debug.WriteLine("MonoFrameworkPath: " + path); |
||||
return true; |
||||
} |
||||
Log.LogError("Mono is not installed."); |
||||
return false; |
||||
} |
||||
|
||||
static string ConvertToString(TargetMonoFrameworkVersion frameworkVersion) |
||||
{ |
||||
switch (frameworkVersion) { |
||||
case TargetMonoFrameworkVersion.Version11: |
||||
return TargetMonoFrameworkVersion11; |
||||
case TargetMonoFrameworkVersion.Version20: |
||||
return TargetMonoFrameworkVersion20; |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
static TargetMonoFrameworkVersion ConvertToEnum(string frameworkVersion) |
||||
{ |
||||
if (frameworkVersion == TargetMonoFrameworkVersion11) { |
||||
return TargetMonoFrameworkVersion.Version11; |
||||
} else if (frameworkVersion == TargetMonoFrameworkVersion20) { |
||||
return TargetMonoFrameworkVersion.Version20; |
||||
} |
||||
throw new ArgumentException("Unknown Mono target framework version: " + frameworkVersion); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,62 @@
@@ -0,0 +1,62 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the path to the Mono SDK folder.
|
||||
/// </summary>
|
||||
public class GetMonoFrameworkSdkPath : Task |
||||
{ |
||||
string path = String.Empty; |
||||
|
||||
public GetMonoFrameworkSdkPath() |
||||
{ |
||||
} |
||||
|
||||
[Output] |
||||
public string Path { |
||||
get { return path; } |
||||
set { path = value; } |
||||
} |
||||
|
||||
public override bool Execute() |
||||
{ |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
path = MonoToolLocationHelper.GetPathToMonoSdk(); |
||||
Log.LogMessage(MessageImportance.Low, "MonoSdk: " + path); |
||||
return true; |
||||
} |
||||
Log.LogError("Mono is not installed."); |
||||
return false; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// MSBuild task for Mono's GMCS.
|
||||
/// </summary>
|
||||
public class Gmcs : MonoCSharpCompilerTask |
||||
{ |
||||
protected override string ToolName { |
||||
get { return "Gmcs.exe"; } |
||||
} |
||||
|
||||
protected override string GenerateFullPathToTool() |
||||
{ |
||||
return MonoToolLocationHelper.GetPathToTool(ToolName); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,46 @@
@@ -0,0 +1,46 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// MSBuild task for Mono's MCS.
|
||||
/// </summary>
|
||||
public class Mcs : MonoCSharpCompilerTask |
||||
{ |
||||
protected override string ToolName { |
||||
get { return "Mcs.exe"; } |
||||
} |
||||
|
||||
protected override string GenerateFullPathToTool() |
||||
{ |
||||
return MonoToolLocationHelper.GetPathToTool(ToolName); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,81 @@
@@ -0,0 +1,81 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
|
||||
<UsingTask TaskName="Microsoft.Build.Tasks.CreateVisualBasicManifestResourceName" AssemblyName="Microsoft.Build.Tasks, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/> |
||||
|
||||
<PropertyGroup> |
||||
<MSBuildAllProjects>$(MSBuildAllProjects);$(MonoBuildTasksPath)\Mono.Build.CSharp.targets</MSBuildAllProjects> |
||||
</PropertyGroup> |
||||
|
||||
<PropertyGroup> |
||||
<CreateManifestResourceNamesDependsOn></CreateManifestResourceNamesDependsOn> |
||||
</PropertyGroup> |
||||
<Target |
||||
Name="CreateManifestResourceNames" |
||||
Condition="'@(ResxWithNoCulture)@(ResxWithCulture)@(NonResxWithNoCulture)@(NonResxWithCulture)'!=''" |
||||
DependsOnTargets="$(CreateManifestResourceNamesDependsOn)" |
||||
> |
||||
|
||||
<!-- Create the target resource names for non-culture resx files. --> |
||||
<CreateVisualBasicManifestResourceName Condition="'@(ResxWithNoCulture)'!=''" |
||||
ResourceFiles="@(ResxWithNoCulture)" |
||||
RootNamespace="$(RootNamespace)"> |
||||
|
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithNoCultureName"/> |
||||
|
||||
</CreateVisualBasicManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for culture resx files. --> |
||||
<CreateVisualBasicManifestResourceName Condition="'@(ResxWithCulture)'!=''" |
||||
ResourceFiles="@(ResxWithCulture)" |
||||
RootNamespace="$(RootNamespace)"> |
||||
|
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestResourceWithCultureName"/> |
||||
|
||||
</CreateVisualBasicManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for non-culture non-resx files. --> |
||||
<CreateVisualBasicManifestResourceName Condition="'@(NonResxWithNoCulture)'!=''" |
||||
ResourceFiles="@(NonResxWithNoCulture)" |
||||
RootNamespace="$(RootNamespace)"> |
||||
|
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithNoCulture"/> |
||||
|
||||
</CreateVisualBasicManifestResourceName> |
||||
|
||||
<!-- Create the target resource names for culture non-resx files. --> |
||||
<CreateVisualBasicManifestResourceName Condition="'@(NonResxWithCulture)'!=''" |
||||
ResourceFiles="@(NonResxWithCulture)" |
||||
RootNamespace="$(RootNamespace)"> |
||||
|
||||
<Output TaskParameter="ManifestResourceNames" ItemName="ManifestNonResxWithCulture"/> |
||||
|
||||
</CreateVisualBasicManifestResourceName> |
||||
</Target> |
||||
|
||||
<PropertyGroup> |
||||
<!-- "None" is not technically a valid DebugType, so we can't pass it in as such |
||||
to the compiler. So here, we modify the properties so they make sense. --> |
||||
<DebugSymbols Condition=" '$(DebugType)' == 'none' ">false</DebugSymbols> |
||||
<DebugType Condition=" '$(DebugType)' == 'none' "></DebugType> |
||||
|
||||
<!-- Provide a facility to override UseHostCompilerIfAvailable--> |
||||
<UseHostCompilerIfAvailable Condition=" '$(UseHostCompilerIfAvailable)' == ''">true</UseHostCompilerIfAvailable> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<DocFileItem Include="$(IntermediateOutputPath)$(DocumentationFile)" Condition="'$(DocumentationFile)'!=''"> |
||||
<InProject>false</InProject> |
||||
</DocFileItem> |
||||
</ItemGroup> |
||||
|
||||
<PropertyGroup> |
||||
<CoreCompileDependsOn>_ComputeNonExistentFileProperty</CoreCompileDependsOn> |
||||
</PropertyGroup> |
||||
|
||||
<!-- Use Microsoft's C# standard targets --> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
||||
|
||||
<!-- Mono imports --> |
||||
<Import Condition=" '$(MonoTargetFrameworkVersion)' == 'v1.1' " Project="$(MonoBuildTasksPath)\SharpDevelop.Build.Mono.Mcs.targets"/> |
||||
<Import Condition=" '$(MonoTargetFrameworkVersion)' == 'v2.0' " Project="$(MonoBuildTasksPath)\SharpDevelop.Build.Mono.Gmcs.targets"/> |
||||
</Project> |
@ -0,0 +1,85 @@
@@ -0,0 +1,85 @@
|
||||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<ProjectGuid>{BF6F814C-B89F-475E-ADC4-AEE81D10CB94}</ProjectGuid> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>Mono.Build.Tasks</RootNamespace> |
||||
<AssemblyName>Mono.Build.Tasks</AssemblyName> |
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>bin\Debug\</OutputPath> |
||||
<DebugSymbols>True</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<Optimize>False</Optimize> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>bin\Release\</OutputPath> |
||||
<DebugSymbols>False</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<Optimize>True</Optimize> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
</PropertyGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
<ItemGroup> |
||||
<Reference Include="ICSharpCode.Core"> |
||||
<HintPath>..\..\..\bin\ICSharpCode.Core.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="ICSharpCode.SharpDevelop"> |
||||
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="ICSharpCode.SharpDevelop.Dom"> |
||||
<HintPath>..\..\..\bin\ICSharpCode.SharpDevelop.Dom.dll</HintPath> |
||||
<Private>False</Private> |
||||
</Reference> |
||||
<Reference Include="Microsoft.Build.Framework" /> |
||||
<Reference Include="Microsoft.Build.Tasks.v3.5"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="Microsoft.Build.Utilities.v3.5"> |
||||
<RequiredTargetFramework>3.5</RequiredTargetFramework> |
||||
</Reference> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<Compile Include="AddMonoAssemblySearchPaths.cs" /> |
||||
<Compile Include="AssemblyInfo.cs" /> |
||||
<Compile Include="CompilerCommandLineArguments.cs" /> |
||||
<Compile Include="GetMonoFrameworkPath.cs" /> |
||||
<Compile Include="GetMonoFrameworkSdkPath.cs" /> |
||||
<Compile Include="Gmcs.cs" /> |
||||
<Compile Include="Mcs.cs" /> |
||||
<Compile Include="MonoAssemblyName.cs" /> |
||||
<Compile Include="MonoBasicCompilerResultsParser.cs" /> |
||||
<Compile Include="MonoCompilerTask.cs" /> |
||||
<Compile Include="MonoCSharpCompilerResultsParser.cs" /> |
||||
<Compile Include="MonoCSharpCompilerTask.cs" /> |
||||
<Compile Include="MonoGacDirectory.cs" /> |
||||
<Compile Include="MonoGlobalAssemblyCache.cs" /> |
||||
<Compile Include="MonoToolLocationHelper.cs" /> |
||||
<Compile Include="TargetMonoFrameworkVersion.cs" /> |
||||
<Compile Include="Vbnc.cs" /> |
||||
<None Include="Mono.Build.CSharp.targets"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="Mono.Build.VBNet.targets"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="SharpDevelop.Build.Mono.Gmcs.targets"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="SharpDevelop.Build.Mono.Mcs.targets"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<None Include="SharpDevelop.Build.Mono.Vbnc.targets"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
</ItemGroup> |
||||
</Project> |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<!-- Use Microsoft's VB standard targets --> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.VisualBasic.targets" /> |
||||
|
||||
<PropertyGroup> |
||||
<CoreCompileDependsOn>_ComputeNonExistentFileProperty</CoreCompileDependsOn> |
||||
</PropertyGroup> |
||||
|
||||
<!-- Mono imports --> |
||||
<Import Project="$(MonoBuildTasksPath)\SharpDevelop.Build.Mono.Vbnc.targets"/> |
||||
</Project> |
@ -0,0 +1,62 @@
@@ -0,0 +1,62 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using System.CodeDom.Compiler; |
||||
using System.IO; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
public class MonoBasicCompilerResultsParser |
||||
{ |
||||
public const string NormalErrorPattern = @"(?<file>.*)\((?<line>\d+),(?<column>\d+)\)\s+(?<error>\w+)\s+(?<number>[\d\w]+):\s+(?<message>.*)"; |
||||
|
||||
Regex normalError = new Regex(NormalErrorPattern, RegexOptions.Compiled); |
||||
|
||||
public MonoBasicCompilerResultsParser() |
||||
{ |
||||
} |
||||
|
||||
public CompilerError ParseLine(string line) |
||||
{ |
||||
// try to match standard mono errors
|
||||
Match match = normalError.Match(line); |
||||
if (match.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
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}"); |
||||
return error; |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,73 @@
@@ -0,0 +1,73 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using System.CodeDom.Compiler; |
||||
using System.IO; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
public class MonoCSharpCompilerResultsParser |
||||
{ |
||||
public const string NormalErrorPattern = @"(?<file>.*)\((?<line>\d+),(?<column>\d+)\):\s+(?<error>\w+)\s+(?<number>[\d\w]+):\s+(?<message>.*)"; |
||||
public const string GeneralErrorPattern = @"(?<error>.+?)\s+(?<number>[\d\w]+?):\s+(?<message>.*)"; |
||||
|
||||
Regex normalError = new Regex(NormalErrorPattern, RegexOptions.Compiled); |
||||
Regex generalError = new Regex(GeneralErrorPattern, RegexOptions.Compiled); |
||||
|
||||
public MonoCSharpCompilerResultsParser() |
||||
{ |
||||
} |
||||
|
||||
public CompilerError ParseLine(string line) |
||||
{ |
||||
// try to match standard mono errors
|
||||
Match match = normalError.Match(line); |
||||
if (match.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
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}"); |
||||
return error; |
||||
} else { |
||||
match = generalError.Match(line); |
||||
if (match.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
error.IsWarning = match.Result("${error}") == "warning"; |
||||
error.ErrorNumber = match.Result("${number}"); |
||||
error.ErrorText = match.Result("${message}"); |
||||
return error; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,209 @@
@@ -0,0 +1,209 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using System.CodeDom.Compiler; |
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Base class task for the mono compilers mcs, gmcs and mbas.
|
||||
/// </summary>
|
||||
public abstract class MonoCompilerTask : ToolTask |
||||
{ |
||||
public const int DefaultWarningLevel = 2; |
||||
|
||||
string[] additionalLibPaths; |
||||
string[] addModules; |
||||
bool allowUnsafeBlocks; |
||||
int codePage; |
||||
string debugType; |
||||
string defineConstants; |
||||
string disabledWarnings; |
||||
bool emitDebugInformation; |
||||
ITaskItem[] linkResources; |
||||
string mainEntryPoint; |
||||
bool noLogo; |
||||
bool noStandardLib; |
||||
bool optimize; |
||||
ITaskItem outputAssembly; |
||||
ITaskItem[] references; |
||||
ITaskItem[] resources; |
||||
ITaskItem[] responseFiles; |
||||
ITaskItem[] sources; |
||||
string targetType; |
||||
bool treatWarningsAsErrors; |
||||
int? warningLevel; |
||||
|
||||
public bool AllowUnsafeBlocks { |
||||
get { return allowUnsafeBlocks; } |
||||
set { allowUnsafeBlocks = value; } |
||||
} |
||||
|
||||
public string[] AdditionalLibPaths { |
||||
get { return additionalLibPaths; } |
||||
set { additionalLibPaths = value; } |
||||
} |
||||
|
||||
public string[] AddModules { |
||||
get { return addModules; } |
||||
set { addModules = value; } |
||||
} |
||||
|
||||
public int CodePage { |
||||
get { return codePage; } |
||||
set { codePage = value; } |
||||
} |
||||
|
||||
public string DebugType { |
||||
get { return debugType; } |
||||
set { debugType = value; } |
||||
} |
||||
|
||||
public string DefineConstants { |
||||
get { return defineConstants; } |
||||
set { defineConstants = value; } |
||||
} |
||||
|
||||
public string DisabledWarnings { |
||||
get { return disabledWarnings; } |
||||
set { disabledWarnings = value; } |
||||
} |
||||
|
||||
public bool EmitDebugInformation { |
||||
get { return emitDebugInformation; } |
||||
set { emitDebugInformation = value; } |
||||
} |
||||
|
||||
public ITaskItem[] LinkResources { |
||||
get { return linkResources; } |
||||
set { linkResources = value; } |
||||
} |
||||
|
||||
public string MainEntryPoint { |
||||
get { return mainEntryPoint; } |
||||
set { mainEntryPoint = value; } |
||||
} |
||||
|
||||
public bool NoLogo { |
||||
get { return noLogo; } |
||||
set { noLogo = value; } |
||||
} |
||||
|
||||
public bool NoStandardLib { |
||||
get { return noStandardLib; } |
||||
set { noStandardLib = value; } |
||||
} |
||||
|
||||
public bool Optimize { |
||||
get { return optimize; } |
||||
set { optimize = value; } |
||||
} |
||||
|
||||
public ITaskItem OutputAssembly { |
||||
get { return outputAssembly; } |
||||
set { outputAssembly = value; } |
||||
} |
||||
|
||||
public ITaskItem[] References { |
||||
get { return references; } |
||||
set { references = value; } |
||||
} |
||||
|
||||
public ITaskItem[] Resources { |
||||
get { return resources; } |
||||
set { resources = value; } |
||||
} |
||||
|
||||
public ITaskItem[] ResponseFiles { |
||||
get { return responseFiles; } |
||||
set { responseFiles = value; } |
||||
} |
||||
|
||||
public ITaskItem[] Sources { |
||||
get { return sources; } |
||||
set { sources = value; } |
||||
} |
||||
|
||||
public string TargetType { |
||||
get { return targetType; } |
||||
set { targetType = value; } |
||||
} |
||||
|
||||
public bool TreatWarningsAsErrors { |
||||
get { return treatWarningsAsErrors; } |
||||
set { treatWarningsAsErrors = value; } |
||||
} |
||||
|
||||
public int WarningLevel { |
||||
get { |
||||
if (warningLevel.HasValue) { |
||||
return warningLevel.Value; |
||||
} |
||||
return DefaultWarningLevel; |
||||
} |
||||
set { warningLevel = value; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Determines whether the warning level property has been set.
|
||||
/// </summary>
|
||||
protected bool IsWarningLevelSet { |
||||
get { return warningLevel.HasValue; } |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns a compiler error from the standard output or standard
|
||||
/// error line.
|
||||
/// </summary>
|
||||
protected virtual CompilerError ParseLine(string line) |
||||
{ |
||||
return null; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Each line of output, from either standard output or standard error
|
||||
/// is parsed and any compiler errors are logged. If the line cannot
|
||||
/// be parsed it is logged using the specified message importance.
|
||||
/// </summary>
|
||||
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance) |
||||
{ |
||||
CompilerError error = ParseLine(singleLine); |
||||
if (error != null) { |
||||
if (error.IsWarning) { |
||||
Log.LogWarning("warning", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText); |
||||
} else { |
||||
Log.LogError("error", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText); |
||||
} |
||||
} else { |
||||
Log.LogMessage(messageImportance, singleLine); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,15 +1,35 @@
@@ -1,15 +1,35 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.IO; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
public class MonoGlobalAssemblyCache |
||||
{ |
@ -0,0 +1,38 @@
@@ -0,0 +1,38 @@
|
||||
// SharpDevelop samples
|
||||
// Copyright (c) 2006, AlphaSierraPapa
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification, are
|
||||
// permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this list
|
||||
// of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
// of conditions and the following disclaimer in the documentation and/or other materials
|
||||
// provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the SharpDevelop team nor the names of its contributors may be used to
|
||||
// endorse or promote products derived from this software without specific prior written
|
||||
// permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &AS IS& AND ANY EXPRESS
|
||||
// OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
|
||||
// AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||||
// IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
// OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System; |
||||
|
||||
namespace Mono.Build.Tasks |
||||
{ |
||||
public enum TargetMonoFrameworkVersion |
||||
{ |
||||
Version11 = 0, |
||||
Version20 = 1, |
||||
VersionLatest = 1 |
||||
} |
||||
} |
@ -1,81 +0,0 @@
@@ -1,81 +0,0 @@
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
||||
<PropertyGroup> |
||||
<OutputType>Library</OutputType> |
||||
<RootNamespace>ICSharpCode.MonoAddIn</RootNamespace> |
||||
<AssemblyName>MonoAddIn</AssemblyName> |
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> |
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> |
||||
<ProjectGuid>{082DCD64-EE32-4151-A50F-E139CF754CC0}</ProjectGuid> |
||||
<AllowUnsafeBlocks>False</AllowUnsafeBlocks> |
||||
<NoStdLib>False</NoStdLib> |
||||
<RegisterForComInterop>False</RegisterForComInterop> |
||||
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> |
||||
<BaseAddress>121110528</BaseAddress> |
||||
<PlatformTarget>AnyCPU</PlatformTarget> |
||||
<FileAlignment>4096</FileAlignment> |
||||
<WarningLevel>4</WarningLevel> |
||||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> |
||||
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\MonoAddIn\</OutputPath> |
||||
<Optimize>False</Optimize> |
||||
<DefineConstants>DEBUG;TRACE</DefineConstants> |
||||
<DebugSymbols>true</DebugSymbols> |
||||
<DebugType>Full</DebugType> |
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> |
||||
<OutputPath>..\..\..\..\..\AddIns\AddIns\Misc\MonoAddIn\</OutputPath> |
||||
<Optimize>True</Optimize> |
||||
<DefineConstants>TRACE</DefineConstants> |
||||
<DebugSymbols>false</DebugSymbols> |
||||
<DebugType>None</DebugType> |
||||
<CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> |
||||
</PropertyGroup> |
||||
<ItemGroup> |
||||
<Reference Include="System" /> |
||||
<Reference Include="System.Core" /> |
||||
<Reference Include="System.Data" /> |
||||
<Reference Include="System.Drawing" /> |
||||
<Reference Include="System.Windows.Forms" /> |
||||
<Reference Include="System.Xml" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<None Include="MonoAddIn.addin"> |
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
||||
</None> |
||||
<Compile Include="Configuration\AssemblyInfo.cs" /> |
||||
<Compile Include="Src\IsMonoInstalledCondition.cs" /> |
||||
<Compile Include="Src\MonoGacReferencePanel.cs" /> |
||||
<Compile Include="..\..\..\..\Main\GlobalAssemblyInfo.cs"> |
||||
<Link>Configuration\GlobalAssemblyInfo.cs</Link> |
||||
</Compile> |
||||
<Compile Include="Src\MonoProjectContentRegistry.cs" /> |
||||
</ItemGroup> |
||||
<ItemGroup> |
||||
<ProjectReference Include="..\..\..\..\Main\Base\Project\ICSharpCode.SharpDevelop.csproj"> |
||||
<Project>{2748AD25-9C63-4E12-877B-4DCE96FBED54}</Project> |
||||
<Name>ICSharpCode.SharpDevelop</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\Core\Project\ICSharpCode.Core.csproj"> |
||||
<Project>{35CEF10F-2D4C-45F2-9DD1-161E0FEC583C}</Project> |
||||
<Name>ICSharpCode.Core</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Libraries\ICSharpCode.Build.Tasks\Project\ICSharpCode.Build.Tasks.csproj"> |
||||
<Project>{4139CCF6-FB49-4A9D-B2CF-331E9EA3198D}</Project> |
||||
<Name>ICSharpCode.Build.Tasks</Name> |
||||
<Private>False</Private> |
||||
<SpecificVersion>False</SpecificVersion> |
||||
</ProjectReference> |
||||
<ProjectReference Include="..\..\..\..\Main\ICSharpCode.SharpDevelop.Dom\Project\ICSharpCode.SharpDevelop.Dom.csproj"> |
||||
<Project>{924EE450-603D-49C1-A8E5-4AFAA31CE6F3}</Project> |
||||
<Name>ICSharpCode.SharpDevelop.Dom</Name> |
||||
<Private>False</Private> |
||||
</ProjectReference> |
||||
</ItemGroup> |
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" /> |
||||
</Project> |
@ -1,24 +0,0 @@
@@ -1,24 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.Core; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
/// <summary>
|
||||
/// Determines whether Mono is installed.
|
||||
/// </summary>
|
||||
public class IsMonoInstalledCondition : IConditionEvaluator |
||||
{ |
||||
public bool IsValid(object caller, Condition condition) |
||||
{ |
||||
return MonoToolLocationHelper.IsMonoInstalled; |
||||
} |
||||
} |
||||
} |
@ -1,32 +0,0 @@
@@ -1,32 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Windows.Forms; |
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.SharpDevelop.Gui; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
public class MonoGacReferencePanel : GacReferencePanel |
||||
{ |
||||
public MonoGacReferencePanel(ISelectReferenceDialog selectDialog) : base(selectDialog) |
||||
{ |
||||
} |
||||
|
||||
protected override IList<DomAssemblyName> GetCacheContent() |
||||
{ |
||||
List<DomAssemblyName> list = new List<DomAssemblyName>(); |
||||
foreach (MonoAssemblyName assemblyName in MonoGlobalAssemblyCache.GetAssemblyNames()) { |
||||
list.Add(new DomAssemblyName(assemblyName.FullName)); |
||||
} |
||||
return list; |
||||
} |
||||
} |
||||
} |
@ -1,36 +0,0 @@
@@ -1,36 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Daniel Grunwald" email="daniel@danielgrunwald.de"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.IO; |
||||
using ICSharpCode.Build.Tasks; |
||||
using ICSharpCode.SharpDevelop; |
||||
using ICSharpCode.SharpDevelop.Dom; |
||||
|
||||
namespace ICSharpCode.MonoAddIn |
||||
{ |
||||
public class MonoProjectContentRegistry : ProjectContentRegistry |
||||
{ |
||||
protected override IProjectContent LoadProjectContent(string itemInclude, string itemFileName) |
||||
{ |
||||
if (File.Exists(itemFileName)) { |
||||
return ParserService.DefaultProjectContentRegistry.GetProjectContentForReference(itemInclude, itemFileName); |
||||
} |
||||
MonoAssemblyName assemblyName = MonoGlobalAssemblyCache.FindAssemblyName(itemInclude); |
||||
if (assemblyName != null && assemblyName.FileName != null) { |
||||
return CecilReader.LoadAssembly(assemblyName.FileName, this); |
||||
} else { |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
HostCallback.ShowAssemblyLoadError(itemFileName, itemInclude, "Could not find assembly in Mono's GAC."); |
||||
} else { |
||||
HostCallback.ShowAssemblyLoadError(itemFileName, itemInclude, "Could not find assembly in Mono's GAC - Mono is not installed."); |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,81 +0,0 @@
@@ -1,81 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the path to the Mono Framework assemblies.
|
||||
/// </summary>
|
||||
public class GetMonoFrameworkPath : Task |
||||
{ |
||||
public const string TargetMonoFrameworkVersion11 = "Mono v1.1"; |
||||
public const string TargetMonoFrameworkVersion20 = "Mono v2.0"; |
||||
|
||||
string path = String.Empty; |
||||
TargetMonoFrameworkVersion targetFrameworkVersion = TargetMonoFrameworkVersion.VersionLatest; |
||||
|
||||
public GetMonoFrameworkPath() |
||||
{ |
||||
} |
||||
|
||||
[Output] |
||||
public string Path { |
||||
get { |
||||
return path; |
||||
} |
||||
set { |
||||
path = value; |
||||
} |
||||
} |
||||
|
||||
public string TargetFrameworkVersion { |
||||
get { |
||||
return ConvertToString(targetFrameworkVersion); |
||||
} |
||||
set { |
||||
targetFrameworkVersion = ConvertToEnum(value); |
||||
} |
||||
} |
||||
|
||||
public override bool Execute() |
||||
{ |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
System.Diagnostics.Debug.WriteLine("TargetFrameworkVersion: " + targetFrameworkVersion.ToString()); |
||||
path = MonoToolLocationHelper.GetPathToMonoFramework(targetFrameworkVersion); |
||||
System.Diagnostics.Debug.WriteLine("MonoFrameworkPath: " + path); |
||||
return true; |
||||
} |
||||
Log.LogError(Resources.MonoIsNotInstalled); |
||||
return false; |
||||
} |
||||
|
||||
static string ConvertToString(TargetMonoFrameworkVersion frameworkVersion) |
||||
{ |
||||
switch (frameworkVersion) { |
||||
case TargetMonoFrameworkVersion.Version11: |
||||
return TargetMonoFrameworkVersion11; |
||||
case TargetMonoFrameworkVersion.Version20: |
||||
return TargetMonoFrameworkVersion20; |
||||
} |
||||
return null; |
||||
} |
||||
|
||||
static TargetMonoFrameworkVersion ConvertToEnum(string frameworkVersion) |
||||
{ |
||||
if (frameworkVersion == TargetMonoFrameworkVersion11) { |
||||
return TargetMonoFrameworkVersion.Version11; |
||||
} else if (frameworkVersion == TargetMonoFrameworkVersion20) { |
||||
return TargetMonoFrameworkVersion.Version20; |
||||
} |
||||
throw new ArgumentException(Resources.UnknownTargetMonoFrameworkVersion + " " + frameworkVersion); |
||||
} |
||||
} |
||||
} |
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using Microsoft.Build.Framework; |
||||
using Microsoft.Build.Utilities; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Gets the path to the Mono SDK folder.
|
||||
/// </summary>
|
||||
public class GetMonoFrameworkSdkPath : Task |
||||
{ |
||||
string path = String.Empty; |
||||
|
||||
public GetMonoFrameworkSdkPath() |
||||
{ |
||||
} |
||||
|
||||
[Output] |
||||
public string Path { |
||||
get { |
||||
return path; |
||||
} |
||||
set { |
||||
path = value; |
||||
} |
||||
} |
||||
|
||||
public override bool Execute() |
||||
{ |
||||
if (MonoToolLocationHelper.IsMonoInstalled) { |
||||
path = MonoToolLocationHelper.GetPathToMonoSdk(); |
||||
System.Diagnostics.Debug.WriteLine("MonoSdk: " + path); |
||||
return true; |
||||
} |
||||
Log.LogError(Resources.MonoIsNotInstalled); |
||||
return false; |
||||
|
||||
} |
||||
} |
||||
} |
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// MSBuild task for Mono's GMCS.
|
||||
/// </summary>
|
||||
public class Gmcs : MonoCSharpCompilerTask |
||||
{ |
||||
protected override string ToolName { |
||||
get { |
||||
return "Gmcs.exe"; |
||||
} |
||||
} |
||||
|
||||
protected override string GenerateFullPathToTool() |
||||
{ |
||||
return MonoToolLocationHelper.GetPathToTool(ToolName); |
||||
} |
||||
} |
||||
} |
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// MSBuild task for Mono's MCS.
|
||||
/// </summary>
|
||||
public class Mcs : MonoCSharpCompilerTask |
||||
{ |
||||
protected override string ToolName { |
||||
get { |
||||
return "Mcs.exe"; |
||||
} |
||||
} |
||||
|
||||
protected override string GenerateFullPathToTool() |
||||
{ |
||||
return MonoToolLocationHelper.GetPathToTool(ToolName); |
||||
} |
||||
} |
||||
} |
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.CodeDom.Compiler; |
||||
using System.IO; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
public class MonoBasicCompilerResultsParser |
||||
{ |
||||
public const string NormalErrorPattern = @"(?<file>.*)\((?<line>\d+),(?<column>\d+)\)\s+(?<error>\w+)\s+(?<number>[\d\w]+):\s+(?<message>.*)"; |
||||
|
||||
Regex normalError = new Regex(NormalErrorPattern, RegexOptions.Compiled); |
||||
|
||||
public MonoBasicCompilerResultsParser() |
||||
{ |
||||
} |
||||
|
||||
public CompilerError ParseLine(string line) |
||||
{ |
||||
// try to match standard mono errors
|
||||
Match match = normalError.Match(line); |
||||
if (match.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
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}"); |
||||
return error; |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -1,53 +0,0 @@
@@ -1,53 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.CodeDom.Compiler; |
||||
using System.IO; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
public class MonoCSharpCompilerResultsParser |
||||
{ |
||||
public const string NormalErrorPattern = @"(?<file>.*)\((?<line>\d+),(?<column>\d+)\):\s+(?<error>\w+)\s+(?<number>[\d\w]+):\s+(?<message>.*)"; |
||||
public const string GeneralErrorPattern = @"(?<error>.+?)\s+(?<number>[\d\w]+?):\s+(?<message>.*)"; |
||||
|
||||
Regex normalError = new Regex(NormalErrorPattern, RegexOptions.Compiled); |
||||
Regex generalError = new Regex(GeneralErrorPattern, RegexOptions.Compiled); |
||||
|
||||
public MonoCSharpCompilerResultsParser() |
||||
{ |
||||
} |
||||
|
||||
public CompilerError ParseLine(string line) |
||||
{ |
||||
// try to match standard mono errors
|
||||
Match match = normalError.Match(line); |
||||
if (match.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
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}"); |
||||
return error; |
||||
} else { |
||||
match = generalError.Match(line); |
||||
if (match.Success) { |
||||
CompilerError error = new CompilerError(); |
||||
error.IsWarning = match.Result("${error}") == "warning"; |
||||
error.ErrorNumber = match.Result("${number}"); |
||||
error.ErrorText = match.Result("${message}"); |
||||
return error; |
||||
} |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
} |
@ -1,272 +0,0 @@
@@ -1,272 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
using System.CodeDom.Compiler; |
||||
using Microsoft.Build.Framework; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
/// <summary>
|
||||
/// Base class task for the mono compilers mcs, gmcs and mbas.
|
||||
/// </summary>
|
||||
public abstract class MonoCompilerTask : MyToolTask |
||||
{ |
||||
public const int DefaultWarningLevel = 2; |
||||
|
||||
string[] additionalLibPaths; |
||||
string[] addModules; |
||||
bool allowUnsafeBlocks; |
||||
int codePage; |
||||
string debugType; |
||||
string defineConstants; |
||||
string disabledWarnings; |
||||
bool emitDebugInformation; |
||||
ITaskItem[] linkResources; |
||||
string mainEntryPoint; |
||||
bool noLogo; |
||||
bool noStandardLib; |
||||
bool optimize; |
||||
ITaskItem outputAssembly; |
||||
ITaskItem[] references; |
||||
ITaskItem[] resources; |
||||
ITaskItem[] responseFiles; |
||||
ITaskItem[] sources; |
||||
string targetType; |
||||
bool treatWarningsAsErrors; |
||||
int? warningLevel; |
||||
|
||||
public bool AllowUnsafeBlocks { |
||||
get { |
||||
return allowUnsafeBlocks; |
||||
} |
||||
set { |
||||
allowUnsafeBlocks = value; |
||||
} |
||||
} |
||||
|
||||
public string[] AdditionalLibPaths { |
||||
get { |
||||
return additionalLibPaths; |
||||
} |
||||
set { |
||||
additionalLibPaths = value; |
||||
} |
||||
} |
||||
|
||||
public string[] AddModules { |
||||
get { |
||||
return addModules; |
||||
} |
||||
set { |
||||
addModules = value; |
||||
} |
||||
} |
||||
|
||||
public int CodePage { |
||||
get { |
||||
return codePage; |
||||
} |
||||
set { |
||||
codePage = value; |
||||
} |
||||
} |
||||
|
||||
public string DebugType { |
||||
get { |
||||
return debugType; |
||||
} |
||||
set { |
||||
debugType = value; |
||||
} |
||||
} |
||||
|
||||
public string DefineConstants { |
||||
get { |
||||
return defineConstants; |
||||
} |
||||
set { |
||||
defineConstants = value; |
||||
} |
||||
} |
||||
|
||||
public string DisabledWarnings { |
||||
get { |
||||
return disabledWarnings; |
||||
} |
||||
set { |
||||
disabledWarnings = value; |
||||
} |
||||
} |
||||
|
||||
public bool EmitDebugInformation { |
||||
get { |
||||
return emitDebugInformation; |
||||
} |
||||
set { |
||||
emitDebugInformation = value; |
||||
} |
||||
} |
||||
|
||||
public ITaskItem[] LinkResources { |
||||
get { |
||||
return linkResources; |
||||
} |
||||
set { |
||||
linkResources = value; |
||||
} |
||||
} |
||||
|
||||
public string MainEntryPoint { |
||||
get { |
||||
return mainEntryPoint; |
||||
} |
||||
set { |
||||
mainEntryPoint = value; |
||||
} |
||||
} |
||||
|
||||
public bool NoLogo { |
||||
get { |
||||
return noLogo; |
||||
} |
||||
set { |
||||
noLogo = value; |
||||
} |
||||
} |
||||
|
||||
public bool NoStandardLib { |
||||
get { |
||||
return noStandardLib; |
||||
} |
||||
set { |
||||
noStandardLib = value; |
||||
} |
||||
} |
||||
|
||||
|
||||
public bool Optimize { |
||||
get { |
||||
return optimize; |
||||
} |
||||
set { |
||||
optimize = value; |
||||
} |
||||
} |
||||
public ITaskItem OutputAssembly { |
||||
get { |
||||
return outputAssembly; |
||||
} |
||||
set { |
||||
outputAssembly = value; |
||||
} |
||||
} |
||||
|
||||
public ITaskItem[] References { |
||||
get { |
||||
return references; |
||||
} |
||||
set { |
||||
references = value; |
||||
} |
||||
} |
||||
|
||||
public ITaskItem[] Resources { |
||||
get { |
||||
return resources; |
||||
} |
||||
set { |
||||
resources = value; |
||||
} |
||||
} |
||||
|
||||
public ITaskItem[] ResponseFiles { |
||||
get { |
||||
return responseFiles; |
||||
} |
||||
set { |
||||
responseFiles = value; |
||||
} |
||||
} |
||||
|
||||
public ITaskItem[] Sources { |
||||
get { |
||||
return sources; |
||||
} |
||||
set { |
||||
sources = value; |
||||
} |
||||
} |
||||
|
||||
public string TargetType { |
||||
get { |
||||
return targetType; |
||||
} |
||||
set { |
||||
targetType = value; |
||||
} |
||||
} |
||||
|
||||
public bool TreatWarningsAsErrors { |
||||
get { |
||||
return treatWarningsAsErrors; |
||||
} |
||||
set { |
||||
treatWarningsAsErrors = value; |
||||
} |
||||
} |
||||
|
||||
public int WarningLevel { |
||||
get { |
||||
if (warningLevel.HasValue) { |
||||
return warningLevel.Value; |
||||
} |
||||
return DefaultWarningLevel; |
||||
} |
||||
set { |
||||
warningLevel = value; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Determines whether the warning level property has been set.
|
||||
/// </summary>
|
||||
protected bool IsWarningLevelSet { |
||||
get { |
||||
return warningLevel.HasValue; |
||||
} |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Returns a compiler error from the standard output or standard
|
||||
/// error line.
|
||||
/// </summary>
|
||||
protected virtual CompilerError ParseLine(string line) |
||||
{ |
||||
return null; |
||||
} |
||||
|
||||
/// <summary>
|
||||
/// Each line of output, from either standard output or standard error
|
||||
/// is parsed and any compiler errors are logged. If the line cannot
|
||||
/// be parsed it is logged using the specified message importance.
|
||||
/// </summary>
|
||||
protected override void LogEventsFromTextOutput(string singleLine, MessageImportance messageImportance) |
||||
{ |
||||
CompilerError error = ParseLine(singleLine); |
||||
if (error != null) { |
||||
if (error.IsWarning) { |
||||
Log.LogWarning("warning", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText); |
||||
} else { |
||||
Log.LogError("error", error.ErrorNumber, null, error.FileName, error.Line, error.Column, error.Line, error.Column, error.ErrorText); |
||||
} |
||||
} else { |
||||
Log.LogMessage(messageImportance, singleLine); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,18 +0,0 @@
@@ -1,18 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks |
||||
{ |
||||
public enum TargetMonoFrameworkVersion |
||||
{ |
||||
Version11 = 0, |
||||
Version20 = 1, |
||||
VersionLatest = 1 |
||||
} |
||||
} |
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace ICSharpCode.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class GeneralMonoErrorParseTestFixture |
||||
{ |
||||
Match match; |
||||
|
||||
[TestFixtureSetUp] |
||||
public void FixtureSetUp() |
||||
{ |
||||
string error = "error CS1904: `CS0169' is not a valid warning number"; |
||||
|
||||
Regex regex = new Regex(MonoCSharpCompilerResultsParser.GeneralErrorPattern, RegexOptions.Compiled); |
||||
match = regex.Match(error); |
||||
} |
||||
|
||||
[Test] |
||||
public void Error() |
||||
{ |
||||
Assert.AreEqual("error", match.Result("${error}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorNumber() |
||||
{ |
||||
Assert.AreEqual("CS1904", match.Result("${number}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorText() |
||||
{ |
||||
Assert.AreEqual("`CS0169' is not a valid warning number", match.Result("${message}")); |
||||
} |
||||
} |
||||
} |
@ -1,28 +0,0 @@
@@ -1,28 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Helper class that allows us to test protected methods of the
|
||||
/// Mbas class.
|
||||
/// </summary>
|
||||
public class MockMbas : Mbas |
||||
{ |
||||
/// <summary>
|
||||
/// Generates the Mbas command line arguments via the protected
|
||||
/// GenerateCommandLineArguments method.
|
||||
/// </summary>
|
||||
public string GetCommandLine() |
||||
{ |
||||
return base.GenerateResponseFileCommands(); |
||||
} |
||||
} |
||||
} |
@ -1,34 +0,0 @@
@@ -1,34 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using System; |
||||
|
||||
namespace ICSharpCode.Build.Tasks.Tests |
||||
{ |
||||
/// <summary>
|
||||
/// Helper class that allows us to test protected methods of the
|
||||
/// MonoCSharpCompilerTask class.
|
||||
/// </summary>
|
||||
public class MockMonoCSharpCompilerTask : MonoCSharpCompilerTask |
||||
{ |
||||
/// <summary>
|
||||
/// Generates the MonoCSharpCompilerTask command line arguments via the
|
||||
/// protected GenerateCommandLineArguments method.
|
||||
/// </summary>
|
||||
public string GetCommandLine() |
||||
{ |
||||
return base.GenerateResponseFileCommands(); |
||||
} |
||||
|
||||
protected override string ToolName { |
||||
get { |
||||
return "MonoCSharp.exe"; |
||||
} |
||||
} |
||||
} |
||||
} |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace ICSharpCode.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class NormalMbasErrorParseTestFixture |
||||
{ |
||||
Match match; |
||||
|
||||
[TestFixtureSetUp] |
||||
public void FixtureSetUp() |
||||
{ |
||||
string error = "Form1.vb(38,3) error BC30201: Expression expected"; |
||||
|
||||
Regex regex = new Regex(MonoBasicCompilerResultsParser.NormalErrorPattern, RegexOptions.Compiled); |
||||
match = regex.Match(error); |
||||
} |
||||
|
||||
[Test] |
||||
public void Column() |
||||
{ |
||||
Assert.AreEqual("3", match.Result("${column}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Line() |
||||
{ |
||||
Assert.AreEqual("38", match.Result("${line}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void FileName() |
||||
{ |
||||
Assert.AreEqual("Form1.vb", match.Result("${file}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Warning() |
||||
{ |
||||
Assert.AreEqual("error", match.Result("${error}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorNumber() |
||||
{ |
||||
Assert.AreEqual("BC30201", match.Result("${number}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorText() |
||||
{ |
||||
Assert.AreEqual("Expression expected", match.Result("${message}")); |
||||
} |
||||
} |
||||
} |
@ -1,65 +0,0 @@
@@ -1,65 +0,0 @@
|
||||
// <file>
|
||||
// <copyright see="prj:///doc/copyright.txt"/>
|
||||
// <license see="prj:///doc/license.txt"/>
|
||||
// <owner name="Matthew Ward" email="mrward@users.sourceforge.net"/>
|
||||
// <version>$Revision$</version>
|
||||
// </file>
|
||||
|
||||
using ICSharpCode.Build.Tasks; |
||||
using NUnit.Framework; |
||||
using System; |
||||
using System.Text.RegularExpressions; |
||||
|
||||
namespace ICSharpCode.Build.Tasks.Tests |
||||
{ |
||||
[TestFixture] |
||||
public class NormalMonoErrorParseTestFixture |
||||
{ |
||||
Match match; |
||||
|
||||
[TestFixtureSetUp] |
||||
public void FixtureSetUp() |
||||
{ |
||||
string error = "MyClass.cs(19,7): warning CS0169: The private field `Foo.MyClass.foo' is never used"; |
||||
|
||||
Regex regex = new Regex(MonoCSharpCompilerResultsParser.NormalErrorPattern, RegexOptions.Compiled); |
||||
match = regex.Match(error); |
||||
} |
||||
|
||||
[Test] |
||||
public void Column() |
||||
{ |
||||
Assert.AreEqual("7", match.Result("${column}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Line() |
||||
{ |
||||
Assert.AreEqual("19", match.Result("${line}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void FileName() |
||||
{ |
||||
Assert.AreEqual("MyClass.cs", match.Result("${file}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void Warning() |
||||
{ |
||||
Assert.AreEqual("warning", match.Result("${error}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorNumber() |
||||
{ |
||||
Assert.AreEqual("CS0169", match.Result("${number}")); |
||||
} |
||||
|
||||
[Test] |
||||
public void ErrorText() |
||||
{ |
||||
Assert.AreEqual("The private field `Foo.MyClass.foo' is never used", match.Result("${message}")); |
||||
} |
||||
} |
||||
} |
Loading…
Reference in new issue