-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Created the initial code for the MonoDevelop Add-In project. The init…
…ial code consists of a skeleton for the SpecFlow Feature file template and the skeleton for the custom tool that will generate the code from the feature file.
- Loading branch information
Showing
21 changed files
with
247 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
29 changes: 29 additions & 0 deletions
29
IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.addin.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<Addin namespace = "MonoDevelop" | ||
id = "TechTalk.SpecFlow" | ||
name = "SpecFlow Support" | ||
author = "TechTalk, SineSignal" | ||
copyright = "BSD" | ||
url = "http://www.specflow.org" | ||
description = "Integrates SpecFlow into the MonoDevelop IDE." | ||
category = "IDE Extensions" | ||
version = "2.4"> | ||
|
||
<Runtime> | ||
<Import assembly="TechTalk.SpecFlow.Generator.dll" /> | ||
<Import assembly="TechTalk.SpecFlow.Parser.dll" /> | ||
</Runtime> | ||
|
||
<Dependencies> | ||
<Addin id="Core" version="2.4"/> | ||
<Addin id="Ide" version="2.4"/> | ||
</Dependencies> | ||
|
||
<Extension path="/MonoDevelop/Ide/FileTemplates"> | ||
<FileTemplate id = "SpecFlowFeatureTemplate" | ||
file = "Templates/SpecFlowFeature.xft.xml"/> | ||
</Extension> | ||
|
||
<Extension path="/MonoDevelop/Ide/CustomTools"> | ||
<Tool name="SpecFlowSingleFileGenerator" type="MonoDevelop.TechTalk.SpecFlow.SpecFlowCustomTool"/> | ||
</Extension> | ||
</Addin> |
63 changes: 63 additions & 0 deletions
63
IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="3.5" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>9.0.21022</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{199D2315-F5BD-463C-B16A-BE31A845792B}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>MonoDevelop.TechTalk.SpecFlow</RootNamespace> | ||
<AssemblyName>MonoDevelop.TechTalk.SpecFlow</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug</OutputPath> | ||
<DefineConstants>DEBUG</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>none</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Release</OutputPath> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<ItemGroup> | ||
<EmbeddedResource Include="MonoDevelop.TechTalk.SpecFlow.addin.xml" /> | ||
<EmbeddedResource Include="Templates\SpecFlowFeature.xft.xml" /> | ||
<EmbeddedResource Include="Gui\SpecFlowFeatureIcon.ico"> | ||
<LogicalName>SpecFlowFeatureIcon.ico</LogicalName> | ||
</EmbeddedResource> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Folder Include="Templates\" /> | ||
<Folder Include="Gui\" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="MonoDevelop.Ide, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\lib\monodevelop\MonoDevelop.Ide.dll</HintPath> | ||
</Reference> | ||
<Reference Include="MonoDevelop.Core, Version=2.4.0.0, Culture=neutral, PublicKeyToken=null"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\lib\monodevelop\MonoDevelop.Core.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="SpecFlowCustomTool.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Generator\TechTalk.SpecFlow.Generator.csproj"> | ||
<Project>{453D8014-B6CD-4E86-80A8-D59F59092334}</Project> | ||
<Name>TechTalk.SpecFlow.Generator</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
</Project> |
85 changes: 85 additions & 0 deletions
85
IdeIntegration/MonoDevelopIntegration/SpecFlowCustomTool.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
using System; | ||
using System.Threading; | ||
|
||
using MonoDevelop.Core; | ||
using MonoDevelop.Ide.CustomTools; | ||
using MonoDevelop.Projects; | ||
|
||
namespace MonoDevelop.TechTalk.SpecFlow | ||
{ | ||
public class SpecFlowCustomTool : ISingleFileCustomTool | ||
{ | ||
public IAsyncOperation Generate(IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result) | ||
{ | ||
return new ThreadAsyncOperation(() => { | ||
// Generate the code for the passed in feature project file | ||
}, result); | ||
} | ||
} | ||
|
||
internal class ThreadAsyncOperation : IAsyncOperation | ||
{ | ||
private Thread Thread { get; set; } | ||
private bool Cancelled { get; set; } | ||
private SingleFileCustomToolResult Result { get; set; } | ||
private Action Task { get; set; } | ||
|
||
public ThreadAsyncOperation(Action task, SingleFileCustomToolResult result) | ||
{ | ||
if (result == null) | ||
throw new ArgumentNullException("result"); | ||
|
||
Task = task; | ||
Result = result; | ||
Thread = new Thread(Run); | ||
Thread.Start(); | ||
} | ||
|
||
private void Run() | ||
{ | ||
try | ||
{ | ||
Task(); | ||
} | ||
catch (ThreadAbortException ex) | ||
{ | ||
Result.UnhandledException = ex; | ||
Thread.ResetAbort(); | ||
} | ||
catch (Exception ex) | ||
{ | ||
Result.UnhandledException = ex; | ||
} | ||
|
||
if (Completed != null) | ||
Completed(this); | ||
} | ||
|
||
public event OperationHandler Completed; | ||
|
||
public void Cancel() | ||
{ | ||
Thread.Abort(); | ||
} | ||
|
||
public void WaitForCompleted() | ||
{ | ||
Thread.Join(); | ||
} | ||
|
||
public bool IsCompleted | ||
{ | ||
get { return !Thread.IsAlive; } | ||
} | ||
|
||
public bool Success | ||
{ | ||
get { return !Cancelled && Result.Success; } | ||
} | ||
|
||
public bool SuccessWithWarnings | ||
{ | ||
get { return !Cancelled && Result.SuccessWithWarnings; } | ||
} | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowFeature.xft.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0"?> | ||
<Template originator="SineSignal, LLC" | ||
created="2010/05/30" | ||
lastModified="2010/05/30"> | ||
<!-- Template Header --> | ||
<TemplateConfiguration> | ||
<_Name>SpecFlow Feature</_Name> | ||
<Icon>res:SpecFlowFeatureIcon.ico</Icon> | ||
<_Category>NUnit</_Category> | ||
<_Description>Creates a SpecFlow Feature template.</_Description> | ||
</TemplateConfiguration> | ||
|
||
<!-- Template Content --> | ||
<TemplateFiles> | ||
<File name="${Name}.feature" CustomTool="SpecFlowSingleFileGenerator"> | ||
<![CDATA[ | ||
Feature: Addition | ||
In order to avoid silly mistakes | ||
As a math idiot | ||
I want to be told the sum of two numbers | ||
@mytag | ||
Scenario: Add two numbers | ||
Given I have entered 50 into the calculator | ||
And I have entered 70 into the calculator | ||
When I press add | ||
Then the result should be 120 on the screen | ||
]]> | ||
</File> | ||
</TemplateFiles> | ||
</Template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<dllmap os="!windows,osx" dll="libglib-2.0-0.dll" target="libglib-2.0.so.0"/> | ||
<dllmap os="!windows,osx" dll="libgobject-2.0-0.dll" target="libgobject-2.0.so.0"/> | ||
<dllmap os="!windows,osx" dll="libatk-1.0-0.dll" target="libatk-1.0.so.0"/> | ||
<dllmap os="!windows,osx" dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0.so.0"/> | ||
<dllmap os="!windows,osx" dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0.so.0"/> | ||
<dllmap os="!windows,osx" dll="libpango-1.0-0.dll" target="libpango-1.0.so.0"/> | ||
<dllmap os="!windows,osx" dll="libpangocairo-1.0-0.dll" target="libpangocairo-1.0.so.0"/> | ||
|
||
<dllmap os="osx" dll="libglib-2.0-0.dll" target="libglib-2.0.0.dylib"/> | ||
<dllmap os="osx" dll="libgobject-2.0-0.dll" target="libgobject-2.0.0.dylib"/> | ||
<dllmap os="osx" dll="libatk-1.0-0.dll" target="libatk-1.0.0.dylib"/> | ||
<dllmap os="osx" dll="libgtk-win32-2.0-0.dll" target="libgtk-quartz-2.0.0.dylib"/> | ||
<dllmap os="osx" dll="libgdk-win32-2.0-0.dll" target="libgdk-quartz-2.0.0.dylib"/> | ||
<dllmap os="osx" dll="libpango-1.0-0.dll" target="libpango-1.0.0.dylib"/> | ||
<dllmap os="osx" dll="libpangocairo-1.0-0.dll" target="libpangocairo-1.0.0.dylib"/> | ||
</configuration> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<configuration> | ||
<dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.so.0" os="!osx,windows" /> | ||
<dllmap dll="libglib-2.0-0.dll" target="libglib-2.0.dylib" os="osx" /> | ||
</configuration> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
SVN revision: 158131 | ||
Build date: 2010-05-29 03:14:18+0000 |