Skip to content

Commit 22cf1cd

Browse files
committed
Add VSIX 2019 project.
1 parent 98943bd commit 22cf1cd

File tree

11 files changed

+299
-53
lines changed

11 files changed

+299
-53
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
/tests/NugetAuditor.Tests/bin/Debug
66
/tests/NugetAuditor.Tests/obj/Debug
7+
/tests/NugetAuditor.Tests/.vs/NugetAuditor.Tests/v16/Server/sqlite3

src/NugetAuditor/NugetAuditor.2017.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetAuditor.VSIX.2017", "N
2424
EndProject
2525
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetAuditor.Tests", "..\..\tests\NugetAuditor.Tests\NugetAuditor.Tests.csproj", "{6CCBA08E-2FCD-468E-ADD9-BF62B5DD2CD0}"
2626
EndProject
27+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NugetAuditor.VSIX.2019", "NugetAuditor.VSIX\NugetAuditor.VSIX.2019.csproj", "{2AB4AB06-EFCA-4DCC-A95B-ACDA3292EE97}"
28+
EndProject
2729
Global
2830
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2931
Debug|Any CPU = Debug|Any CPU
@@ -46,6 +48,10 @@ Global
4648
{6CCBA08E-2FCD-468E-ADD9-BF62B5DD2CD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
4749
{6CCBA08E-2FCD-468E-ADD9-BF62B5DD2CD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
4850
{6CCBA08E-2FCD-468E-ADD9-BF62B5DD2CD0}.Release|Any CPU.Build.0 = Release|Any CPU
51+
{2AB4AB06-EFCA-4DCC-A95B-ACDA3292EE97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
52+
{2AB4AB06-EFCA-4DCC-A95B-ACDA3292EE97}.Debug|Any CPU.Build.0 = Debug|Any CPU
53+
{2AB4AB06-EFCA-4DCC-A95B-ACDA3292EE97}.Release|Any CPU.ActiveCfg = Release|Any CPU
54+
{2AB4AB06-EFCA-4DCC-A95B-ACDA3292EE97}.Release|Any CPU.Build.0 = Release|Any CPU
4955
EndGlobalSection
5056
GlobalSection(SolutionProperties) = preSolution
5157
HideSolutionNode = FALSE

src/NugetAuditor/NugetAuditor.VSIX/NugetAuditManager.cs

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -654,21 +654,38 @@ private void WriteLine(string msg)
654654
}
655655
}
656656

657-
void ILogger.LogDebug(string data)
657+
void ILogger.Log(ILogMessage message)
658+
{
659+
WriteLine(message.Message);
660+
}
661+
void ILogger.Log(LogLevel level, string data)
658662
{
659663
WriteLine(data);
660664
}
661665

662-
void ILogger.LogError(string data)
666+
void ILogger.LogDebug(string data)
663667
{
664668
WriteLine(data);
665669
}
666670

667-
void ILogger.LogErrorSummary(string data)
671+
async TTasks.Task ILogger.LogAsync(ILogMessage message)
672+
{
673+
WriteLine(message.Message);
674+
await TTasks.Task.CompletedTask;
675+
}
676+
async TTasks.Task ILogger.LogAsync(LogLevel level, string data)
677+
{
678+
await TTasks.Task.CompletedTask;
679+
}
680+
681+
682+
683+
void ILogger.LogError(string data)
668684
{
669685
WriteLine(data);
670686
}
671687

688+
672689
void ILogger.LogInformation(string data)
673690
{
674691
WriteLine(data);
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
<UseCodebase>true</UseCodebase>
7+
</PropertyGroup>
8+
<PropertyGroup>
9+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
10+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
11+
<SchemaVersion>2.0</SchemaVersion>
12+
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
13+
<ProjectGuid>{2AB4AB06-EFCA-4DCC-A95B-ACDA3292EE97}</ProjectGuid>
14+
<OutputType>Library</OutputType>
15+
<AppDesignerFolder>Properties</AppDesignerFolder>
16+
<RootNamespace>NugetAuditor.VSIX</RootNamespace>
17+
<AssemblyName>NugetAuditor.VSIX</AssemblyName>
18+
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
19+
<GeneratePkgDefFile>true</GeneratePkgDefFile>
20+
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
21+
<IncludeDebugSymbolsInVSIXContainer>true</IncludeDebugSymbolsInVSIXContainer>
22+
<IncludeDebugSymbolsInLocalVSIXDeployment>true</IncludeDebugSymbolsInLocalVSIXDeployment>
23+
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
24+
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
25+
<StartAction>Program</StartAction>
26+
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
27+
<StartArguments>/rootsuffix Exp</StartArguments>
28+
</PropertyGroup>
29+
<PropertyGroup>
30+
<SignAssembly>true</SignAssembly>
31+
</PropertyGroup>
32+
<PropertyGroup>
33+
<AssemblyOriginatorKeyFile>..\NugetAuditor.snk</AssemblyOriginatorKeyFile>
34+
</PropertyGroup>
35+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
36+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
37+
<DebugSymbols>true</DebugSymbols>
38+
<DebugType>full</DebugType>
39+
<Optimize>false</Optimize>
40+
<OutputPath>bin\Debug\</OutputPath>
41+
<DefineConstants>DEBUG;TRACE</DefineConstants>
42+
<ErrorReport>prompt</ErrorReport>
43+
<WarningLevel>4</WarningLevel>
44+
</PropertyGroup>
45+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
46+
<DebugType>pdbonly</DebugType>
47+
<Optimize>true</Optimize>
48+
<OutputPath>bin\Release\</OutputPath>
49+
<DefineConstants>TRACE</DefineConstants>
50+
<ErrorReport>prompt</ErrorReport>
51+
<WarningLevel>4</WarningLevel>
52+
<Prefer32Bit>false</Prefer32Bit>
53+
</PropertyGroup>
54+
<ItemGroup>
55+
<Compile Include="..\VersionInfo.cs">
56+
<Link>Properties\VersionInfo.cs</Link>
57+
</Compile>
58+
<Compile Include="Attributes\ResourcesCategoryAttribute.cs" />
59+
<Compile Include="Attributes\ResourcesDescriptionAttribute.cs" />
60+
<Compile Include="Attributes\ResourcesDisplayNameAttribute.cs" />
61+
<Compile Include="BackgroundQueue.cs" />
62+
<Compile Include="OptionPageGrid.cs">
63+
<SubType>Component</SubType>
64+
</Compile>
65+
<Compile Include="VSAsyncPackage.cs" />
66+
<Compile Include="VsConstants.cs" />
67+
<Compile Include="VSPackage.cs" />
68+
<Compile Include="VsUtility.cs" />
69+
<Compile Include="AuditCompletedEventArgs.cs" />
70+
<Compile Include="EventSinks\SelectionEvents.cs" />
71+
<Compile Include="ExceptionHelper.cs" />
72+
<Compile Include="PackageReferenceMarker.cs" />
73+
<Compile Include="Properties\Resources.Designer.cs">
74+
<AutoGen>True</AutoGen>
75+
<DesignTime>True</DesignTime>
76+
<DependentUpon>Resources.resx</DependentUpon>
77+
</Compile>
78+
<Compile Include="Guids.cs" />
79+
<Compile Include="PkgCmdID.cs" />
80+
<Compile Include="ErrorHandler.cs" />
81+
<Compile Include="NugetAuditManager.cs" />
82+
<Compile Include="Properties\AssemblyInfo.cs" />
83+
<Compile Include="ServiceLocator.cs" />
84+
<Compile Include="VsVersionHelper.cs" />
85+
<Compile Include="VulnerabilityTask.cs" />
86+
<Compile Include="VulnerabilityTaskProvider.cs" />
87+
</ItemGroup>
88+
<ItemGroup>
89+
<None Include="..\NugetAuditor.snk">
90+
<Link>NugetAuditor.snk</Link>
91+
</None>
92+
<None Include="..\NugetAuditor.VSIX.licenseheader">
93+
<Link>NugetAuditor.VSIX.licenseheader</Link>
94+
</None>
95+
<None Include="packages.config">
96+
<SubType>Designer</SubType>
97+
</None>
98+
<None Include="source.extension.vsixmanifest">
99+
<SubType>Designer</SubType>
100+
</None>
101+
</ItemGroup>
102+
<ItemGroup>
103+
<Content Include="index.html" />
104+
<Content Include="License.txt">
105+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
106+
<IncludeInVSIX>true</IncludeInVSIX>
107+
</Content>
108+
<Content Include="Resources\logo-200x200.png">
109+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
110+
<IncludeInVSIX>true</IncludeInVSIX>
111+
</Content>
112+
<Content Include="Resources\logo-32x32.png">
113+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
114+
<IncludeInVSIX>true</IncludeInVSIX>
115+
</Content>
116+
<Content Include="Resources\Toolbar.png" />
117+
<Content Include="Resources\OSSAuditPackage.ico">
118+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
119+
<IncludeInVSIX>true</IncludeInVSIX>
120+
</Content>
121+
<Content Include="Resources\VSAsyncPackage.ico" />
122+
<Content Include="stylesheet.css" />
123+
</ItemGroup>
124+
<ItemGroup>
125+
<VSCTCompile Include="VSPackage.vsct">
126+
<ResourceName>Menus.ctmenu</ResourceName>
127+
<SubType>Designer</SubType>
128+
</VSCTCompile>
129+
</ItemGroup>
130+
<ItemGroup>
131+
<EmbeddedResource Include="Properties\Resources.resx">
132+
<Generator>ResXFileCodeGenerator</Generator>
133+
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
134+
<SubType>Designer</SubType>
135+
</EmbeddedResource>
136+
<EmbeddedResource Include="VSPackage.resx">
137+
<MergeWithCTO>true</MergeWithCTO>
138+
<ManifestResourceName>VSPackage</ManifestResourceName>
139+
<SubType>Designer</SubType>
140+
</EmbeddedResource>
141+
</ItemGroup>
142+
<ItemGroup>
143+
<Reference Include="Microsoft.CSharp" />
144+
<Reference Include="System" />
145+
<Reference Include="System.ComponentModel.Composition" />
146+
<Reference Include="System.Data" />
147+
<Reference Include="System.Design" />
148+
<Reference Include="System.Drawing" />
149+
<Reference Include="System.IO.Compression" />
150+
<Reference Include="System.Transactions" />
151+
<Reference Include="System.Windows.Forms" />
152+
<Reference Include="System.Xml" />
153+
<Reference Include="System.Xml.Linq" />
154+
<Reference Include="UIAutomationTypes" />
155+
<Reference Include="WindowsBase" />
156+
<Reference Include="PresentationCore" />
157+
<Reference Include="PresentationFramework" />
158+
</ItemGroup>
159+
<ItemGroup>
160+
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="16.0.200" ExcludeAssets="runtime" />
161+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.2.3073" />
162+
<PackageReference Include="NuGet.Common">
163+
<Version>5.2.0</Version>
164+
</PackageReference>
165+
<PackageReference Include="NuGet.VisualStudio">
166+
<Version>5.2.0</Version>
167+
</PackageReference>
168+
</ItemGroup>
169+
<ItemGroup>
170+
<ProjectReference Include="..\NugetAuditor.Lib\NugetAuditor.Lib.csproj">
171+
<Project>{b7b53c9b-aab6-496c-92fa-5e315a71753b}</Project>
172+
<Name>NugetAuditor.Lib</Name>
173+
</ProjectReference>
174+
</ItemGroup>
175+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
176+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
177+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
178+
Other similar extension points exist, see Microsoft.Common.targets.
179+
<Target Name="BeforeBuild">
180+
</Target>
181+
<Target Name="AfterBuild">
182+
</Target>
183+
-->
184+
</Project>
Binary file not shown.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
using System;
2+
using System.ComponentModel.Design;
3+
using System.Diagnostics;
4+
using System.Diagnostics.CodeAnalysis;
5+
using System.Globalization;
6+
using System.Runtime.InteropServices;
7+
using System.Threading;
8+
using System.Threading.Tasks;
9+
using Microsoft.VisualStudio;
10+
using Microsoft.VisualStudio.OLE.Interop;
11+
using Microsoft.VisualStudio.Shell;
12+
using Microsoft.VisualStudio.Shell.Interop;
13+
using Microsoft.Win32;
14+
using Task = System.Threading.Tasks.Task;
15+
16+
namespace NugetAuditor.VSIX
17+
{
18+
/// <summary>
19+
/// This is the class that implements the package exposed by this assembly.
20+
/// </summary>
21+
/// <remarks>
22+
/// <para>
23+
/// The minimum requirement for a class to be considered a valid package for Visual Studio
24+
/// is to implement the IVsPackage interface and register itself with the shell.
25+
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
26+
/// to do it: it derives from the Package class that provides the implementation of the
27+
/// IVsPackage interface and uses the registration attributes defined in the framework to
28+
/// register itself and its components with the shell. These attributes tell the pkgdef creation
29+
/// utility what data to put into .pkgdef file.
30+
/// </para>
31+
/// <para>
32+
/// To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
33+
/// </para>
34+
/// </remarks>
35+
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
36+
[InstalledProductRegistration("#1110", "#1112", "1.0", IconResourceID = 1400)] // Info on this package for Help/About
37+
[ProvideAutoLoad(UIContextGuids.SolutionExists)]
38+
[Guid(GuidList.guidAuditPkgString)]
39+
[ProvideMenuResource("Menus.ctmenu", 1)]
40+
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
41+
public sealed class VSAsyncPackage : AsyncPackage
42+
{
43+
/// <summary>
44+
/// VSAsyncPackage GUID string.
45+
/// </summary>
46+
public const string PackageGuidString = "fb07f0be-0a8f-4a5a-8d84-9a139da91599";
47+
48+
/// <summary>
49+
/// Initializes a new instance of the <see cref="VSAsyncPackage"/> class.
50+
/// </summary>
51+
public VSAsyncPackage()
52+
{
53+
// Inside this method you can place any initialization code that does not require
54+
// any Visual Studio service because at this point the package object is created but
55+
// not sited yet inside Visual Studio environment. The place to do all the other
56+
// initialization is the Initialize method.
57+
int j = 0;
58+
}
59+
60+
#region Package Members
61+
62+
/// <summary>
63+
/// Initialization of the package; this method is called right after the package is sited, so this is the place
64+
/// where you can put all the initialization code that rely on services provided by VisualStudio.
65+
/// </summary>
66+
/// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
67+
/// <param name="progress">A provider for progress updates.</param>
68+
/// <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
69+
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
70+
{
71+
// When initialized asynchronously, the current thread may be a background thread at this point.
72+
// Do any initialization that requires the UI thread after switching to the UI thread.
73+
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
74+
}
75+
76+
#endregion
77+
}
78+
}

src/NugetAuditor/NugetAuditor.VSIX/VSPackage.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ namespace NugetAuditor.VSIX
5555
/// To get loaded into VS, the package must be referred by &lt;Asset Type="Microsoft.VisualStudio.VsPackage" ...&gt; in .vsixmanifest file.
5656
/// </para>
5757
/// </remarks>
58-
[PackageRegistration(UseManagedResourcesOnly = true)]
59-
[InstalledProductRegistration("#110", "#112", "1.1", IconResourceID = 400)] // Info on this package for Help/About
60-
[Guid(GuidList.guidAuditPkgString)]
61-
[ProvideAutoLoad(UIContextGuids.SolutionExists)]
62-
[ProvideMenuResource("Menus.ctmenu", 1)]
63-
[ProvideOptionPage(typeof(OptionPageGrid), "Audit.Net", "Options", 0, 0, true)]
64-
[SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")]
6558
public sealed class VSPackage : Package, IDisposable
6659
{
6760

src/NugetAuditor/NugetAuditor.VSIX/VSPackage.resx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,13 @@
127127
<data name="400" type="System.Resources.ResXFileRef, System.Windows.Forms">
128128
<value>Resources\OSSAuditPackage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
129129
</data>
130+
<data name="1110" xml:space="preserve">
131+
<value>VSAsyncPackage Extension</value>
132+
</data>
133+
<data name="1112" xml:space="preserve">
134+
<value>VSAsyncPackage Visual Stuido Extension Detailed Info</value>
135+
</data>
136+
<data name="1400" type="System.Resources.ResXFileRef, System.Windows.Forms">
137+
<value>Resources\VSAsyncPackage.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
138+
</data>
130139
</root>

0 commit comments

Comments
 (0)