Skip to content

Commit

Permalink
Created the initial code for the MonoDevelop Add-In project. The init…
Browse files Browse the repository at this point in the history
…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
dragan committed May 31, 2010
1 parent 73bb3f1 commit 0150a06
Show file tree
Hide file tree
Showing 21 changed files with 247 additions and 0 deletions.
Binary file not shown.
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>
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 IdeIntegration/MonoDevelopIntegration/SpecFlowCustomTool.cs
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; }
}
}
}
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>
15 changes: 15 additions & 0 deletions TechTalk.SpecFlow.MonoDevelop.sln
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Generator
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Tools", "Tools\TechTalk.SpecFlow.Tools.csproj", "{87BE7FE6-C3DE-4409-ABF6-FA5B60AF3DE1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.TechTalk.SpecFlow", "IdeIntegration\MonoDevelopIntegration\MonoDevelop.TechTalk.SpecFlow.csproj", "{199D2315-F5BD-463C-B16A-BE31A845792B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -61,6 +63,18 @@ Global
{0D3D2616-F53C-46A2-ADEB-273D140C1267}.Release|Any CPU.Build.0 = Release|Any CPU
{0D3D2616-F53C-46A2-ADEB-273D140C1267}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{0D3D2616-F53C-46A2-ADEB-273D140C1267}.Release|x86.ActiveCfg = Release|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Debug|x86.ActiveCfg = Debug|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Debug|x86.Build.0 = Debug|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Release|Any CPU.Build.0 = Release|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Release|x86.ActiveCfg = Release|Any CPU
{199D2315-F5BD-463C-B16A-BE31A845792B}.Release|x86.Build.0 = Release|Any CPU
{3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3836A6FC-4ECC-413A-AC8F-83A0A773EC9E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -94,6 +108,7 @@ Global
{453D8014-B6CD-4E86-80A8-D59F59092334}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{453D8014-B6CD-4E86-80A8-D59F59092334}.Debug|Any CPU.Build.0 = Debug|Any CPU
{453D8014-B6CD-4E86-80A8-D59F59092334}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU

{453D8014-B6CD-4E86-80A8-D59F59092334}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{453D8014-B6CD-4E86-80A8-D59F59092334}.Debug|x86.ActiveCfg = Debug|Any CPU
{453D8014-B6CD-4E86-80A8-D59F59092334}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down
Binary file added lib/monodevelop/Mono.Cecil.Mdb.dll
Binary file not shown.
Binary file added lib/monodevelop/Mono.Cecil.Mdb.dll.mdb
Binary file not shown.
Binary file added lib/monodevelop/Mono.Cecil.dll
Binary file not shown.
Binary file added lib/monodevelop/Mono.Cecil.dll.mdb
Binary file not shown.
Binary file added lib/monodevelop/Mono.TextEditor.dll
Binary file not shown.
18 changes: 18 additions & 0 deletions lib/monodevelop/Mono.TextEditor.dll.config
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 added lib/monodevelop/Mono.TextEditor.dll.mdb
Binary file not shown.
Binary file added lib/monodevelop/MonoDevelop.Core.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions lib/monodevelop/MonoDevelop.Core.dll.config
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 added lib/monodevelop/MonoDevelop.Core.dll.mdb
Binary file not shown.
Binary file added lib/monodevelop/MonoDevelop.Ide.dll
Binary file not shown.
Binary file added lib/monodevelop/MonoDevelop.Ide.dll.mdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions lib/monodevelop/buildinfo
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

0 comments on commit 0150a06

Please sign in to comment.