Skip to content

Commit 31f78ce

Browse files
Added support for VS2019
1 parent 558e9b2 commit 31f78ce

10 files changed

+93
-96
lines changed

CommandTaskRunner.sln

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.24720.0
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.28117.3001
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandTaskRunner", "src\CommandTaskRunner.csproj", "{5BB616A3-0392-421C-9D49-683EB5211159}"
77
EndProject
@@ -25,4 +25,7 @@ Global
2525
GlobalSection(SolutionProperties) = preSolution
2626
HideSolutionNode = FALSE
2727
EndGlobalSection
28+
GlobalSection(ExtensibilityGlobals) = postSolution
29+
SolutionGuid = {449A5356-55EA-483A-8679-B19B15E55440}
30+
EndGlobalSection
2831
EndGlobal

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: Visual Studio 2017 RC
1+
image: Visual Studio 2017
22

33
install:
44
- ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex

src/CommandTaskRunner.csproj

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props')" />
3+
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props')" />
44
<PropertyGroup>
5-
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
5+
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
66
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
77
<StartAction>Program</StartAction>
88
<StartProgram>$(DevEnvDir)\devenv.exe</StartProgram>
@@ -99,7 +99,6 @@
9999
<Content Include="Resources\preview.png">
100100
<IncludeInVSIX>true</IncludeInVSIX>
101101
</Content>
102-
<None Include="app.config" />
103102
<None Include="packages.config" />
104103
<None Include="source.extension.vsixmanifest">
105104
<SubType>Designer</SubType>
@@ -239,21 +238,29 @@
239238
<ManifestResourceName>VSPackage</ManifestResourceName>
240239
</EmbeddedResource>
241240
</ItemGroup>
241+
<ItemGroup>
242+
<Analyzer Include="..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\analyzers\cs\Microsoft.VisualStudio.SDK.Analyzers.dll" />
243+
<Analyzer Include="..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\analyzers\cs\Microsoft.VisualStudio.Threading.Analyzers.dll" />
244+
</ItemGroup>
242245
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
243246
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
244247
<ProjectExtensions>
245248
<VisualStudio>
246249
<UserProperties Schema_4commands_1json__JSONSchema="commands-schema.json" />
247250
</VisualStudio>
248251
</ProjectExtensions>
252+
<Import Project="..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" />
249253
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
250254
<PropertyGroup>
251255
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
252256
</PropertyGroup>
253-
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.props'))" />
254-
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets'))" />
257+
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.Threading.Analyzers.15.8.122\build\Microsoft.VisualStudio.Threading.Analyzers.targets'))" />
258+
<Error Condition="!Exists('..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets'))" />
259+
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.props'))" />
260+
<Error Condition="!Exists('..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets'))" />
255261
</Target>
256-
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.14.3.25420\build\Microsoft.VSSDK.BuildTools.targets')" />
262+
<Import Project="..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets" Condition="Exists('..\packages\Microsoft.VisualStudio.SDK.Analyzers.15.8.33\build\Microsoft.VisualStudio.SDK.Analyzers.targets')" />
263+
<Import Project="..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\packages\Microsoft.VSSDK.BuildTools.15.8.3252\build\Microsoft.VSSDK.BuildTools.targets')" />
257264
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
258265
Other similar extension points exist, see Microsoft.Common.targets.
259266
<Target Name="BeforeBuild">

src/Helpers/Logger.cs

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
using System;
2-
using Microsoft.VisualStudio.Shell;
3-
using Microsoft.VisualStudio.Shell.Interop;
4-
using task = System.Threading.Tasks.Task;
1+
//using System;
2+
//using Microsoft.VisualStudio.Shell;
3+
//using Microsoft.VisualStudio.Shell.Interop;
4+
//using task = System.Threading.Tasks.Task;
55

6-
internal static class Logger
7-
{
8-
private static string _name;
9-
private static IVsOutputWindowPane _pane;
10-
private static IVsOutputWindow _output;
6+
//internal static class Logger
7+
//{
8+
// private static string _name;
9+
// private static IVsOutputWindowPane _pane;
10+
// private static IVsOutputWindow _output;
1111

12-
public static void Initialize(IServiceProvider provider, string name)
13-
{
14-
_output = (IVsOutputWindow)provider.GetService(typeof(SVsOutputWindow));
15-
_name = name;
16-
}
12+
// public static void Initialize(IServiceProvider provider, string name)
13+
// {
14+
// _output = (IVsOutputWindow)provider.GetService(typeof(SVsOutputWindow));
15+
// _name = name;
16+
// }
1717

18-
public static async task InitializeAsync(AsyncPackage package, string name)
19-
{
20-
_output = await package.GetServiceAsync(typeof(SVsOutputWindow)) as IVsOutputWindow;
21-
_name = name;
22-
}
18+
// public static async task InitializeAsync(AsyncPackage package, string name)
19+
// {
20+
// _output = await package.GetServiceAsync(typeof(SVsOutputWindow)) as IVsOutputWindow;
21+
// _name = name;
22+
// }
2323

24-
public static void Log(object message)
25-
{
26-
try
27-
{
28-
if (EnsurePane())
29-
{
30-
_pane.OutputString(DateTime.Now.ToString() + ": " + message + Environment.NewLine);
31-
}
32-
}
33-
catch (Exception ex)
34-
{
35-
System.Diagnostics.Debug.Write(ex);
36-
}
37-
}
24+
// public static void Log(object message)
25+
// {
26+
// try
27+
// {
28+
// if (EnsurePane())
29+
// {
30+
// _pane.OutputString(DateTime.Now.ToString() + ": " + message + Environment.NewLine);
31+
// }
32+
// }
33+
// catch (Exception ex)
34+
// {
35+
// System.Diagnostics.Debug.Write(ex);
36+
// }
37+
// }
3838

39-
private static bool EnsurePane()
40-
{
41-
if (_pane == null && _output != null)
42-
{
43-
ThreadHelper.Generic.BeginInvoke(() =>
44-
{
45-
Guid guid = Guid.NewGuid();
46-
_output.CreatePane(ref guid, _name, 1, 1);
47-
_output.GetPane(ref guid, out _pane);
48-
});
49-
}
39+
// private static bool EnsurePane()
40+
// {
41+
// if (_pane == null && _output != null)
42+
// {
43+
// ThreadHelper.Generic.BeginInvoke(() =>
44+
// {
45+
// Guid guid = Guid.NewGuid();
46+
// _output.CreatePane(ref guid, _name, 1, 1);
47+
// _output.GetPane(ref guid, out _pane);
48+
// });
49+
// }
5050

51-
return _pane != null;
52-
}
53-
}
51+
// return _pane != null;
52+
// }
53+
//}

src/Helpers/ProjectHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public static void AddFileToProject(this Project project, string file, string it
8989
}
9090
catch (Exception ex)
9191
{
92-
Logger.Log(ex);
92+
System.Diagnostics.Debug.Write(ex);
9393
}
9494
}
9595
}

src/TaskRunner/TaskParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static IEnumerable<CommandTask> LoadTasks(string configPath)
2929
}
3030
catch (Exception ex)
3131
{
32-
Logger.Log(ex);
32+
System.Diagnostics.Debug.Write(ex);
3333
return null;
3434
}
3535

src/VSPackage.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@
77

88
namespace CommandTaskRunner
99
{
10-
[PackageRegistration(UseManagedResourcesOnly = true)]
10+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
1111
[InstalledProductRegistration("#110", "#112", Vsix.Version, IconResourceID = 400)]
1212
[ProvideMenuResource("Menus.ctmenu", 1)]
13-
[ProvideAutoLoad(UIContextGuids80.SolutionHasSingleProject)]
14-
[ProvideAutoLoad(UIContextGuids80.SolutionHasMultipleProjects)]
1513
[Guid(PackageGuids.guidAddCommandPackageString)]
1614
public sealed class CommandTaskRunnerPackage : AsyncPackage
1715
{
1816
protected override async task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
1917
{
20-
await Logger.InitializeAsync(this, Vsix.Name);
2118
await AddCommand.Initialize(this);
2219
}
2320
}

src/app.config

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/packages.config

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<packages>
33
<package id="Microsoft.VisualStudio.Imaging" version="14.3.25407" targetFramework="net46" />
44
<package id="Microsoft.VisualStudio.OLE.Interop" version="7.10.6070" targetFramework="net46" />
5+
<package id="Microsoft.VisualStudio.SDK.Analyzers" version="15.8.33" targetFramework="net46" />
56
<package id="Microsoft.VisualStudio.Shell.14.0" version="14.3.25407" targetFramework="net46" />
67
<package id="Microsoft.VisualStudio.Shell.Immutable.10.0" version="10.0.30319" targetFramework="net46" />
78
<package id="Microsoft.VisualStudio.Shell.Immutable.11.0" version="11.0.50727" targetFramework="net46" />
@@ -16,8 +17,9 @@
1617
<package id="Microsoft.VisualStudio.TextManager.Interop" version="7.10.6070" targetFramework="net46" />
1718
<package id="Microsoft.VisualStudio.TextManager.Interop.8.0" version="8.0.50727" targetFramework="net46" />
1819
<package id="Microsoft.VisualStudio.Threading" version="14.1.131" targetFramework="net46" />
20+
<package id="Microsoft.VisualStudio.Threading.Analyzers" version="15.8.122" targetFramework="net46" />
1921
<package id="Microsoft.VisualStudio.Utilities" version="14.3.25407" targetFramework="net46" />
2022
<package id="Microsoft.VisualStudio.Validation" version="14.1.111" targetFramework="net46" />
21-
<package id="Microsoft.VSSDK.BuildTools" version="14.3.25420" targetFramework="net46" developmentDependency="true" />
23+
<package id="Microsoft.VSSDK.BuildTools" version="15.8.3252" targetFramework="net46" developmentDependency="true" />
2224
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net46" />
2325
</packages>

src/source.extension.vsixmanifest

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
3-
<Metadata>
4-
<Identity Id="fc1aafb2-321e-41bd-ac37-03b09ea8ef31" Version="1.2" Language="en-US" Publisher="Mads Kristensen" />
5-
<DisplayName>Command Task Runner</DisplayName>
6-
<Description xml:space="preserve">Adds support for command line batch files in Visual Studio 2015's Task Runner Explorer. Supports .cmd, .bat, .ps1 and .psm1 files.</Description>
7-
<MoreInfo>https://github.com/madskristensen/CommandTaskRunner</MoreInfo>
8-
<License>Resources\LICENSE</License>
9-
<Icon>Resources\icon.png</Icon>
10-
<PreviewImage>Resources\preview.png</PreviewImage>
11-
<Tags>command-line, PowerShell, cmd, batch, bat, exe</Tags>
12-
</Metadata>
13-
<Installation>
14-
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="14.0" />
15-
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="15.0" />
16-
</Installation>
17-
<Prerequisites>
18-
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,16.0)" DisplayName="Visual Studio core editor" />
19-
<Prerequisite Id="Microsoft.VisualStudio.Component.Web" Version="[15.0,16.0)" DisplayName="Web development tools" />
20-
</Prerequisites>
21-
<Assets>
22-
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
23-
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
24-
</Assets>
3+
<Metadata>
4+
<Identity Id="fc1aafb2-321e-41bd-ac37-03b09ea8ef31" Version="1.2" Language="en-US" Publisher="Mads Kristensen" />
5+
<DisplayName>Command Task Runner</DisplayName>
6+
<Description xml:space="preserve">Adds support for command line batch files in Visual Studio 2015's Task Runner Explorer. Supports .cmd, .bat, .ps1 and .psm1 files.</Description>
7+
<MoreInfo>https://github.com/madskristensen/CommandTaskRunner</MoreInfo>
8+
<License>Resources\LICENSE</License>
9+
<Icon>Resources\icon.png</Icon>
10+
<PreviewImage>Resources\preview.png</PreviewImage>
11+
<Tags>command-line, PowerShell, cmd, batch, bat, exe</Tags>
12+
</Metadata>
13+
<Installation>
14+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,17.0)" />
15+
</Installation>
16+
<Prerequisites>
17+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[15.0,)" DisplayName="Visual Studio core editor" />
18+
<Prerequisite Id="Microsoft.VisualStudio.Component.Web" Version="[15.0,)" DisplayName="Web development tools" />
19+
</Prerequisites>
20+
<Assets>
21+
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%|" />
22+
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
23+
</Assets>
2524
</PackageManifest>

0 commit comments

Comments
 (0)