diff --git a/Cake.VisualStudio.sln b/Cake.VisualStudio.sln
index 854c495..0968a9e 100644
--- a/Cake.VisualStudio.sln
+++ b/Cake.VisualStudio.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.26127.3
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31515.178
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{04D0CE67-A915-44BB-BC3C-8E7885CF9E97}"
ProjectSection(SolutionItems) = preProject
@@ -11,11 +11,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Templates", "Templates", "{7067556F-B744-4F73-B509-C8CC9F559AB9}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.VisualStudio", "src\Cake.VisualStudio.csproj", "{94660BCF-169A-42E1-BD84-345449743069}"
- ProjectSection(ProjectDependencies) = postProject
- {FCE573DD-E74E-4AB1-9D17-56FC8869797F} = {FCE573DD-E74E-4AB1-9D17-56FC8869797F}
- EndProjectSection
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddinTemplate", "template\AddinTemplate\AddinTemplate.csproj", "{FCE573DD-E74E-4AB1-9D17-56FC8869797F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ModuleTemplate", "template\ModuleTemplate\ModuleTemplate.csproj", "{85BCBED7-39BD-4670-85F7-EE36D0DA31C0}"
@@ -28,16 +23,23 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AddinTestBasicTemplate", "t
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SolutionItemTemplate", "template\SolutionItemTemplate\SolutionItemTemplate.csproj", "{5D45E667-D12D-44F8-8A87-5503BF5DE274}"
EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Cake.VisualStudio.Shared", "src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.shproj", "{3D9AB2DB-3DD8-4E2B-8DBC-BF29EDAF1A1B}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.VisualStudio", "src\Cake.VisualStudio\Cake.VisualStudio.csproj", "{94660BCF-169A-42E1-BD84-345449743069}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cake.VisualStudio.2022", "src\Cake.VisualStudio.2022\Cake.VisualStudio.2022.csproj", "{F8EB885A-FCA3-410A-B895-9CE327D5D482}"
+EndProject
Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.projitems*{3d9ab2db-3dd8-4e2b-8dbc-bf29edaf1a1b}*SharedItemsImports = 13
+ src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.projitems*{94660bcf-169a-42e1-bd84-345449743069}*SharedItemsImports = 4
+ src\Cake.VisualStudio.Shared\Cake.VisualStudio.Shared.projitems*{f8eb885a-fca3-410a-b895-9ce327d5d482}*SharedItemsImports = 4
+ EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.Build.0 = Release|Any CPU
{FCE573DD-E74E-4AB1-9D17-56FC8869797F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCE573DD-E74E-4AB1-9D17-56FC8869797F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCE573DD-E74E-4AB1-9D17-56FC8869797F}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -62,6 +64,14 @@ Global
{5D45E667-D12D-44F8-8A87-5503BF5DE274}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5D45E667-D12D-44F8-8A87-5503BF5DE274}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5D45E667-D12D-44F8-8A87-5503BF5DE274}.Release|Any CPU.Build.0 = Release|Any CPU
+ {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {94660BCF-169A-42E1-BD84-345449743069}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {94660BCF-169A-42E1-BD84-345449743069}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F8EB885A-FCA3-410A-B895-9CE327D5D482}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/README.md b/README.md
index fefc503..10dfc98 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# Cake for Visual Studio
Adds support for the [Cake](https://cakebuild.net/)
-build tool in Visual Studio 2017 and 2019. Includes support for the Task Runner Explorer,
+build tool in Visual Studio 2017, 2019, and 2022. Includes support for the Task Runner Explorer,
new item and project templates and bootstrapping important Cake files
Originally based off Mads Kristensen's [Brunch Task Runner](https://github.com/madskristensen/BrunchTaskRunner) extension.
@@ -28,22 +28,22 @@ a `build.cake` file.
Open Task Runner Explorer by right-clicking the Cake script and select **Task Runner Explorer** from
the context menu:
-![Open Task Runner Explorer](art/open-trx.png)
+![Open Task Runner Explorer](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/open-trx.png)
Individual tasks will be listed in the task list on the left.
-![Task List](art/task-list.png)
+![Task List](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/task-list.png)
Each task can be executed by double-clicking the task.
-![Console output](art/console.png)
+![Console output](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/console.png)
### Bindings
Task bindings make it possible to associate individual tasks
with Visual Studio events such as _Project Open_ etc.
-![Bindings](art/bindings.png)
+![Bindings](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/bindings.png)
These bindings are stored in your `cake.config` file.
@@ -57,13 +57,13 @@ However, at this time, it will not automatically download Cake for you.
Choose Cake Build from the Build menu to quickly install the default bootstrapper scripts or Cake configuration files into your solution.
-![Template installers](art/installers.png)
+![Template installers](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/installers.png)
## Templates
The extension includes an item template for build scripts and project templates for Cake modules, addins, and unit tests.
-![Project Template](art/templates.png)
+![Project Template](https://cdn.jsdelivr.net/gh/cake-build/cake-vs@340ef57f9bfadc30641c0a2572e46fd35375ee89/art/templates.png)
## Contribute
diff --git a/build.cake b/build.cake
index 4134ce9..7362c56 100644
--- a/build.cake
+++ b/build.cake
@@ -108,7 +108,12 @@ Task("Update-Manifest-Version")
{
BuildVersion.UpdateManifestVersion(
context: Context,
- path: "./src/source.extension.vsixmanifest"
+ path: "./src/Cake.VisualStudio/source.extension.vsixmanifest"
+ );
+
+ BuildVersion.UpdateManifestVersion(
+ context: Context,
+ path: "./src/Cake.VisualStudio.2022/source.extension.vsixmanifest"
);
});
@@ -171,7 +176,8 @@ Task("Post-Build")
.IsDependentOn("Build")
.Does(() =>
{
- CopyFileToDirectory("./src/bin/" + configuration + "/Cake.VisualStudio.vsix", artifacts);
+ CopyFile("./src/Cake.VisualStudio/bin/" + configuration + "/Cake.VisualStudio.vsix", artifacts + "/Cake.VisualStudio.2019.vsix");
+ CopyFile("./src/Cake.VisualStudio.2022/bin/" + configuration + "/Cake.VisualStudio.vsix", artifacts + "/Cake.VisualStudio.2022.vsix");
});
Task("Publish-GitHub-Release")
@@ -179,9 +185,11 @@ Task("Publish-GitHub-Release")
.Does(() =>
{
var buildResultDir = Directory(artifacts);
- var packageFile = File("Cake.VisualStudio.vsix");
+ var packageFile2019 = File("Cake.VisualStudio.2019.vsix");
+ var packageFile2022 = File("Cake.VisualStudio.2022.vsix");
- GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone, buildResultDir + packageFile);
+ GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone, buildResultDir + packageFile2019);
+ GitReleaseManagerAddAssets(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone, buildResultDir + packageFile2022);
GitReleaseManagerClose(parameters.GitHub.Token, "cake-build", "cake-vs", parameters.Version.Milestone);
})
.OnError(exception =>
@@ -195,7 +203,8 @@ Task("Upload-Artifact")
.WithCriteria(() => parameters.ShouldPublishToAppVeyor)
.Does(() =>
{
- AppVeyor.UploadArtifact(artifacts + "Cake.VisualStudio.vsix");
+ AppVeyor.UploadArtifact(artifacts + "Cake.VisualStudio.2019.vsix");
+ AppVeyor.UploadArtifact(artifacts + "Cake.VisualStudio.2022.vsix");
});
Task("Publish-Extension")
@@ -203,11 +212,12 @@ Task("Publish-Extension")
.WithCriteria(() => parameters.ShouldPublishToMyGet)
.Does(() =>
{
- var vsixPath = artifacts + "Cake.VisualStudio.vsix";
var client = MyGetClient.GetClient(parameters.MyGet.Url, parameters.MyGet.Key, s => Context.Verbose(s));
- Information("Uploading VSIX to {0}...", parameters.MyGet.Url);
- var response = client.UploadVsix(GetFile(artifacts + "Cake.VisualStudio.vsix"));
- Information("VSIX Upload {0}", response.IsSuccessStatusCode ? "succeeded." : "failed with reason '" + response.ReasonPhrase + "'.");
+ Information("Uploading VSIXs to {0}...", parameters.MyGet.Url);
+ var response = client.UploadVsix(GetFile(artifacts + "Cake.VisualStudio.2019.vsix"));
+ Information("VSIX Upload (2019) {0}", response.IsSuccessStatusCode ? "succeeded." : "failed with reason '" + response.ReasonPhrase + "'.");
+ response = client.UploadVsix(GetFile(artifacts + "Cake.VisualStudio.2022.vsix"));
+ Information("VSIX Upload (2019) {0}", response.IsSuccessStatusCode ? "succeeded." : "failed with reason '" + response.ReasonPhrase + "'.");
});
Task("Default")
diff --git a/extension-manifest.json b/extension-manifest.json
new file mode 100644
index 0000000..2724f77
--- /dev/null
+++ b/extension-manifest.json
@@ -0,0 +1,20 @@
+{
+ "$schema": "http://json.schemastore.org/vsix-publish",
+ "categories": [
+ "build"
+ ],
+ "identity": {
+ "internalName": "CakeforVisualStudio",
+ "tags": [
+ "Build",
+ "C#",
+ "Cake"
+ ]
+ },
+ "overview": "./README.md",
+ "priceCategory": "free",
+ "publisher": "vs-publisher-1392591",
+ "private": false,
+ "qna": false,
+ "repo": "https://github.com/cake-build/cake-vs"
+}
\ No newline at end of file
diff --git a/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj
new file mode 100644
index 0000000..7f9731d
--- /dev/null
+++ b/src/Cake.VisualStudio.2022/Cake.VisualStudio.2022.csproj
@@ -0,0 +1,323 @@
+
+
+
+ 15.0
+ $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)
+
+
+ true
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+
+ Program
+ $(DevEnvDir)\devenv.exe
+ /rootsuffix Exp
+
+
+
+ Debug
+ AnyCPU
+ 2.0
+ {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ {F8EB885A-FCA3-410A-B895-9CE327D5D482}
+ Library
+ Properties
+ Cake.VisualStudio
+ Cake.VisualStudio
+ v4.7.2
+ true
+ true
+ true
+ true
+ true
+ false
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+ $([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\TemplateBuilder.1.1.4.5-beta\tools\ligershark.templates.targets ))
+
+
+
+ VsCommandTable.cs
+ True
+ True
+ VsCommandTable.vsct
+
+
+
+ True
+ True
+ source.extension.vsixmanifest
+
+
+
+
+ Resources\LICENSE
+ true
+
+
+ icons.pkgdef
+ true
+
+
+ Resources\cake-icon.ico
+ true
+
+
+ Resources\CakeFile.png
+
+
+ Resources\icon.png
+ true
+
+
+ Resources\MenuIcons.bmp
+ true
+
+
+ Resources\preview.png
+ true
+
+
+ Resources\TaskRunner.png
+ true
+
+
+ Snippets\snippets.pkgdef
+ true
+
+
+ VsCommandTable.vsct
+ Menus.ctmenu
+ VsctGenerator
+ VsCommandTable.cs
+
+
+ source.extension.vsixmanifest
+
+
+ FileIcons.imagemanifest
+ true
+
+
+ Snippets\Cake\argument.snippet
+ true
+
+
+ Snippets\Cake\cake-task.snippet
+ true
+
+
+ Snippets\Cake-Addin\method-alias.snippet
+ true
+
+
+ Snippets\Cake-Addin\property-alias.snippet
+ true
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+ true
+ Packages
+ Always
+ false
+
+
+
+ Designer
+ VsixManifestGenerator
+ source.extension1.cs
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {FCE573DD-E74E-4AB1-9D17-56FC8869797F}
+ AddinTemplate
+ ProjectTemplates
+ false
+ TemplateProjectOutputGroup%3b
+
+
+ {F21E9BF8-745B-4B29-B113-0E55AE840D24}
+ AddinTestBasicTemplate
+ ProjectTemplates
+ false
+ TemplateProjectOutputGroup%3b
+
+
+ {AB983284-D1F6-4853-9462-402F2985A141}
+ AddinTestTemplate
+ ProjectTemplates
+ false
+ TemplateProjectOutputGroup%3b
+
+
+ {c27ab61e-d245-4a8c-abd1-53313e388509}
+ ItemTemplate
+ ItemTemplates
+ false
+ TemplateProjectOutputGroup%3b
+
+
+ {85BCBED7-39BD-4670-85F7-EE36D0DA31C0}
+ ModuleTemplate
+ ProjectTemplates
+ false
+ TemplateProjectOutputGroup%3b
+
+
+ {5D45E667-D12D-44F8-8A87-5503BF5DE274}
+ SolutionItemTemplate
+ ItemTemplates
+ false
+ TemplateProjectOutputGroup%3b
+
+
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
+ 0.38.5
+
+
+ 2.5.2
+
+
+ 17.0.0-previews-2-31512-422
+
+
+ 17.0.0-previews-2-31512-422
+
+
+ 16.10.1
+
+
+ 17.0.2155-preview2
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+ 1.1.6.1
+
+
+ 2.4.1
+
+
+ 2.4.3
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Cake.VisualStudio.2022/Properties/AssemblyInfo.cs b/src/Cake.VisualStudio.2022/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..3d111d2
--- /dev/null
+++ b/src/Cake.VisualStudio.2022/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+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("Cake.VisualStudio._2022")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Cake.VisualStudio._2022")]
+[assembly: AssemblyCopyright("")]
+[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)]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// 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/src/source.extension.ico b/src/Cake.VisualStudio.2022/source.extension.ico
similarity index 100%
rename from src/source.extension.ico
rename to src/Cake.VisualStudio.2022/source.extension.ico
diff --git a/src/Cake.VisualStudio.2022/source.extension.vsixmanifest b/src/Cake.VisualStudio.2022/source.extension.vsixmanifest
new file mode 100644
index 0000000..e5abd10
--- /dev/null
+++ b/src/Cake.VisualStudio.2022/source.extension.vsixmanifest
@@ -0,0 +1,42 @@
+
+
+
+
+ Cake for Visual Studio 2022
+ Adds support for the Cake build tool in Visual Studio 2022. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files.
+ https://github.com/cake-build/cake-vs
+ Resources\LICENSE
+ Resources\icon.png
+ Resources\preview.png
+ cake, build
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Cake.VisualStudio.2022/source.extension1.cs b/src/Cake.VisualStudio.2022/source.extension1.cs
new file mode 100644
index 0000000..8b3fd0f
--- /dev/null
+++ b/src/Cake.VisualStudio.2022/source.extension1.cs
@@ -0,0 +1,18 @@
+// ------------------------------------------------------------------------------
+//
+// This file was generated by VSIX Synchronizer
+//
+// ------------------------------------------------------------------------------
+namespace Cake.VisualStudio
+{
+ internal sealed partial class Vsix
+ {
+ public const string Id = "3cf9b016-d63f-44ee-849d-6f3efc996134";
+ public const string Name = "Cake for Visual Studio 2022";
+ public const string Description = @"Adds support for the Cake build tool in Visual Studio 2022. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files.";
+ public const string Language = "en-US";
+ public const string Version = "0.1.1.0";
+ public const string Author = "Cake Build";
+ public const string Tags = "cake, build";
+ }
+}
diff --git a/src/Adornments/AdornmentLayer.cs b/src/Cake.VisualStudio.Shared/Adornments/AdornmentLayer.cs
similarity index 100%
rename from src/Adornments/AdornmentLayer.cs
rename to src/Cake.VisualStudio.Shared/Adornments/AdornmentLayer.cs
diff --git a/src/Adornments/AdornmentProvider.cs b/src/Cake.VisualStudio.Shared/Adornments/AdornmentProvider.cs
similarity index 100%
rename from src/Adornments/AdornmentProvider.cs
rename to src/Cake.VisualStudio.Shared/Adornments/AdornmentProvider.cs
diff --git a/src/Adornments/LogoAdornment.cs b/src/Cake.VisualStudio.Shared/Adornments/LogoAdornment.cs
similarity index 100%
rename from src/Adornments/LogoAdornment.cs
rename to src/Cake.VisualStudio.Shared/Adornments/LogoAdornment.cs
diff --git a/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems
new file mode 100644
index 0000000..2ebe513
--- /dev/null
+++ b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.projitems
@@ -0,0 +1,60 @@
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+ true
+ 3d9ab2db-3dd8-4e2b-8dbc-bf29edaf1a1b
+
+
+ Cake.VisualStudio.Shared
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.shproj b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.shproj
new file mode 100644
index 0000000..167e6c4
--- /dev/null
+++ b/src/Cake.VisualStudio.Shared/Cake.VisualStudio.Shared.shproj
@@ -0,0 +1,13 @@
+
+
+
+ 3d9ab2db-3dd8-4e2b-8dbc-bf29edaf1a1b
+ 14.0
+
+
+
+
+
+
+
+
diff --git a/src/CakePackage.cs b/src/Cake.VisualStudio.Shared/CakePackage.cs
similarity index 85%
rename from src/CakePackage.cs
rename to src/Cake.VisualStudio.Shared/CakePackage.cs
index d3074fb..84ee875 100644
--- a/src/CakePackage.cs
+++ b/src/Cake.VisualStudio.Shared/CakePackage.cs
@@ -17,12 +17,23 @@
namespace Cake.VisualStudio
{
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
- [InstalledProductRegistration("#110", "#112", Vsix.Version, IconResourceID = 400)]
+ [InstalledProductRegistration(Vsix.Name, Vsix.Description, Vsix.Version)]
[ProvideAutoLoad(UIContextGuids80.SolutionExists, PackageAutoLoadFlags.BackgroundLoad)]
[Guid(PackageGuids.guidCakePackageString)]
[ProvideMenuResource("Menus.ctmenu", 1)]
- [ProvideLanguageService(typeof(CakeLanguageService), Helpers.Constants.CakeContentType, 100)]
+ [ProvideLanguageService(typeof(CakeLanguageService), Helpers.Constants.CakeContentType, Helpers.Constants.LanguageResourceId)]
[ProvideLanguageExtension(typeof(CakeLanguageService), ".cake")]
+ [ProvideLanguageCodeExpansion(
+ typeof(CakeLanguageService),
+ Helpers.Constants.CakeContentType,
+ Helpers.Constants.LanguageResourceId,
+ "Cake", //the language ID used in the .snippet files
+ null, // omit the xml definition, use only searchPaths.
+ ShowRoots = false, // show the root of the searchPaths in Snippets explorer
+ SearchPaths =
+ @"$PackageFolder$\Snippets\Cake;" +
+ @"\%MyDocs%\Code Snippets\Cake\My Code Snippets",
+ ForceCreateDirs = @"\%MyDocs%\Code Snippets\Cake\My Code Snippets")]
public sealed partial class CakePackage : AsyncPackage, IVsShellPropertyEvents
{
private static DTE2 _dte;
diff --git a/src/Classifier/CakeClassificationDefinition.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassificationDefinition.cs
similarity index 100%
rename from src/Classifier/CakeClassificationDefinition.cs
rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassificationDefinition.cs
diff --git a/src/Classifier/CakeClassifier.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassifier.cs
similarity index 100%
rename from src/Classifier/CakeClassifier.cs
rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassifier.cs
diff --git a/src/Classifier/CakeClassifierFormat.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassifierFormat.cs
similarity index 100%
rename from src/Classifier/CakeClassifierFormat.cs
rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassifierFormat.cs
diff --git a/src/Classifier/CakeClassifierProvider.cs b/src/Cake.VisualStudio.Shared/Classifier/CakeClassifierProvider.cs
similarity index 100%
rename from src/Classifier/CakeClassifierProvider.cs
rename to src/Cake.VisualStudio.Shared/Classifier/CakeClassifierProvider.cs
diff --git a/src/Classifier/ClassifierNames.cs b/src/Cake.VisualStudio.Shared/Classifier/ClassifierNames.cs
similarity index 100%
rename from src/Classifier/ClassifierNames.cs
rename to src/Cake.VisualStudio.Shared/Classifier/ClassifierNames.cs
diff --git a/src/Classifier/Languages/BaseLanguage.cs b/src/Cake.VisualStudio.Shared/Classifier/Languages/BaseLanguage.cs
similarity index 100%
rename from src/Classifier/Languages/BaseLanguage.cs
rename to src/Cake.VisualStudio.Shared/Classifier/Languages/BaseLanguage.cs
diff --git a/src/Classifier/Languages/CakeLanguage.cs b/src/Cake.VisualStudio.Shared/Classifier/Languages/CakeLanguage.cs
similarity index 100%
rename from src/Classifier/Languages/CakeLanguage.cs
rename to src/Cake.VisualStudio.Shared/Classifier/Languages/CakeLanguage.cs
diff --git a/src/Configuration/BindingParser.cs b/src/Cake.VisualStudio.Shared/Configuration/BindingParser.cs
similarity index 100%
rename from src/Configuration/BindingParser.cs
rename to src/Cake.VisualStudio.Shared/Configuration/BindingParser.cs
diff --git a/src/Configuration/ConfigurationExtensions.cs b/src/Cake.VisualStudio.Shared/Configuration/ConfigurationExtensions.cs
similarity index 100%
rename from src/Configuration/ConfigurationExtensions.cs
rename to src/Cake.VisualStudio.Shared/Configuration/ConfigurationExtensions.cs
diff --git a/src/Configuration/ConfigurationParser.cs b/src/Cake.VisualStudio.Shared/Configuration/ConfigurationParser.cs
similarity index 100%
rename from src/Configuration/ConfigurationParser.cs
rename to src/Cake.VisualStudio.Shared/Configuration/ConfigurationParser.cs
diff --git a/src/Configuration/ToolLocator.cs b/src/Cake.VisualStudio.Shared/Configuration/ToolLocator.cs
similarity index 100%
rename from src/Configuration/ToolLocator.cs
rename to src/Cake.VisualStudio.Shared/Configuration/ToolLocator.cs
diff --git a/src/ContentType/CakeContentTypeDefinition.cs b/src/Cake.VisualStudio.Shared/ContentType/CakeContentTypeDefinition.cs
similarity index 100%
rename from src/ContentType/CakeContentTypeDefinition.cs
rename to src/Cake.VisualStudio.Shared/ContentType/CakeContentTypeDefinition.cs
diff --git a/src/ContentType/CakeLanguageService.cs b/src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs
similarity index 98%
rename from src/ContentType/CakeLanguageService.cs
rename to src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs
index 3c6df74..42fc3fa 100644
--- a/src/ContentType/CakeLanguageService.cs
+++ b/src/Cake.VisualStudio.Shared/ContentType/CakeLanguageService.cs
@@ -9,7 +9,7 @@
namespace Cake.VisualStudio.ContentType
{
- [Guid("60914246-A28E-488D-AEB7-34CCDD35FC56")]
+ [Guid(Constants.LanguageGuidStr)]
class CakeLanguageService : LanguageService
{
private LanguagePreferences preferences = null;
diff --git a/src/Editor/CakeDropHandler.cs b/src/Cake.VisualStudio.Shared/Editor/CakeDropHandler.cs
similarity index 100%
rename from src/Editor/CakeDropHandler.cs
rename to src/Cake.VisualStudio.Shared/Editor/CakeDropHandler.cs
diff --git a/src/Editor/CakeScriptDropHandler.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandler.cs
similarity index 100%
rename from src/Editor/CakeScriptDropHandler.cs
rename to src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandler.cs
diff --git a/src/Editor/CakeScriptDropHandlerProvider.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandlerProvider.cs
similarity index 100%
rename from src/Editor/CakeScriptDropHandlerProvider.cs
rename to src/Cake.VisualStudio.Shared/Editor/CakeScriptDropHandlerProvider.cs
diff --git a/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsHandler.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsHandler.cs
new file mode 100644
index 0000000..3345ab0
--- /dev/null
+++ b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsHandler.cs
@@ -0,0 +1,248 @@
+using Microsoft.VisualStudio;
+using Microsoft.VisualStudio.OLE.Interop;
+using Microsoft.VisualStudio.Shell;
+using Microsoft.VisualStudio.Text.Editor;
+using Microsoft.VisualStudio.Text.Operations;
+using Microsoft.VisualStudio.TextManager.Interop;
+
+using MSXML;
+
+using System;
+
+namespace Cake.VisualStudio.Shared.Editor
+{
+ internal class CakeScriptSnippetsHandler : IOleCommandTarget, IVsExpansionClient
+ {
+ private readonly ITextView textView;
+ private readonly IVsTextView vsTextView;
+ private readonly CakeScriptSnippetsProvider provider;
+ private readonly IOleCommandTarget nextCommandHandler;
+ private readonly IVsExpansionManager expansionManager;
+ private IVsExpansionSession session;
+
+ internal CakeScriptSnippetsHandler(IVsTextView textViewAdapter, ITextView textView, CakeScriptSnippetsProvider provider)
+ {
+ this.textView = textView;
+ this.provider = provider;
+ vsTextView = textViewAdapter;
+
+ //get the text manager from the service provider
+ var textManager = (IVsTextManager2)provider.ServiceProvider.GetService(typeof(SVsTextManager)) ?? throw new ArgumentOutOfRangeException(nameof(provider), "Could not create a SVsTextManager!");
+ textManager.GetExpansionManager(out expansionManager);
+ session = null;
+
+
+ //add the command to the command chain
+ textViewAdapter.AddCommandFilter(this, out nextCommandHandler);
+ }
+
+ public int QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+ if (!VsShellUtilities.IsInAutomationFunction(provider.ServiceProvider))
+ {
+ if (pguidCmdGroup == VSConstants.VSStd2K && cCmds > 0)
+ {
+ // make the Insert Snippet command appear on the context menu
+ if (prgCmds[0].cmdID == (uint)VSConstants.VSStd2KCmdID.INSERTSNIPPET)
+ {
+ prgCmds[0].cmdf = (int)Constants.MSOCMDF_ENABLED | (int)Constants.MSOCMDF_SUPPORTED;
+ return VSConstants.S_OK;
+ }
+ }
+ }
+
+ return nextCommandHandler.QueryStatus(ref pguidCmdGroup, cCmds, prgCmds, pCmdText);
+ }
+
+ public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
+ {
+ ThreadHelper.ThrowIfNotOnUIThread();
+ /*
+ if (VsShellUtilities.IsInAutomationFunction(provider.ServiceProvider))
+ {
+ return nextCommandHandler.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
+ }
+ */
+
+ // Show the snippet picker
+ if (nCmdID == (uint)VSConstants.VSStd2KCmdID.INSERTSNIPPET)
+ {
+ expansionManager.InvokeInsertionUI(
+ vsTextView,
+ this, //the expansion client
+ Helpers.Constants.LanguageGuid,
+ null, //use all snippet types
+ 0, //number of types (0 for all)
+ 0, //ignored if iCountTypes == 0
+ null, //use all snippet kinds
+ 0, //use all snippet kinds
+ 0, //ignored if iCountTypes == 0
+ "Cake Snippets", //the text to show in the prompt
+ string.Empty); //only the ENTER key causes insert
+
+ return VSConstants.S_OK;
+ }
+
+ //the expansion insertion is handled in OnItemChosen
+ //if the expansion session is still active, handle tab/back-tab/return/cancel
+ if (session != null)
+ {
+ if (nCmdID == (uint)VSConstants.VSStd2KCmdID.BACKTAB)
+ {
+ session.GoToPreviousExpansionField();
+ return VSConstants.S_OK;
+ }
+ else if (nCmdID == (uint)VSConstants.VSStd2KCmdID.TAB)
+ {
+
+ session.GoToNextExpansionField(0); //false to support cycling through all the fields
+ return VSConstants.S_OK;
+ }
+ else if (nCmdID == (uint)VSConstants.VSStd2KCmdID.RETURN || nCmdID == (uint)VSConstants.VSStd2KCmdID.CANCEL)
+ {
+ if (session.EndCurrentExpansion(0) == VSConstants.S_OK)
+ {
+ session = null;
+ return VSConstants.S_OK;
+ }
+ }
+ }
+
+ //neither an expansion session nor a completion session is open, but we got a tab, so check whether the last word typed is a snippet shortcut
+ if (session == null && nCmdID == (uint)VSConstants.VSStd2KCmdID.TAB)
+ {
+ //get the word that was just added
+ CaretPosition pos = textView.Caret.Position;
+ TextExtent word = provider.NavigatorService.GetTextStructureNavigator(textView.TextBuffer).GetExtentOfWord(pos.BufferPosition - 1); //use the position 1 space back
+ string textString = word.Span.GetText(); //the word that was just added
+ //if it is a code snippet, insert it, otherwise carry on
+ if (InsertAnyExpansion(textString, null, null))
+ {
+ EndSession();
+ return VSConstants.S_OK;
+ }
+ }
+
+ return nextCommandHandler.Exec(ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
+ }
+
+ public int EndExpansion()
+ {
+ session = null;
+ return VSConstants.S_OK;
+ }
+
+ public int FormatSpan(IVsTextLines pBuffer, TextSpan[] ts)
+ {
+ return VSConstants.S_OK;
+ }
+
+ public int GetExpansionFunction(IXMLDOMNode xmlFunctionNode, string bstrFieldName, out IVsExpansionFunction pFunc)
+ {
+ pFunc = null;
+ return VSConstants.S_OK;
+ }
+
+ public int IsValidKind(IVsTextLines pBuffer, TextSpan[] ts, string bstrKind, out int pfIsValidKind)
+ {
+ pfIsValidKind = 1;
+ return VSConstants.S_OK;
+ }
+
+ public int IsValidType(IVsTextLines pBuffer, TextSpan[] ts, string[] rgTypes, int iCountTypes, out int pfIsValidType)
+ {
+ pfIsValidType = 1;
+ return VSConstants.S_OK;
+ }
+
+ public int OnAfterInsertion(IVsExpansionSession pSession)
+ {
+ return VSConstants.S_OK;
+ }
+
+ public int OnBeforeInsertion(IVsExpansionSession pSession)
+ {
+ return VSConstants.S_OK;
+ }
+
+ public int PositionCaretForEditing(IVsTextLines pBuffer, TextSpan[] ts)
+ {
+ return VSConstants.S_OK;
+ }
+
+ public int OnItemChosen(string pszTitle, string pszPath)
+ {
+ if (InsertAnyExpansion(null, pszTitle, pszPath))
+ {
+ EndSession();
+ }
+
+ return VSConstants.S_OK;
+ }
+
+ private void EndSession()
+ {
+ if (session != null)
+ {
+ session.EndCurrentExpansion(0);
+ session = null;
+ }
+ }
+
+ private bool InsertAnyExpansion(string shortcut, string title, string path)
+ {
+ //first get the location of the caret, and set up a TextSpan
+ //get the column number from the IVsTextView, not the ITextView
+ vsTextView.GetCaretPos(out int startLine, out int endColumn);
+
+ var addSpan = new TextSpan
+ {
+ iStartIndex = endColumn,
+ iEndIndex = endColumn,
+ iStartLine = startLine,
+ iEndLine = startLine
+ };
+
+ if (shortcut != null) //get the expansion from the shortcut
+ {
+ //reset the TextSpan to the width of the shortcut,
+ //because we're going to replace the shortcut with the expansion
+ addSpan.iStartIndex = addSpan.iEndIndex - shortcut.Length;
+
+ expansionManager.GetExpansionByShortcut(
+ this,
+ Helpers.Constants.LanguageGuid,
+ shortcut,
+ vsTextView,
+ new TextSpan[] { addSpan },
+ 0,
+ out path,
+ out title);
+
+ }
+ if (title != null && path != null)
+ {
+ vsTextView.GetBuffer(out IVsTextLines textLines);
+ var bufferExpansion = (IVsExpansion)textLines;
+
+ if (bufferExpansion != null)
+ {
+ int hr = bufferExpansion.InsertNamedExpansion(
+ title,
+ path,
+ addSpan,
+ this,
+ Helpers.Constants.LanguageGuid,
+ 0,
+ out session);
+ if (VSConstants.S_OK == hr)
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsProvider.cs b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsProvider.cs
new file mode 100644
index 0000000..24a6c0c
--- /dev/null
+++ b/src/Cake.VisualStudio.Shared/Editor/CakeScriptSnippetsProvider.cs
@@ -0,0 +1,44 @@
+using Microsoft.VisualStudio.Editor;
+using Microsoft.VisualStudio.Language.Intellisense;
+using Microsoft.VisualStudio.Shell;
+using Microsoft.VisualStudio.Text.Editor;
+using Microsoft.VisualStudio.Text.Operations;
+using Microsoft.VisualStudio.TextManager.Interop;
+using Microsoft.VisualStudio.Utilities;
+
+using System;
+using System.ComponentModel.Composition;
+
+namespace Cake.VisualStudio.Shared.Editor
+{
+ [Export(typeof(IVsTextViewCreationListener))]
+ [Name("Cake snippets handler")]
+ [ContentType(Helpers.Constants.CakeContentType)]
+ [TextViewRole(PredefinedTextViewRoles.Editable)]
+ internal class CakeScriptSnippetsProvider : IVsTextViewCreationListener
+ {
+ [Import]
+ internal IVsEditorAdaptersFactoryService AdapterService = null;
+
+ [Import]
+ internal ICompletionBroker CompletionBroker { get; set; }
+
+ [Import]
+ internal SVsServiceProvider ServiceProvider { get; set; }
+
+ [Import]
+ internal ITextStructureNavigatorSelectorService NavigatorService { get; set; }
+
+ public void VsTextViewCreated(IVsTextView textViewAdapter)
+ {
+ ITextView textView = AdapterService.GetWpfTextView(textViewAdapter);
+ if (textView == null)
+ {
+ return;
+ }
+
+ Func generator = () => new CakeScriptSnippetsHandler(textViewAdapter, textView, this);
+ textView.Properties.GetOrCreateSingletonProperty(generator);
+ }
+ }
+}
diff --git a/src/Editor/IndentationResult.cs b/src/Cake.VisualStudio.Shared/Editor/IndentationResult.cs
similarity index 100%
rename from src/Editor/IndentationResult.cs
rename to src/Cake.VisualStudio.Shared/Editor/IndentationResult.cs
diff --git a/src/Editor/LineExtensions.cs b/src/Cake.VisualStudio.Shared/Editor/LineExtensions.cs
similarity index 100%
rename from src/Editor/LineExtensions.cs
rename to src/Cake.VisualStudio.Shared/Editor/LineExtensions.cs
diff --git a/src/Editor/SmartIndent.cs b/src/Cake.VisualStudio.Shared/Editor/SmartIndent.cs
similarity index 100%
rename from src/Editor/SmartIndent.cs
rename to src/Cake.VisualStudio.Shared/Editor/SmartIndent.cs
diff --git a/src/Editor/SmartIndentProvider.cs b/src/Cake.VisualStudio.Shared/Editor/SmartIndentProvider.cs
similarity index 100%
rename from src/Editor/SmartIndentProvider.cs
rename to src/Cake.VisualStudio.Shared/Editor/SmartIndentProvider.cs
diff --git a/src/Helpers/Constants.cs b/src/Cake.VisualStudio.Shared/Helpers/Constants.cs
similarity index 88%
rename from src/Helpers/Constants.cs
rename to src/Cake.VisualStudio.Shared/Helpers/Constants.cs
index bb6db65..eab5525 100644
--- a/src/Helpers/Constants.cs
+++ b/src/Cake.VisualStudio.Shared/Helpers/Constants.cs
@@ -2,6 +2,8 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using System;
+
namespace Cake.VisualStudio.Helpers
{
public static class Constants
@@ -22,5 +24,8 @@ public static class Constants
public const string ConfigTemplatePath = "https://cakebuild.net/download/configuration";
public const string ConfigFileName = "cake.config";
public const string ScriptFileName = "build.cake";
+ public const int LanguageResourceId = 100;
+ public const string LanguageGuidStr = "60914246-A28E-488D-AEB7-34CCDD35FC56";
+ public static Guid LanguageGuid = Guid.Parse(LanguageGuidStr);
}
}
\ No newline at end of file
diff --git a/src/Helpers/Extensions.cs b/src/Cake.VisualStudio.Shared/Helpers/Extensions.cs
similarity index 100%
rename from src/Helpers/Extensions.cs
rename to src/Cake.VisualStudio.Shared/Helpers/Extensions.cs
diff --git a/src/Helpers/Logger.cs b/src/Cake.VisualStudio.Shared/Helpers/Logger.cs
similarity index 100%
rename from src/Helpers/Logger.cs
rename to src/Cake.VisualStudio.Shared/Helpers/Logger.cs
diff --git a/src/Helpers/PathHelpers.cs b/src/Cake.VisualStudio.Shared/Helpers/PathHelpers.cs
similarity index 100%
rename from src/Helpers/PathHelpers.cs
rename to src/Cake.VisualStudio.Shared/Helpers/PathHelpers.cs
diff --git a/src/Helpers/ProjectHelpers.cs b/src/Cake.VisualStudio.Shared/Helpers/ProjectHelpers.cs
similarity index 100%
rename from src/Helpers/ProjectHelpers.cs
rename to src/Cake.VisualStudio.Shared/Helpers/ProjectHelpers.cs
diff --git a/src/Menus/InstallConfigFileCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallConfigFileCommand.cs
similarity index 100%
rename from src/Menus/InstallConfigFileCommand.cs
rename to src/Cake.VisualStudio.Shared/Menus/InstallConfigFileCommand.cs
diff --git a/src/Menus/InstallDotNetCoreBashBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetCoreBashBootstrapperCommand.cs
similarity index 100%
rename from src/Menus/InstallDotNetCoreBashBootstrapperCommand.cs
rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetCoreBashBootstrapperCommand.cs
diff --git a/src/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs
similarity index 100%
rename from src/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs
rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetCorePowerShellBootstrapperCommand.cs
diff --git a/src/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs
similarity index 100%
rename from src/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs
rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkBashBootstrapperCommand.cs
diff --git a/src/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs
similarity index 98%
rename from src/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs
rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs
index 6028e89..0d779cd 100644
--- a/src/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs
+++ b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetFrameworkPowerShellBootstrapperCommand.cs
@@ -87,6 +87,7 @@ public static void Initialize(Package package)
/// Event args.
private void MenuItemCallback(object sender, EventArgs e)
{
+ ThreadHelper.ThrowIfNotOnUIThread();
var dte = CakePackage.Dte;
if (dte == null)
diff --git a/src/Menus/InstallDotNetToolBashBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolBashBootstrapperCommand.cs
similarity index 100%
rename from src/Menus/InstallDotNetToolBashBootstrapperCommand.cs
rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolBashBootstrapperCommand.cs
diff --git a/src/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs b/src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs
similarity index 100%
rename from src/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs
rename to src/Cake.VisualStudio.Shared/Menus/InstallDotNetToolPowerShellBootstrapperCommand.cs
diff --git a/src/Menus/MenuHelpers.cs b/src/Cake.VisualStudio.Shared/Menus/MenuHelpers.cs
similarity index 100%
rename from src/Menus/MenuHelpers.cs
rename to src/Cake.VisualStudio.Shared/Menus/MenuHelpers.cs
diff --git a/src/TaskRunner/ScriptContent.cs b/src/Cake.VisualStudio.Shared/TaskRunner/ScriptContent.cs
similarity index 100%
rename from src/TaskRunner/ScriptContent.cs
rename to src/Cake.VisualStudio.Shared/TaskRunner/ScriptContent.cs
diff --git a/src/TaskRunner/TaskParser.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskParser.cs
similarity index 100%
rename from src/TaskRunner/TaskParser.cs
rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskParser.cs
diff --git a/src/TaskRunner/TaskRunner.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskRunner.cs
similarity index 100%
rename from src/TaskRunner/TaskRunner.cs
rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskRunner.cs
diff --git a/src/TaskRunner/TaskRunnerConfig.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerConfig.cs
similarity index 100%
rename from src/TaskRunner/TaskRunnerConfig.cs
rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerConfig.cs
diff --git a/src/TaskRunner/TaskRunnerOption.cs b/src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerOption.cs
similarity index 100%
rename from src/TaskRunner/TaskRunnerOption.cs
rename to src/Cake.VisualStudio.Shared/TaskRunner/TaskRunnerOption.cs
diff --git a/src/Cake.VisualStudio.csproj b/src/Cake.VisualStudio/Cake.VisualStudio.csproj
similarity index 69%
rename from src/Cake.VisualStudio.csproj
rename to src/Cake.VisualStudio/Cake.VisualStudio.csproj
index 9dd7dbd..fc0276e 100644
--- a/src/Cake.VisualStudio.csproj
+++ b/src/Cake.VisualStudio/Cake.VisualStudio.csproj
@@ -68,152 +68,149 @@
$([System.IO.Path]::GetFullPath( $(MSBuildProjectDirectory)\..\packages\TemplateBuilder.1.1.4.5-beta\tools\ligershark.templates.targets ))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ VsCommandTable.cs
+ True
+ True
+ VsCommandTable.vsct
+
source.extension.vsixmanifest
-
-
-
-
-
True
True
- VsCommandTable.vsct
-
-
-
-
-
-
+
Resources\LICENSE
true
-
- Always
+
+ icons.pkgdef
true
-
+
+ Resources\cake-icon.ico
true
-
-
-
+
+ Resources\CakeFile.png
+
+
+ Resources\icon.png
true
+
+ Resources\MenuIcons.bmp
+ true
+
+
+ Resources\preview.png
+ true
+
+
+ Resources\TaskRunner.png
+ true
+
+
+ Snippets\snippets.pkgdef
+ true
+
+
+ VsCommandTable.vsct
+ Menus.ctmenu
+ VsctGenerator
+ VsCommandTable.cs
+
source.extension.vsixmanifest
-
+
+ FileIcons.imagemanifest
+ true
+
+
+ Snippets\Cake\argument.snippet
+ true
+
+
+ Snippets\Cake\cake-task.snippet
+ true
+
+
+ Snippets\Cake-Addin\method-alias.snippet
+ true
+
+
+ Snippets\Cake-Addin\property-alias.snippet
true
- Designer
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
+
true
Packages
Always
false
-
-
-
-
- Designer
-
Designer
VsixManifestGenerator
- source.extension.resx
+ source.extension.cs
+
@@ -229,73 +226,44 @@
+
-
- Menus.ctmenu
- VsctGenerator
- VsCommandTable.cs
- Designer
-
-
- true
- Always
-
-
- true
-
-
- true
-
-
-
-
- True
- True
- source.extension.vsixmanifest
- true
- VSPackage
-
-
-
-
-
-
-
+
{FCE573DD-E74E-4AB1-9D17-56FC8869797F}
AddinTemplate
ProjectTemplates
false
TemplateProjectOutputGroup%3b
-
+
{F21E9BF8-745B-4B29-B113-0E55AE840D24}
AddinTestBasicTemplate
ProjectTemplates
false
TemplateProjectOutputGroup%3b
-
+
{AB983284-D1F6-4853-9462-402F2985A141}
AddinTestTemplate
ProjectTemplates
false
TemplateProjectOutputGroup%3b
-
+
{c27ab61e-d245-4a8c-abd1-53313e388509}
ItemTemplate
ItemTemplates
false
TemplateProjectOutputGroup%3b
-
+
{85BCBED7-39BD-4670-85F7-EE36D0DA31C0}
ModuleTemplate
ProjectTemplates
false
TemplateProjectOutputGroup%3b
-
+
{5D45E667-D12D-44F8-8A87-5503BF5DE274}
SolutionItemTemplate
ItemTemplates
@@ -323,6 +291,11 @@
15.8.36
+
+ 17.0.2155-preview2
+ runtime; build; native; contentfiles; analyzers; buildtransitive
+ all
+
1.1.6.1
@@ -335,6 +308,7 @@
all
+
diff --git a/src/Properties/AssemblyInfo.cs b/src/Cake.VisualStudio/Properties/AssemblyInfo.cs
similarity index 100%
rename from src/Properties/AssemblyInfo.cs
rename to src/Cake.VisualStudio/Properties/AssemblyInfo.cs
diff --git a/src/Properties/template-builder.props b/src/Cake.VisualStudio/Properties/template-builder.props
similarity index 100%
rename from src/Properties/template-builder.props
rename to src/Cake.VisualStudio/Properties/template-builder.props
diff --git a/src/app.config b/src/Cake.VisualStudio/app.config
similarity index 100%
rename from src/app.config
rename to src/Cake.VisualStudio/app.config
diff --git a/src/source.extension.cs b/src/Cake.VisualStudio/source.extension.cs
similarity index 89%
rename from src/source.extension.cs
rename to src/Cake.VisualStudio/source.extension.cs
index 10eed4b..3f209bc 100644
--- a/src/source.extension.cs
+++ b/src/Cake.VisualStudio/source.extension.cs
@@ -1,11 +1,11 @@
// ------------------------------------------------------------------------------
//
-// This file was generated by Extensibility Tools v1.10.188
+// This file was generated by VSIX Synchronizer
//
// ------------------------------------------------------------------------------
namespace Cake.VisualStudio
{
- static class Vsix
+ internal sealed partial class Vsix
{
public const string Id = "3cf9b016-d63f-44ee-849d-6f3efc996134";
public const string Name = "Cake for Visual Studio";
diff --git a/src/Cake.VisualStudio/source.extension.ico b/src/Cake.VisualStudio/source.extension.ico
new file mode 100644
index 0000000..d844c1a
Binary files /dev/null and b/src/Cake.VisualStudio/source.extension.ico differ
diff --git a/src/source.extension.vsixmanifest b/src/Cake.VisualStudio/source.extension.vsixmanifest
similarity index 100%
rename from src/source.extension.vsixmanifest
rename to src/Cake.VisualStudio/source.extension.vsixmanifest
diff --git a/src/Packages/PackageDescriptor.cs b/src/Packages/PackageDescriptor.cs
deleted file mode 100644
index cf63b9b..0000000
--- a/src/Packages/PackageDescriptor.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Xml.Linq;
-using System.Xml.XPath;
-
-namespace Cake.VisualStudio.Packages
-{
- class PackageDescriptor
- {
- public PackageDescriptor()
- {
-
- }
-
- public PackageDescriptor(string id, string version, string source = "http://nuget.org/api/v2")
- {
- Id = id;
- Version = version;
- Source = source;
- }
- internal string Id { get; set; }
- internal string Version { get; set; }
- internal string Source { get; set; } = "http://nuget.org/api/v2";
-
- internal static IEnumerable ParseAllFromXml(string xml)
- {
- var doc = XDocument.Parse(xml);
- var packages = doc.XPathSelectElements("//package");
- return packages.Select(p => new PackageDescriptor(p.Attribute("id").Value, p.Attribute("version").Value));
- }
- }
-}
diff --git a/src/Packages/PackageWizard.cs b/src/Packages/PackageWizard.cs
deleted file mode 100644
index c20d508..0000000
--- a/src/Packages/PackageWizard.cs
+++ /dev/null
@@ -1,82 +0,0 @@
-using System.Collections.Generic;
-using System.ComponentModel.Composition;
-using System.ComponentModel.Composition.Hosting;
-using Cake.VisualStudio.Helpers;
-using EnvDTE;
-using Microsoft.VisualStudio.ComponentModelHost;
-using Microsoft.VisualStudio.OLE.Interop;
-using Microsoft.VisualStudio.Shell;
-using Microsoft.VisualStudio.TemplateWizard;
-using NuGet.VisualStudio;
-
-namespace Cake.VisualStudio.Packages
-{
- public sealed class PackageWizard : IWizard
- {
- [Import]
- internal IVsTemplateWizard Wizard { get; set; }
-
- [Import]
- internal IVsPackageInstaller PackageInstaller { get; set; }
-
- public void RunStarted(object automationObject, Dictionary replacementsDictionary, WizardRunKind runKind, object[] customParams)
- {
- if (runKind == WizardRunKind.AsNewProject)
- {
- using (var serviceProvider = new ServiceProvider((IServiceProvider)automationObject))
- {
- var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));
- using (var container = new CompositionContainer(componentModel.DefaultExportProvider))
- {
- container.ComposeParts(this);
- }
- }
-
- if (PackageInstaller == null)
- {
- //MessageBox.Show("NuGet Package Manager not available.");
-
- throw new WizardBackoutException("NuGet Package Manager not available.");
- }
- ParameterData = replacementsDictionary["$WizardData%"];
- }
- Wizard.RunStarted(automationObject, replacementsDictionary, runKind, customParams);
- }
-
- private string ParameterData { get; set; }
-
- public void ProjectFinishedGenerating(Project project)
- {
- var packages = PackageDescriptor.ParseAllFromXml(ParameterData);
- if (PackageInstaller != null)
- {
- foreach (var package in packages)
- {
- CakePackage.Dte.ShowStatusBarText($"Installing NuGet package {package.Id}.{package.Version}");
- PackageInstaller.InstallPackage(package.Source, project, package.Id, package.Version, true);
- }
- }
- Wizard.ProjectFinishedGenerating(project);
- }
-
- public void ProjectItemFinishedGenerating(ProjectItem projectItem)
- {
- Wizard.ProjectItemFinishedGenerating(projectItem);
- }
-
- public bool ShouldAddProjectItem(string filePath)
- {
- return Wizard.ShouldAddProjectItem(filePath);
- }
-
- public void BeforeOpeningFile(ProjectItem projectItem)
- {
- Wizard.BeforeOpeningFile(projectItem);
- }
-
- public void RunFinished()
- {
- Wizard.RunFinished();
- }
- }
-}
diff --git a/src/Snippets/snippets.pkgdef b/src/Snippets/snippets.pkgdef
deleted file mode 100644
index 304a7c2..0000000
--- a/src/Snippets/snippets.pkgdef
+++ /dev/null
@@ -1,3 +0,0 @@
-
-[$RootKey$\Languages\CodeExpansions\Cake\Paths]
-"Snippets"="$PackageFolder$\CSharp"
\ No newline at end of file
diff --git a/src/FileIcons.imagemanifest b/src/metadata/FileIcons.imagemanifest
similarity index 100%
rename from src/FileIcons.imagemanifest
rename to src/metadata/FileIcons.imagemanifest
diff --git a/src/Resources/CakeFile.png b/src/metadata/Resources/CakeFile.png
similarity index 100%
rename from src/Resources/CakeFile.png
rename to src/metadata/Resources/CakeFile.png
diff --git a/src/Resources/MenuIcons.bmp b/src/metadata/Resources/MenuIcons.bmp
similarity index 100%
rename from src/Resources/MenuIcons.bmp
rename to src/metadata/Resources/MenuIcons.bmp
diff --git a/src/Resources/MenuIcons.pxf b/src/metadata/Resources/MenuIcons.pxf
similarity index 100%
rename from src/Resources/MenuIcons.pxf
rename to src/metadata/Resources/MenuIcons.pxf
diff --git a/src/Resources/TaskRunner.png b/src/metadata/Resources/TaskRunner.png
similarity index 100%
rename from src/Resources/TaskRunner.png
rename to src/metadata/Resources/TaskRunner.png
diff --git a/src/Resources/cake-icon.ico b/src/metadata/Resources/cake-icon.ico
similarity index 100%
rename from src/Resources/cake-icon.ico
rename to src/metadata/Resources/cake-icon.ico
diff --git a/src/Resources/icon.png b/src/metadata/Resources/icon.png
similarity index 100%
rename from src/Resources/icon.png
rename to src/metadata/Resources/icon.png
diff --git a/src/Resources/preview.png b/src/metadata/Resources/preview.png
similarity index 100%
rename from src/Resources/preview.png
rename to src/metadata/Resources/preview.png
diff --git a/src/Snippets/CSharp/method-alias.snippet b/src/metadata/Snippets/Cake-Addin/method-alias.snippet
similarity index 100%
rename from src/Snippets/CSharp/method-alias.snippet
rename to src/metadata/Snippets/Cake-Addin/method-alias.snippet
diff --git a/src/Snippets/CSharp/property-alias.snippet b/src/metadata/Snippets/Cake-Addin/property-alias.snippet
similarity index 100%
rename from src/Snippets/CSharp/property-alias.snippet
rename to src/metadata/Snippets/Cake-Addin/property-alias.snippet
diff --git a/src/Snippets/Cake/argument.snippet b/src/metadata/Snippets/Cake/argument.snippet
similarity index 100%
rename from src/Snippets/Cake/argument.snippet
rename to src/metadata/Snippets/Cake/argument.snippet
diff --git a/src/Snippets/Cake/cake-task.snippet b/src/metadata/Snippets/Cake/cake-task.snippet
similarity index 100%
rename from src/Snippets/Cake/cake-task.snippet
rename to src/metadata/Snippets/Cake/cake-task.snippet
diff --git a/src/metadata/Snippets/snippets.pkgdef b/src/metadata/Snippets/snippets.pkgdef
new file mode 100644
index 0000000..39f2093
--- /dev/null
+++ b/src/metadata/Snippets/snippets.pkgdef
@@ -0,0 +1,3 @@
+
+[$RootKey$\Languages\CodeExpansions\CSharp\Paths]
+"Snippets"="$PackageFolder$\Cake-Addin"
\ No newline at end of file
diff --git a/src/VsCommandTable.cs b/src/metadata/VsCommandTable.cs
similarity index 100%
rename from src/VsCommandTable.cs
rename to src/metadata/VsCommandTable.cs
diff --git a/src/VsCommandTable.vsct b/src/metadata/VsCommandTable.vsct
similarity index 100%
rename from src/VsCommandTable.vsct
rename to src/metadata/VsCommandTable.vsct
diff --git a/src/icons.pkgdef b/src/metadata/icons.pkgdef
similarity index 100%
rename from src/icons.pkgdef
rename to src/metadata/icons.pkgdef
diff --git a/src/source.extension.resx b/src/source.extension.resx
deleted file mode 100644
index 02682c4..0000000
--- a/src/source.extension.resx
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- text/microsoft-resx
-
-
- 2.0
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
-
-
- Cake for Visual Studio
-
-
- Adds support for the Cake build tool in Visual Studio 2017 and 2019. Includes support for the Task Runner Explorer, new templates and bootstrapping important Cake files.
-
-
-
- source.extension.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
-
-
\ No newline at end of file