diff --git a/.gitignore b/.gitignore index 6cb5191ba..278e533ba 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,8 @@ obj/ [Rr]elease*/ _ReSharper*/ [Tt]est[Rr]esult* +*.pidb +*.userprefs *.resharper *.cache *.gpState diff --git a/Documentation/SpecFlowMonoGuide.docx b/Documentation/SpecFlowMonoGuide.docx new file mode 100644 index 000000000..ca3d78f81 Binary files /dev/null and b/Documentation/SpecFlowMonoGuide.docx differ diff --git a/Generator/TechTalk.SpecFlow.Generator.csproj b/Generator/TechTalk.SpecFlow.Generator.csproj index 956466643..241998e5f 100644 --- a/Generator/TechTalk.SpecFlow.Generator.csproj +++ b/Generator/TechTalk.SpecFlow.Generator.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU diff --git a/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowEventDefinitionIcon.ico b/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowEventDefinitionIcon.ico new file mode 100644 index 000000000..7ab089ad0 Binary files /dev/null and b/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowEventDefinitionIcon.ico differ diff --git a/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowFeatureIcon.ico b/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowFeatureIcon.ico new file mode 100644 index 000000000..7ab089ad0 Binary files /dev/null and b/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowFeatureIcon.ico differ diff --git a/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowStepDefinitionIcon.ico b/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowStepDefinitionIcon.ico new file mode 100644 index 000000000..7ab089ad0 Binary files /dev/null and b/IdeIntegration/MonoDevelopIntegration/Gui/SpecFlowStepDefinitionIcon.ico differ diff --git a/IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.addin.xml b/IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.addin.xml new file mode 100644 index 000000000..8321e4a2e --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.addin.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.csproj b/IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.csproj new file mode 100644 index 000000000..64c333763 --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/MonoDevelop.TechTalk.SpecFlow.csproj @@ -0,0 +1,89 @@ + + + + Debug + AnyCPU + 9.0.21022 + 2.0 + {199D2315-F5BD-463C-B16A-BE31A845792B} + Library + MonoDevelop.TechTalk.SpecFlow + MonoDevelop.TechTalk.SpecFlow + v3.5 + + + true + full + false + bin\Debug + DEBUG + prompt + 4 + + + none + false + bin\Release + prompt + 4 + + + + + MonoDevelop.TechTalk.SpecFlow.addin.xml + + + SpecFlowFeature.xft.xml + + + SpecFlowFeatureIcon.ico + + + SpecFlowEventDefinitionIcon.ico + + + SpecFlowStepDefinitionIcon.ico + + + SpecFlowStepDefinition.xft.xml + + + SpecFlowEventDefinition.xft.xml + + + + + + + + + + False + ..\..\lib\monodevelop\MonoDevelop.Ide.dll + + + False + ..\..\lib\monodevelop\MonoDevelop.Core.dll + + + + + + + + + + VersionInfo.cs + + + + + {453D8014-B6CD-4E86-80A8-D59F59092334} + TechTalk.SpecFlow.Generator + + + {7CCEF6D6-FC17-422E-9BED-EDD752B6496F} + TechTalk.SpecFlow.Parser + + + diff --git a/IdeIntegration/MonoDevelopIntegration/MonoDevelopProjectReader.cs b/IdeIntegration/MonoDevelopIntegration/MonoDevelopProjectReader.cs new file mode 100644 index 000000000..e2ff4e548 --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/MonoDevelopProjectReader.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; + +using MonoDevelop.Projects; + +using TechTalk.SpecFlow.Generator.Configuration; + +namespace MonoDevelop.TechTalk.SpecFlow +{ + internal static class MonoDevelopProjectReader + { + public static SpecFlowProject CreateSpecFlowProjectFrom(Project project) + { + var specFlowProject = new SpecFlowProject(); + specFlowProject.ProjectFolder = project.BaseDirectory; + specFlowProject.ProjectName = project.Name; + + string defaultNamespace = "Namespace"; + if (project is DotNetProject) + { + defaultNamespace = ((DotNetProject)project).GetDefaultNamespace(project.Name); + } + + // No way to get AssemblyName right now, therefore we'll just use DefaultNamespace + specFlowProject.AssemblyName = defaultNamespace; + specFlowProject.DefaultNamespace = defaultNamespace; + + // TODO: Find out if we really need to add all the feature files everytime we generate + foreach (ProjectFile projectFile in project.Files.Where(IsFeatureOrAppConfigFile)) + { + string extension = Path.GetExtension(projectFile.Name); + + if (extension.Equals(".feature", StringComparison.InvariantCultureIgnoreCase)) + { + string fileName = projectFile.FilePath.ToRelative(project.BaseDirectory); + var featureFile = new SpecFlowFeatureFile(fileName); + var customToolNamespace = projectFile.CustomToolNamespace; + + if (!String.IsNullOrEmpty(customToolNamespace)) + featureFile.CustomNamespace = customToolNamespace; + + specFlowProject.FeatureFiles.Add(featureFile); + } + + if (extension.Equals(".config", StringComparison.InvariantCultureIgnoreCase)) + { + string configContent = File.ReadAllText(projectFile.FilePath); + GeneratorConfigurationReader.UpdateConfigFromFileContent(specFlowProject.GeneratorConfiguration, configContent); + } + } + + return specFlowProject; + } + + private static bool IsFeatureOrAppConfigFile(ProjectFile projectFile) + { + string extension = Path.GetExtension(projectFile.Name); + return extension.Equals(".feature", StringComparison.InvariantCultureIgnoreCase) + || projectFile.Name.Equals("app.config", StringComparison.InvariantCultureIgnoreCase); + } + } +} diff --git a/IdeIntegration/MonoDevelopIntegration/Properties/AssemblyInfo.cs b/IdeIntegration/MonoDevelopIntegration/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..a9f9a529a --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/Properties/AssemblyInfo.cs @@ -0,0 +1,24 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +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("MonoDevelop.TechTalk.SpecFlow")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("MonoDevelop.TechTalk.SpecFlow")] +[assembly: AssemblyCopyright("Copyright © TechTalk, SineSignal, LLC 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("0ACD56A4-7A81-11DF-93DF-699DDFD72085")] + diff --git a/IdeIntegration/MonoDevelopIntegration/SingleFeatureFileGenerator.cs b/IdeIntegration/MonoDevelopIntegration/SingleFeatureFileGenerator.cs new file mode 100644 index 000000000..d4fe99119 --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/SingleFeatureFileGenerator.cs @@ -0,0 +1,154 @@ +using System; +using System.CodeDom.Compiler; +using System.IO; +using System.Text; +using System.Threading; + +using Microsoft.CSharp; +using MonoDevelop.Core; +using MonoDevelop.Ide.CustomTools; +using MonoDevelop.Projects; + +using TechTalk.SpecFlow.Generator; +using TechTalk.SpecFlow.Generator.Configuration; +using TechTalk.SpecFlow.Parser; + +namespace MonoDevelop.TechTalk.SpecFlow +{ + public class SingleFeatureFileGenerator : ISingleFileCustomTool + { + public IAsyncOperation Generate(IProgressMonitor monitor, ProjectFile file, SingleFileCustomToolResult result) + { + return new ThreadAsyncOperation(() => { + + FilePath codeFilePath = file.FilePath.ChangeExtension(".feature.cs"); + + try + { + codeFilePath = GenerateFeatureCodeFileFor(file); + } + catch (Exception ex) + { + HandleException(ex, file, result); + } + + result.GeneratedFilePath = codeFilePath; + + }, result); + } + + private FilePath GenerateFeatureCodeFileFor(ProjectFile featureFile) + { + // TODO: We only support C# for now, later we'll add support to grab the provider based on the project + CodeDomProvider codeProvider = new CSharpCodeProvider(); + FilePath outputFile = featureFile.FilePath.ChangeExtension(".feature." + codeProvider.FileExtension); + SpecFlowProject specFlowProject = MonoDevelopProjectReader.CreateSpecFlowProjectFrom(featureFile.Project); + var specFlowGenerator = new SpecFlowGenerator(specFlowProject); + + using (var writer = new StringWriter(new StringBuilder())) + using (var reader = new StringReader(File.ReadAllText(featureFile.FilePath))) + { + SpecFlowFeatureFile specFlowFeatureFile = specFlowProject.GetOrCreateFeatureFile(featureFile.FilePath); + specFlowGenerator.GenerateTestFile(specFlowFeatureFile, codeProvider, reader, writer); + File.WriteAllText(outputFile, writer.ToString()); + } + + return outputFile; + } + + private void HandleException(Exception ex, ProjectFile file, SingleFileCustomToolResult result) + { + if (ex is SpecFlowParserException) + { + SpecFlowParserException sfpex = (SpecFlowParserException) ex; + + if (sfpex.ErrorDetails == null || sfpex.ErrorDetails.Count == 0) + { + result.UnhandledException = ex; + } + else + { + var compilerErrors = new CompilerErrorCollection(); + + foreach (var errorDetail in sfpex.ErrorDetails) + { + var compilerError = new CompilerError(file.Name, errorDetail.ForcedLine, errorDetail.ForcedColumn, "0", errorDetail.Message); + compilerErrors.Add(compilerError); + } + + result.Errors.AddRange(compilerErrors); + } + } + else + { + result.UnhandledException = ex; + } + } + } + + 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; } + } + } +} diff --git a/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowEventDefinition.xft.xml b/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowEventDefinition.xft.xml new file mode 100644 index 000000000..5869c3e7e --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowEventDefinition.xft.xml @@ -0,0 +1,101 @@ + + \ No newline at end of file diff --git a/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowFeature.xft.xml b/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowFeature.xft.xml new file mode 100644 index 000000000..ccd7506e0 --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowFeature.xft.xml @@ -0,0 +1,29 @@ + + \ No newline at end of file diff --git a/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowStepDefinition.xft.xml b/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowStepDefinition.xft.xml new file mode 100644 index 000000000..eb2598875 --- /dev/null +++ b/IdeIntegration/MonoDevelopIntegration/Templates/SpecFlowStepDefinition.xft.xml @@ -0,0 +1,61 @@ + + \ No newline at end of file diff --git a/VsIntegration/BaseCodeGenerator.cs b/IdeIntegration/Vs2008Integration/BaseCodeGenerator.cs similarity index 98% rename from VsIntegration/BaseCodeGenerator.cs rename to IdeIntegration/Vs2008Integration/BaseCodeGenerator.cs index 38f18549f..6c256b7b3 100644 --- a/VsIntegration/BaseCodeGenerator.cs +++ b/IdeIntegration/Vs2008Integration/BaseCodeGenerator.cs @@ -9,7 +9,7 @@ using Microsoft.VisualStudio.Shell; using Microsoft.VisualStudio.Shell.Interop; -namespace TechTalk.SpecFlow.VsIntegration +namespace TechTalk.SpecFlow.Vs2008Integration { [System.Runtime.InteropServices.ComVisible(true)] [Guid("8EC3552F-9C6A-472f-8E64-630C7CAE0179")] diff --git a/VsIntegration/BaseCodeGeneratorWithSite.cs b/IdeIntegration/Vs2008Integration/BaseCodeGeneratorWithSite.cs similarity index 99% rename from VsIntegration/BaseCodeGeneratorWithSite.cs rename to IdeIntegration/Vs2008Integration/BaseCodeGeneratorWithSite.cs index fb98e7d5a..2da3d9d84 100644 --- a/VsIntegration/BaseCodeGeneratorWithSite.cs +++ b/IdeIntegration/Vs2008Integration/BaseCodeGeneratorWithSite.cs @@ -13,7 +13,7 @@ using VSOLE = Microsoft.VisualStudio.OLE.Interop; using Microsoft.VisualStudio.Shell; -namespace TechTalk.SpecFlow.VsIntegration +namespace TechTalk.SpecFlow.Vs2008Integration { [System.Runtime.InteropServices.ComVisible(true)] [Guid("800FD294-E1AF-4a80-AFF2-FFBCE664D020")] diff --git a/VsIntegration/CodeGeneratorRegistrationAttribute.cs b/IdeIntegration/Vs2008Integration/CodeGeneratorRegistrationAttribute.cs similarity index 100% rename from VsIntegration/CodeGeneratorRegistrationAttribute.cs rename to IdeIntegration/Vs2008Integration/CodeGeneratorRegistrationAttribute.cs diff --git a/VsIntegration/GlobalSuppressions.cs b/IdeIntegration/Vs2008Integration/GlobalSuppressions.cs similarity index 100% rename from VsIntegration/GlobalSuppressions.cs rename to IdeIntegration/Vs2008Integration/GlobalSuppressions.cs diff --git a/VsIntegration/Guids.cs b/IdeIntegration/Vs2008Integration/Guids.cs similarity index 100% rename from VsIntegration/Guids.cs rename to IdeIntegration/Vs2008Integration/Guids.cs diff --git a/VsIntegration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition.vstemplate b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition.vstemplate similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition.vstemplate rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition.vstemplate diff --git a/VsIntegration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition1.cs b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition1.cs similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition1.cs rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinition1.cs diff --git a/VsIntegration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinitionIcon.ico b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinitionIcon.ico similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinitionIcon.ico rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition/SpecFlowEventDefinitionIcon.ico diff --git a/VsIntegration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition.vstemplate b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition.vstemplate similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition.vstemplate rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition.vstemplate diff --git a/VsIntegration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition1.vb b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition1.vb similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition1.vb rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinition1.vb diff --git a/VsIntegration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinitionIcon.ico b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinitionIcon.ico similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinitionIcon.ico rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowEventDefinition_VB/SpecFlowEventDefinitionIcon.ico diff --git a/VsIntegration/ItemTemplates/SpecFlowFeature/SpecFlowFeature.vstemplate b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature/SpecFlowFeature.vstemplate similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowFeature/SpecFlowFeature.vstemplate rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature/SpecFlowFeature.vstemplate diff --git a/VsIntegration/ItemTemplates/SpecFlowFeature/SpecFlowFeature1.feature b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature/SpecFlowFeature1.feature similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowFeature/SpecFlowFeature1.feature rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature/SpecFlowFeature1.feature diff --git a/VsIntegration/ItemTemplates/SpecFlowFeature/SpecFlowFeatureIcon.ico b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature/SpecFlowFeatureIcon.ico similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowFeature/SpecFlowFeatureIcon.ico rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature/SpecFlowFeatureIcon.ico diff --git a/VsIntegration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature1.feature b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature1.feature similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature1.feature rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature1.feature diff --git a/VsIntegration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeatureIcon.ico b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeatureIcon.ico similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeatureIcon.ico rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeatureIcon.ico diff --git a/VsIntegration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature_VB.vstemplate b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature_VB.vstemplate similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature_VB.vstemplate rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowFeature_VB/SpecFlowFeature_VB.vstemplate diff --git a/VsIntegration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition.vstemplate b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition.vstemplate similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition.vstemplate rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition.vstemplate diff --git a/VsIntegration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition1.cs b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition1.cs similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition1.cs rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinition1.cs diff --git a/VsIntegration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinitionIcon.ico b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinitionIcon.ico similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinitionIcon.ico rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition/SpecFlowStepDefinitionIcon.ico diff --git a/VsIntegration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition.vstemplate b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition.vstemplate similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition.vstemplate rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition.vstemplate diff --git a/VsIntegration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition1.vb b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition1.vb similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition1.vb rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinition1.vb diff --git a/VsIntegration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinitionIcon.ico b/IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinitionIcon.ico similarity index 100% rename from VsIntegration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinitionIcon.ico rename to IdeIntegration/Vs2008Integration/ItemTemplates/SpecFlowStepDefinition_VB/SpecFlowStepDefinitionIcon.ico diff --git a/VsIntegration/Properties/AssemblyInfo.cs b/IdeIntegration/Vs2008Integration/Properties/AssemblyInfo.cs similarity index 100% rename from VsIntegration/Properties/AssemblyInfo.cs rename to IdeIntegration/Vs2008Integration/Properties/AssemblyInfo.cs diff --git a/VsIntegration/Resources.Designer.cs b/IdeIntegration/Vs2008Integration/Resources.Designer.cs similarity index 92% rename from VsIntegration/Resources.Designer.cs rename to IdeIntegration/Vs2008Integration/Resources.Designer.cs index 716e6f0ae..033278d4d 100644 --- a/VsIntegration/Resources.Designer.cs +++ b/IdeIntegration/Vs2008Integration/Resources.Designer.cs @@ -1,14 +1,14 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4918 +// Runtime Version:4.0.30319.1 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ -namespace TechTalk.SpecFlow.VsIntegration { +namespace TechTalk.SpecFlow.Vs2008Integration { using System; @@ -19,7 +19,7 @@ namespace TechTalk.SpecFlow.VsIntegration { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -39,7 +39,7 @@ internal Resources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TechTalk.SpecFlow.VsIntegration.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TechTalk.SpecFlow.Vs2008Integration.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/VsIntegration/Resources.resx b/IdeIntegration/Vs2008Integration/Resources.resx similarity index 100% rename from VsIntegration/Resources.resx rename to IdeIntegration/Vs2008Integration/Resources.resx diff --git a/VsIntegration/Resources/Package.ico b/IdeIntegration/Vs2008Integration/Resources/Package.ico similarity index 100% rename from VsIntegration/Resources/Package.ico rename to IdeIntegration/Vs2008Integration/Resources/Package.ico diff --git a/VsIntegration/SingleFileGeneratorSupportRegistrationAttribute.cs b/IdeIntegration/Vs2008Integration/SingleFileGeneratorSupportRegistrationAttribute.cs similarity index 100% rename from VsIntegration/SingleFileGeneratorSupportRegistrationAttribute.cs rename to IdeIntegration/Vs2008Integration/SingleFileGeneratorSupportRegistrationAttribute.cs diff --git a/VsIntegration/SpecFlowSingleFileGenerator.cs b/IdeIntegration/Vs2008Integration/SpecFlowSingleFileGenerator.cs similarity index 99% rename from VsIntegration/SpecFlowSingleFileGenerator.cs rename to IdeIntegration/Vs2008Integration/SpecFlowSingleFileGenerator.cs index d7352f874..53ecd47b4 100644 --- a/VsIntegration/SpecFlowSingleFileGenerator.cs +++ b/IdeIntegration/Vs2008Integration/SpecFlowSingleFileGenerator.cs @@ -13,7 +13,7 @@ using TechTalk.SpecFlow.Parser; using VSLangProj80; -namespace TechTalk.SpecFlow.VsIntegration +namespace TechTalk.SpecFlow.Vs2008Integration { [System.Runtime.InteropServices.ComVisible(true)] [Guid("3C9CF10A-A9AB-4899-A0FB-4B3BE4A36C15")] diff --git a/VsIntegration/TechTalk.SpecFlow.VsIntegration.csproj b/IdeIntegration/Vs2008Integration/TechTalk.SpecFlow.Vs2008Integration.csproj similarity index 87% rename from VsIntegration/TechTalk.SpecFlow.VsIntegration.csproj rename to IdeIntegration/Vs2008Integration/TechTalk.SpecFlow.Vs2008Integration.csproj index 720058e56..0d2841424 100644 --- a/VsIntegration/TechTalk.SpecFlow.VsIntegration.csproj +++ b/IdeIntegration/Vs2008Integration/TechTalk.SpecFlow.Vs2008Integration.csproj @@ -1,4 +1,5 @@ - + + Debug AnyCPU @@ -6,14 +7,14 @@ 2.0 Library Properties - TechTalk.SpecFlow.VsIntegration - TechTalk.SpecFlow.VsIntegration + TechTalk.SpecFlow.Vs2008Integration + TechTalk.SpecFlow.Vs2008Integration False Key.snk v3.5 {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E} true - ..\specflow.snk + ..\..\specflow.snk true @@ -60,10 +61,10 @@ - + StringExtensions.cs - + VersionInfo.cs @@ -82,7 +83,6 @@ - @@ -111,11 +111,11 @@ - + {453D8014-B6CD-4E86-80A8-D59F59092334} TechTalk.SpecFlow.Generator - + {7CCEF6D6-FC17-422E-9BED-EDD752B6496F} TechTalk.SpecFlow.Parser @@ -134,16 +134,14 @@ --> true true + false + false + false + false + false - - - $(SettingUpDevenvDependsOn);SkipDevenvSetup - - - - - + \ No newline at end of file diff --git a/VsIntegration/VSPackage.resx b/IdeIntegration/Vs2008Integration/VSPackage.resx similarity index 100% rename from VsIntegration/VSPackage.resx rename to IdeIntegration/Vs2008Integration/VSPackage.resx diff --git a/IdeIntegration/Vs2010Integration/GherkinFileClassificationDefinition.cs b/IdeIntegration/Vs2010Integration/GherkinFileClassificationDefinition.cs new file mode 100644 index 000000000..9e9ac960d --- /dev/null +++ b/IdeIntegration/Vs2010Integration/GherkinFileClassificationDefinition.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.Composition; +using Microsoft.VisualStudio.Text.Classification; +using Microsoft.VisualStudio.Utilities; + +namespace GherkinFileClassifier +{ + internal static class GherkinFileClassificationDefinition + { + [Export] + [Name("gherkin")] + [BaseDefinition("text")] + internal static ContentTypeDefinition diffContentTypeDefinition = null; + + [Export] + [FileExtension(".feature")] + [ContentType("gherkin")] + internal static FileExtensionToContentTypeDefinition patchFileExtensionDefinition = null; + + [Export(typeof(ClassificationTypeDefinition))] + [Name("gherkin.tag")] + internal static ClassificationTypeDefinition GherkinTagClassifierType = null; + } +} diff --git a/IdeIntegration/Vs2010Integration/GherkinFileClassifier.cs b/IdeIntegration/Vs2010Integration/GherkinFileClassifier.cs new file mode 100644 index 000000000..a4e2f0488 --- /dev/null +++ b/IdeIntegration/Vs2010Integration/GherkinFileClassifier.cs @@ -0,0 +1,118 @@ +using System; +using System.Linq; +using System.Collections.Generic; +using System.ComponentModel.Composition; +using System.Windows.Media; +using Microsoft.VisualStudio.Text; +using Microsoft.VisualStudio.Text.Classification; +using Microsoft.VisualStudio.Text.Tagging; +using Microsoft.VisualStudio.Utilities; + +namespace GherkinFileClassifier +{ + + #region Provider definition + /// + /// This class causes a classifier to be added to the set of classifiers. Since + /// the content type is set to "text", this classifier applies to all text files + /// + [Export(typeof(IClassifierProvider))] + [ContentType("gherkin")] + internal class GherkinFileClassifierProvider : IClassifierProvider + { + /// + /// Import the classification registry to be used for getting a reference + /// to the custom classification type later. + /// + [Import] + internal IClassificationTypeRegistryService ClassificationRegistry = null; // Set via MEF + + [Import] + internal IBufferTagAggregatorFactoryService BufferTagAggregatorFactoryService { get; set; } + + public IClassifier GetClassifier(ITextBuffer buffer) + { + return buffer.Properties.GetOrCreateSingletonProperty(() => + new GherkinFileClassifier(buffer, ClassificationRegistry, BufferTagAggregatorFactoryService)); + } + } + #endregion //provider def + + #region Classifier + /// + /// Classifier that classifies all text as an instance of the OrinaryClassifierType + /// + class GherkinFileClassifier : IClassifier + { + private readonly IClassificationTypeRegistryService classificationTypeRegistryService; + + internal IBufferTagAggregatorFactoryService BufferTagAggregatorFactoryService { get; private set; } + + internal GherkinFileClassifier(ITextBuffer buffer, IClassificationTypeRegistryService classificationTypeRegistryService, IBufferTagAggregatorFactoryService bufferTagAggregatorFactoryService) + { + BufferTagAggregatorFactoryService = bufferTagAggregatorFactoryService; + this.classificationTypeRegistryService = classificationTypeRegistryService; + + buffer.Changed += new EventHandler(buffer_Changed); + } + + private IList lastClassification = null; + + void buffer_Changed(object sender, TextContentChangedEventArgs e) + { + var chStart = e.Changes.Min(ch => ch.NewPosition); + var chEnd = e.Changes.Max(ch => ch.NewPosition + ch.NewLength); + var chSpan = new Span(chStart, chEnd); + + SnapshotSpan allText = new SnapshotSpan(e.After, 0, e.After.Length); + var newClassification = SyntaxColorer.GetClassificationSpans(allText, classificationTypeRegistryService); + + bool fullRefresh = false; + + if (lastClassification != null) + { + var overlappingClassifications = lastClassification.Where(cs => cs.Span.OverlapsWith(chSpan)).Select(cs => cs.ClassificationType); + fullRefresh |= overlappingClassifications.Any(cl => cl.Classification.Equals("string", StringComparison.InvariantCultureIgnoreCase)); + } + if (!fullRefresh) + { + var overlappingClassifications = newClassification.Where(cs => cs.Span.OverlapsWith(chSpan)).Select(cs => cs.ClassificationType); + fullRefresh |= overlappingClassifications.Any(cl => cl.Classification.Equals("string", StringComparison.InvariantCultureIgnoreCase)); + } + + lastClassification = newClassification; + + if (fullRefresh) + { + if (ClassificationChanged != null) + ClassificationChanged(this, new ClassificationChangedEventArgs( + new SnapshotSpan(e.After, 0, e.After.Length))); + } + } + + /// + /// This method scans the given SnapshotSpan for potential matches for this classification. + /// In this instance, it classifies everything and returns each span as a new ClassificationSpan. + /// + /// The span currently being classified + /// A list of ClassificationSpans that represent spans identified to be of this classification + public IList GetClassificationSpans(SnapshotSpan span) + { + if (lastClassification == null) + { + SnapshotSpan allText = new SnapshotSpan(span.Snapshot, 0, span.Snapshot.Length); + lastClassification = SyntaxColorer.GetClassificationSpans(allText, classificationTypeRegistryService); + } + + return lastClassification; + } + +#pragma warning disable 67 + // This event gets raised if a non-text change would affect the classification in some way, + // for example typing /* would cause the clssification to change in C# without directly + // affecting the span. + public event EventHandler ClassificationChanged; +#pragma warning restore 67 + } + #endregion //Classifier +} diff --git a/IdeIntegration/Vs2010Integration/GherkinFileClassifierFormat.cs b/IdeIntegration/Vs2010Integration/GherkinFileClassifierFormat.cs new file mode 100644 index 000000000..4b8b214b8 --- /dev/null +++ b/IdeIntegration/Vs2010Integration/GherkinFileClassifierFormat.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.Composition; +using System.Windows.Media; +using Microsoft.VisualStudio.Text.Classification; +using Microsoft.VisualStudio.Utilities; + +namespace GherkinFileClassifier +{ + [Export(typeof(EditorFormatDefinition))] + [ClassificationType(ClassificationTypeNames = "gherkin.tag")] + [Name("gherkin.tag")] + [UserVisible(true)] //this should be visible to the end user + [Order(Before = Priority.Default)] //set the priority to be after the default classifiers + internal sealed class GherkinFileClassifierFormat : ClassificationFormatDefinition + { + public GherkinFileClassifierFormat() + { + this.DisplayName = "Gherkin Tag"; //human readable version of the name + this.ForegroundColor = Colors.Gray; + this.IsItalic = true; + } + } +} diff --git a/TechTalk.SpecFlow.Silverlight/Properties/AssemblyInfo.cs b/IdeIntegration/Vs2010Integration/Properties/AssemblyInfo.cs similarity index 68% rename from TechTalk.SpecFlow.Silverlight/Properties/AssemblyInfo.cs rename to IdeIntegration/Vs2010Integration/Properties/AssemblyInfo.cs index 9da5cad6a..6d694dc40 100644 --- a/TechTalk.SpecFlow.Silverlight/Properties/AssemblyInfo.cs +++ b/IdeIntegration/Vs2010Integration/Properties/AssemblyInfo.cs @@ -5,12 +5,12 @@ // 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("TechTalk.SpecFlow.Silverlight")] +[assembly: AssemblyTitle("GherkinFileClassifier")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("TechTalk.SpecFlow.Silverlight")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("GherkinFileClassifier")] +[assembly: AssemblyCopyright("")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -19,9 +19,6 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("04dec58a-9677-4f58-ae8b-4744bbffb9a9")] - // Version information for an assembly consists of the following four values: // // Major Version @@ -29,7 +26,8 @@ // Build Number // Revision // -// You can specify all the values or you can default the Revision and Build Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IdeIntegration/Vs2010Integration/SyntaxColoringListener.cs b/IdeIntegration/Vs2010Integration/SyntaxColoringListener.cs new file mode 100644 index 000000000..b9b05136f --- /dev/null +++ b/IdeIntegration/Vs2010Integration/SyntaxColoringListener.cs @@ -0,0 +1,198 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Serialization; +using System.Text; +using java.util; +using gherkin; +using Microsoft.VisualStudio.Text; +using Microsoft.VisualStudio.Text.Classification; + +namespace GherkinFileClassifier +{ + public class ListeningDoneException : Exception + { + } + + public class SyntaxColorer + { + public static IList GetClassificationSpans(SnapshotSpan snapshotSpan, IClassificationTypeRegistryService registry) + { +// string fileContent = snapshotSpan.Snapshot.GetText(0, snapshotSpan.End.Position); + string fileContent = snapshotSpan.Snapshot.GetText(); + var gherkinListener = new SyntaxColoringListener(snapshotSpan, registry); + + I18n languageService = new I18n("en"); + + try + { + Lexer lexer = languageService.lexer(gherkinListener); + lexer.scan(fileContent, null, 0); + return gherkinListener.Classifications; + } + catch //(Exception ex) + { +/* + var errorClassificationType = registry.GetClassificationType("error"); + int startIndex = 0; + if (gherkinListener.Classifications.Any()) + { + var last = gherkinListener.Classifications.Last(); + startIndex = last.Span.Start + last.Span.Length; + } + + gherkinListener.Classifications.Add(new ClassificationSpan( + new SnapshotSpan(snapshotSpan.Snapshot, startIndex, snapshotSpan.Snapshot.Length - startIndex), + errorClassificationType)); +*/ + + return gherkinListener.Classifications; + } + + } + } + + public class SyntaxColoringListener : Listener + { + public SnapshotSpan SnapshotSpan { get; set; } + public List Classifications { get; private set; } + private int startLine; + private int endLine; + + private readonly IClassificationType keywordClassificationType; + private readonly IClassificationType commentClassificationType; + private readonly IClassificationType tagClassificationType; + private readonly IClassificationType multilineTextClassificationType; + + public SyntaxColoringListener(SnapshotSpan snapshotSpan, IClassificationTypeRegistryService registry) + { + SnapshotSpan = snapshotSpan; + startLine = SnapshotSpan.Start.GetContainingLine().LineNumber; + endLine = SnapshotSpan.End.GetContainingLine().LineNumber; + + Classifications = new List(); + + keywordClassificationType = registry.GetClassificationType("keyword"); + commentClassificationType = registry.GetClassificationType("comment"); + tagClassificationType = registry.GetClassificationType("gherkin.tag"); + multilineTextClassificationType = registry.GetClassificationType("string"); + } + + private int? GetEditorLine(int line) + { + var editorLine = line - 1; +// if (editorLine > endLine) +// throw new ListeningDoneException(); +// if (editorLine < startLine) +// return null; + return editorLine; + } + + private void AddClassification(IClassificationType classificationType, int startIndex, int length) + { + Classifications.Add( + new ClassificationSpan( + new SnapshotSpan(SnapshotSpan.Snapshot, new Span(startIndex, length)), + classificationType)); + } + + private void ColorizeLine(int line, IClassificationType classificationType) + { + var editorLine = GetEditorLine(line); + if (editorLine == null) + return; + + var snapshotLine = SnapshotSpan.Snapshot.GetLineFromLineNumber(editorLine.Value); + AddClassification(classificationType, snapshotLine.Start, snapshotLine.LengthIncludingLineBreak); + } + + private void ColorizeLinePart(string lineTextPart, int line, IClassificationType classificationType) + { + var editorLine = GetEditorLine(line); + if (editorLine == null) + return; + + var snapshotLine = SnapshotSpan.Snapshot.GetLineFromLineNumber(editorLine.Value); + + int startIndex = snapshotLine.GetText().IndexOf(lineTextPart); + if (startIndex < 0) + return; + + AddClassification(classificationType, snapshotLine.Start + startIndex, lineTextPart.Length); + } + + public void location(string str, int line) + { + + } + + public void pyString(string text, int line) + { + int lineCount = text.Count(c => c.Equals('\n')) + 1 + 2; + for (int currentLine = line; currentLine < line + lineCount; currentLine++) + { + ColorizeLine(currentLine, multilineTextClassificationType); + } + } + + public void feature(string keyword, string str2, string str3, int line) + { + RegisterKeyword(keyword, line); + } + + public void background(string keyword, string str2, string str3, int line) + { + RegisterKeyword(keyword, line); + } + + public void scenario(string keyword, string str2, string str3, int line) + { + RegisterKeyword(keyword, line); + } + + public void scenarioOutline(string keyword, string str2, string str3, int line) + { + RegisterKeyword(keyword, line); + } + + public void examples(string keyword, string str2, string str3, int line) + { + RegisterKeyword(keyword, line); + } + + public void step(string keyword, string text, int line) + { + RegisterKeyword(keyword, line); + } + + private void RegisterKeyword(string keyword, int line) + { + ColorizeLinePart(keyword, line, keywordClassificationType); + } + + public void comment(string commentText, int line) + { + ColorizeLine(line, commentClassificationType); + } + + public void tag(string tagName, int line) + { + ColorizeLinePart(tagName, line, tagClassificationType); + } + + public void eof() + { + + } + + public void syntaxError(string str1, string str2, List l, int line) + { + + } + + public void row(List l, int line) + { + + } + } +} diff --git a/IdeIntegration/Vs2010Integration/TechTalk.SpecFlow.Vs2010Integration.csproj b/IdeIntegration/Vs2010Integration/TechTalk.SpecFlow.Vs2010Integration.csproj new file mode 100644 index 000000000..1e5c19e86 --- /dev/null +++ b/IdeIntegration/Vs2010Integration/TechTalk.SpecFlow.Vs2010Integration.csproj @@ -0,0 +1,112 @@ + + + + Debug + AnyCPU + 10.0.20305 + 2.0 + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {96294E6F-8875-4D12-8577-4EC83E60BD6C} + Library + Properties + GherkinFileClassifier + TechTalk.SpecFlow.VsIntegration.GherkinFile + v4.0 + 512 + false + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\lib\gherkin\Gherkin.dll + + + ..\..\lib\gherkin\IKVM.OpenJDK.Core.dll + + + ..\..\lib\gherkin\IKVM.OpenJDK.Security.dll + + + ..\..\lib\gherkin\IKVM.OpenJDK.Text.dll + + + ..\..\lib\gherkin\IKVM.Runtime.dll + + + False + + + False + + + False + + + False + + + False + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + gherkin.ico + PreserveNewest + true + + + + + {7CCEF6D6-FC17-422E-9BED-EDD752B6496F} + TechTalk.SpecFlow.Parser + + + + + + \ No newline at end of file diff --git a/IdeIntegration/Vs2010Integration/source.extension.vsixmanifest b/IdeIntegration/Vs2010Integration/source.extension.vsixmanifest new file mode 100644 index 000000000..5db8e1696 --- /dev/null +++ b/IdeIntegration/Vs2010Integration/source.extension.vsixmanifest @@ -0,0 +1,24 @@ + + + + SpecFlow Gherkin Editor + Gaspar Nagy + 1.0 + Syntax coloring for Ghrekin (.feature) files + 1033 + http://www.specflow.org + gherkin.ico + + + Ultimate + Premium + Pro + + + + + + + |%CurrentProject%| + + diff --git a/Installer/ImportGherkinParser/ImportGherkinParser.csproj b/Installer/ImportGherkinParser/ImportGherkinParser.csproj index 805f94a17..72586f436 100644 --- a/Installer/ImportGherkinParser/ImportGherkinParser.csproj +++ b/Installer/ImportGherkinParser/ImportGherkinParser.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU diff --git a/Installer/SpecFlowInstaller/Product.Generated.wxs b/Installer/SpecFlowInstaller/Product.Generated.wxs index 5079b3d9f..5a19c7173 100644 --- a/Installer/SpecFlowInstaller/Product.Generated.wxs +++ b/Installer/SpecFlowInstaller/Product.Generated.wxs @@ -10,7 +10,7 @@ - + \ No newline at end of file diff --git a/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj b/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj index 885f2eeff..ba3cb4873 100644 --- a/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj +++ b/Installer/SpecFlowInstaller/SpecFlowInstaller.wixproj @@ -1,4 +1,4 @@ - + Debug x86 @@ -7,8 +7,8 @@ 2.0 SpecFlowSetup Package - $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.5\Wix.targets - $(MSBuildExtensionsPath)\Microsoft\WiX\v3.5\Wix.targets + $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.5\Wix2010.targets + $(MSBuildExtensionsPath)\Microsoft\WiX\v3.5\Wix2010.targets bin\$(Configuration)\ @@ -72,8 +72,8 @@ Binaries INSTALLLOCATION - - TechTalk.SpecFlow.VsIntegration + + TechTalk.SpecFlow.Vs2008Integration {5703ca95-a08a-46ae-ae24-db6b21fd6f7e} True Binaries diff --git a/Installer/SpecFlowInstaller/VS2008.wxs b/Installer/SpecFlowInstaller/VS2008.wxs index 9d464fa99..954266259 100644 --- a/Installer/SpecFlowInstaller/VS2008.wxs +++ b/Installer/SpecFlowInstaller/VS2008.wxs @@ -18,14 +18,14 @@ - + - + @@ -46,9 +46,9 @@ - - - + + + diff --git a/Installer/SpecFlowInstaller/VS2010.wxs b/Installer/SpecFlowInstaller/VS2010.wxs index e1114caca..cdfaa65fc 100644 --- a/Installer/SpecFlowInstaller/VS2010.wxs +++ b/Installer/SpecFlowInstaller/VS2010.wxs @@ -18,14 +18,14 @@ - + - + @@ -46,9 +46,9 @@ - - - + + + diff --git a/Parser/TechTalk.SpecFlow.Parser.csproj b/Parser/TechTalk.SpecFlow.Parser.csproj index 05968a9b7..417e74fe8 100644 --- a/Parser/TechTalk.SpecFlow.Parser.csproj +++ b/Parser/TechTalk.SpecFlow.Parser.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -33,34 +33,38 @@ 4 - + + + 3.5 + + + 3.5 + + + 3.5 + + + + False ..\lib\gherkin\Gherkin.dll - + False ..\lib\gherkin\IKVM.OpenJDK.Core.dll - + False ..\lib\gherkin\IKVM.OpenJDK.Text.dll - + False ..\lib\gherkin\IKVM.Runtime.dll - - - 3.5 - - - 3.5 - - - 3.5 + + False + ..\lib\gherkin\IKVM.OpenJDK.Security.dll - - @@ -105,6 +109,7 @@ + - - - - - - - - \ No newline at end of file diff --git a/TechTalk.SpecFlow.sln b/TechTalk.SpecFlow.sln index 95965b3af..1ac53bdb4 100644 --- a/TechTalk.SpecFlow.sln +++ b/TechTalk.SpecFlow.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{DCE0C3C4-5BC6-4A30-86BE-3FEFF4677A01}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437}" @@ -13,6 +13,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution VersionInfo.cs = VersionInfo.cs EndProjectSection EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Resources", "Resources", "{EF9D1EFD-574B-4A33-96CB-8885A6CEB227}" + ProjectSection(SolutionItems) = preProject + Installer\Resources\EULA.rtf = Installer\Resources\EULA.rtf + Installer\Resources\header.bmp = Installer\Resources\header.bmp + Installer\Resources\logo.png = Installer\Resources\logo.png + Installer\Resources\welcome_dialog.bmp = Installer\Resources\welcome_dialog.bmp + EndProjectSection +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Reporting", "Reporting\TechTalk.SpecFlow.Reporting.csproj", "{FC43509F-E7D3-40C4-B4C3-1E6C9D5530A4}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow", "Runtime\TechTalk.SpecFlow.csproj", "{413EE28C-4F89-4C6F-BA1E-2CDEE4CD43B4}" @@ -23,8 +31,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ParserTests", "Tests\Parser EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RuntimeTests", "Tests\RuntimeTests\RuntimeTests.csproj", "{F8FACCF0-5497-4C6B-861F-78D72FD9561B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.VsIntegration", "VsIntegration\TechTalk.SpecFlow.VsIntegration.csproj", "{5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Generator", "Generator\TechTalk.SpecFlow.Generator.csproj", "{453D8014-B6CD-4E86-80A8-D59F59092334}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Tools", "Tools\TechTalk.SpecFlow.Tools.csproj", "{87BE7FE6-C3DE-4409-ABF6-FA5B60AF3DE1}" @@ -37,20 +43,20 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ExternalStepsCS", "Tests\Fe EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SpecFlowInstaller", "Installer\SpecFlowInstaller\SpecFlowInstaller.wixproj", "{89167EB9-F458-48DA-9D8F-F639A74F5871}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Resources", "Resources", "{EF9D1EFD-574B-4A33-96CB-8885A6CEB227}" - ProjectSection(SolutionItems) = preProject - Installer\Resources\EULA.rtf = Installer\Resources\EULA.rtf - Installer\Resources\header.bmp = Installer\Resources\header.bmp - Installer\Resources\logo.png = Installer\Resources\logo.png - Installer\Resources\welcome_dialog.bmp = Installer\Resources\welcome_dialog.bmp - EndProjectSection -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Silverlight", "Runtime.Silverlight\TechTalk.SpecFlow.Silverlight.csproj", "{B93F95CF-BF89-4D92-BB0F-86885B9B6DCE}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportingTests", "Tests\ReportingTests\ReportingTests.csproj", "{1965463E-6972-4618-8E59-D3259AE7A125}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReportingTest.SampleProject", "Tests\ReportingTest.SampleProject\ReportingTest.SampleProject.csproj", "{E5C299D5-E7CC-4477-9A0B-4797B74BC88B}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdeIntegration", "IdeIntegration", "{55E45533-9AAA-41AB-B44F-7530799C9337}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Vs2008Integration", "IdeIntegration\Vs2008Integration\TechTalk.SpecFlow.Vs2008Integration.csproj", "{5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonoDevelop.TechTalk.SpecFlow", "IdeIntegration\MonoDevelopIntegration\MonoDevelop.TechTalk.SpecFlow.csproj", "{199D2315-F5BD-463C-B16A-BE31A845792B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TechTalk.SpecFlow.Vs2010Integration", "IdeIntegration\Vs2010Integration\TechTalk.SpecFlow.Vs2010Integration.csproj", "{96294E6F-8875-4D12-8577-4EC83E60BD6C}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -111,16 +117,6 @@ Global {F8FACCF0-5497-4C6B-861F-78D72FD9561B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {F8FACCF0-5497-4C6B-861F-78D72FD9561B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {F8FACCF0-5497-4C6B-861F-78D72FD9561B}.Release|x86.ActiveCfg = Release|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|x86.ActiveCfg = Debug|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Any CPU.Build.0 = Release|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|x86.ActiveCfg = Release|Any CPU {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 @@ -144,6 +140,7 @@ Global {0D3D2616-F53C-46A2-ADEB-273D140C1267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0D3D2616-F53C-46A2-ADEB-273D140C1267}.Debug|Any CPU.Build.0 = Debug|Any CPU {0D3D2616-F53C-46A2-ADEB-273D140C1267}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0D3D2616-F53C-46A2-ADEB-273D140C1267}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {0D3D2616-F53C-46A2-ADEB-273D140C1267}.Debug|x86.ActiveCfg = Debug|Any CPU {0D3D2616-F53C-46A2-ADEB-273D140C1267}.Release|Any CPU.ActiveCfg = Release|Any CPU {0D3D2616-F53C-46A2-ADEB-273D140C1267}.Release|Any CPU.Build.0 = Release|Any CPU @@ -209,19 +206,52 @@ Global {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|Mixed Platforms.Build.0 = Release|Any CPU {E5C299D5-E7CC-4477-9A0B-4797B74BC88B}.Release|x86.ActiveCfg = Release|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Debug|x86.ActiveCfg = Debug|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Any CPU.Build.0 = Release|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E}.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}.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 + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Debug|x86.ActiveCfg = Debug|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Release|Any CPU.Build.0 = Release|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {96294E6F-8875-4D12-8577-4EC83E60BD6C}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution + {EF9D1EFD-574B-4A33-96CB-8885A6CEB227} = {DCE0C3C4-5BC6-4A30-86BE-3FEFF4677A01} {0D3D2616-F53C-46A2-ADEB-273D140C1267} = {DCE0C3C4-5BC6-4A30-86BE-3FEFF4677A01} {89167EB9-F458-48DA-9D8F-F639A74F5871} = {DCE0C3C4-5BC6-4A30-86BE-3FEFF4677A01} - {EF9D1EFD-574B-4A33-96CB-8885A6CEB227} = {DCE0C3C4-5BC6-4A30-86BE-3FEFF4677A01} {70376361-0BE1-478D-8EEC-47BD1C768165} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {F8FACCF0-5497-4C6B-861F-78D72FD9561B} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {3FE793A8-E662-4026-B4EC-891324073235} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {1965463E-6972-4618-8E59-D3259AE7A125} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} {E5C299D5-E7CC-4477-9A0B-4797B74BC88B} = {A10B5CD6-38EC-4D7E-9D1C-2EBA8017E437} + {5703CA95-A08A-46AE-AE24-DB6B21FD6F7E} = {55E45533-9AAA-41AB-B44F-7530799C9337} + {199D2315-F5BD-463C-B16A-BE31A845792B} = {55E45533-9AAA-41AB-B44F-7530799C9337} + {96294E6F-8875-4D12-8577-4EC83E60BD6C} = {55E45533-9AAA-41AB-B44F-7530799C9337} EndGlobalSection EndGlobal diff --git a/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/ExternalStepsCS.csproj b/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/ExternalStepsCS.csproj index cdde99650..4191ff25d 100644 --- a/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/ExternalStepsCS.csproj +++ b/Tests/FeatureTests/ExternalSteps/ExternalStepsCS/ExternalStepsCS.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU diff --git a/Tests/FeatureTests/FeatureTests.csproj b/Tests/FeatureTests/FeatureTests.csproj index 3a7a9fa79..c6c06587f 100644 --- a/Tests/FeatureTests/FeatureTests.csproj +++ b/Tests/FeatureTests/FeatureTests.csproj @@ -15,21 +15,6 @@ true - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true true @@ -51,10 +36,6 @@ ..\..\lib\nunit\nunit.framework.dll - True - - - ..\..\lib\mocking\Rhino.Mocks.dll @@ -64,6 +45,9 @@ + + ..\..\lib\mocking\Rhino.Mocks.dll + @@ -111,7 +95,6 @@ {413EE28C-4F89-4C6F-BA1E-2CDEE4CD43B4} TechTalk.SpecFlow - True {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E} @@ -119,7 +102,9 @@ - + + Always + SpecFlowSingleFileGenerator BeforeAfterHooks.feature.cs @@ -141,25 +126,8 @@ StepArgumentTransformation.feature.cs - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - +