Skip to content

Commit

Permalink
add generator only plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Willich committed Apr 15, 2019
1 parent f0a8f7a commit a7c0147
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Plugins/GeneratorOnlyPlugin/Directory.Build.targets
@@ -0,0 +1,7 @@
<Project>
<Target Name="SetNuspecProperties" BeforeTargets="GenerateNuspec" >
<PropertyGroup>
<NuspecProperties>$(NuspecProperties);config=$(Configuration)</NuspecProperties>
</PropertyGroup>
</Target>
</Project>
30 changes: 30 additions & 0 deletions Plugins/GeneratorOnlyPlugin/GeneratorOnlyPlugin.sln
@@ -0,0 +1,30 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28803.156
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleGeneratorPlugin", "GeneratorPlugin\SampleGeneratorPlugin.csproj", "{D14B26AD-ADF4-48AB-8B9F-4146BF3C3E4F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F6B4EBE9-9995-403D-BC3F-AD26CD6E960F}"
ProjectSection(SolutionItems) = preProject
Directory.Build.targets = Directory.Build.targets
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D14B26AD-ADF4-48AB-8B9F-4146BF3C3E4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D14B26AD-ADF4-48AB-8B9F-4146BF3C3E4F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D14B26AD-ADF4-48AB-8B9F-4146BF3C3E4F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D14B26AD-ADF4-48AB-8B9F-4146BF3C3E4F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CF1B75FE-E67E-486F-9B92-BDBAD9A8B86A}
EndGlobalSection
EndGlobal
@@ -0,0 +1,18 @@
using GeneratorPlugin;
using TechTalk.SpecFlow.Generator.Plugins;
using TechTalk.SpecFlow.Infrastructure;
using TechTalk.SpecFlow.UnitTestProvider;

[assembly:GeneratorPlugin(typeof(SampleGeneratorPlugin))]

namespace GeneratorPlugin
{
public class SampleGeneratorPlugin : IGeneratorPlugin
{
public void Initialize(GeneratorPluginEvents generatorPluginEvents, GeneratorPluginParameters generatorPluginParameters,
UnitTestProviderConfiguration unitTestProviderConfiguration)
{

}
}
}
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net471;netstandard2.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildThisFileDirectory)SamplePlugin.nuspec</NuspecFile>
<AssemblyName>SampleGeneratorPlugin.SpecFlowPlugin</AssemblyName>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SpecFlow.CustomPlugin" Version="3.0.199" />
</ItemGroup>


</Project>
29 changes: 29 additions & 0 deletions Plugins/GeneratorOnlyPlugin/GeneratorPlugin/SamplePlugin.nuspec
@@ -0,0 +1,29 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>SpecFlow.SamplePlugin</id>
<version>1.0.0</version>
<title>SpecFlow.SamplePlugin</title>
<authors>TechTalk</authors>
<owners>TechTalk</owners>
<description>This is a sample Plugin for SpecFlow 3</description>
<summary></summary>
<language>en-US</language>


<requireLicenseAcceptance>false</requireLicenseAcceptance>
<tags>specflow</tags>
<dependencies>
<dependency id="SpecFlow" version="3.0"/>
</dependencies>
</metadata>
<files>
<file src="build\**\*" target="build"/>


<file src="bin\$config$\net471\SampleGeneratorPlugin.SpecFlowPlugin.*" target="build\net471"/>
<file src="bin\$config$\netstandard2.0\SampleGeneratorPlugin.SpecFlowPlugin.dll" target="build\netstandard2.0"/>
<file src="bin\$config$\netstandard2.0\SampleGeneratorPlugin.SpecFlowPlugin.pdb" target="build\netstandard2.0"/>


</files>
</package>
@@ -0,0 +1,7 @@
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="TaskFolder;TaskAssembly">

<ItemGroup>
<SpecFlowGeneratorPlugins Include="$(_SampleGeneratorPluginPath)" />
</ItemGroup>

</Project>
@@ -0,0 +1,9 @@
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_SampleGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0</_SampleGeneratorPluginFramework>
<_SampleGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">net471</_SampleGeneratorPluginFramework>

<_SampleGeneratorPluginPath>$(MSBuildThisFileDirectory)\$(_SampleGeneratorPluginFramework)\SampleGeneratorPlugin.SpecFlowPlugin.dll</_SampleGeneratorPluginPath>

</PropertyGroup>
</Project>

0 comments on commit a7c0147

Please sign in to comment.