Skip to content

Commit d45430a

Browse files
committed
Update vsix project to SDK-style format
1 parent eb92d1c commit d45430a

File tree

1 file changed

+33
-57
lines changed

1 file changed

+33
-57
lines changed
Lines changed: 33 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project>
2+
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.props" />
3+
34
<PropertyGroup>
4-
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
5-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6-
</PropertyGroup>
7-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
8-
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
9-
<PropertyGroup>
10-
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
11-
<Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
12-
<PlatformTarget>AnyCPU</PlatformTarget>
13-
<SchemaVersion>2.0</SchemaVersion>
14-
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
15-
<ProjectGuid>{CBD344C6-15E1-4337-AC0A-49E72D7B31C2}</ProjectGuid>
16-
<OutputType>Library</OutputType>
17-
<AppDesignerFolder>Properties</AppDesignerFolder>
5+
<TargetFramework>net472</TargetFramework>
186
<RootNamespace>CSharpGuidelinesAnalyzer</RootNamespace>
197
<AssemblyName>CSharpGuidelinesAnalyzer</AssemblyName>
20-
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
8+
</PropertyGroup>
9+
10+
<PropertyGroup>
2111
<GeneratePkgDefFile>false</GeneratePkgDefFile>
2212
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
2313
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
@@ -26,51 +16,45 @@
2616
<CopyOutputSymbolsToOutputDirectory>false</CopyOutputSymbolsToOutputDirectory>
2717
<VSSDKTargetPlatformRegRootSuffix>Roslyn</VSSDKTargetPlatformRegRootSuffix>
2818
</PropertyGroup>
19+
2920
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
3021
<!-- This property disables extension deployment for command line builds; required for AppVeyor -->
3122
<DeployExtension>False</DeployExtension>
3223
</PropertyGroup>
33-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
34-
<DebugSymbols>true</DebugSymbols>
35-
<DebugType>full</DebugType>
36-
<Optimize>false</Optimize>
37-
<OutputPath>bin\Debug\</OutputPath>
38-
<DefineConstants>DEBUG;TRACE</DefineConstants>
39-
<ErrorReport>prompt</ErrorReport>
40-
<WarningLevel>4</WarningLevel>
41-
</PropertyGroup>
42-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
43-
<DebugType>pdbonly</DebugType>
44-
<Optimize>true</Optimize>
45-
<OutputPath>bin\Release\</OutputPath>
46-
<DefineConstants>TRACE</DefineConstants>
47-
<ErrorReport>prompt</ErrorReport>
48-
<WarningLevel>4</WarningLevel>
49-
</PropertyGroup>
24+
25+
<ItemGroup>
26+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.1.4057" PrivateAssets="all" />
27+
</ItemGroup>
28+
5029
<PropertyGroup>
5130
<StartAction>Program</StartAction>
5231
<StartProgram>$(DevEnvDir)devenv.exe</StartProgram>
53-
<StartArguments>/rootsuffix Roslyn</StartArguments>
32+
<StartArguments>/rootsuffix $(VSSDKTargetPlatformRegRootSuffix)</StartArguments>
5433
</PropertyGroup>
55-
<ItemGroup>
56-
<None Include="source.extension.vsixmanifest">
57-
<SubType>Designer</SubType>
58-
</None>
59-
</ItemGroup>
60-
<ItemGroup>
61-
<ProjectReference Include="..\CSharpGuidelinesAnalyzer\CSharpGuidelinesAnalyzer.csproj">
62-
<Project>{560612BD-75DC-40B3-A070-A913B925B60F}</Project>
63-
<Name>CSharpGuidelinesAnalyzer</Name>
64-
</ProjectReference>
65-
</ItemGroup>
34+
35+
<Import Sdk="Microsoft.NET.Sdk" Project="Sdk.targets" />
36+
37+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="Exists('$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets')" />
38+
6639
<ItemGroup>
6740
<Content Include="..\..\..\LICENSE.txt">
6841
<Link>LICENSE.txt</Link>
6942
<IncludeInVSIX>true</IncludeInVSIX>
7043
</Content>
7144
</ItemGroup>
72-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
73-
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
45+
46+
<ItemGroup>
47+
<ProjectReference Include="..\CSharpGuidelinesAnalyzer\CSharpGuidelinesAnalyzer.csproj" />
48+
</ItemGroup>
49+
50+
<ItemGroup>
51+
<!-- https://github.com/dotnet/sdk/issues/433 -->
52+
<ProjectReference Update="@(ProjectReference)" AdditionalProperties="TargetFramework=netstandard1.3" />
53+
54+
<!-- https://github.com/Microsoft/extendvs/issues/57 -->
55+
<ProjectReference Update="@(ProjectReference)" Name="%(Filename)" />
56+
</ItemGroup>
57+
7458
<Target Name="GetVsixPackageVersion" Outputs="$(VsixPackageVersion)">
7559
<GetAssemblyIdentity AssemblyFiles="$(ProjectDir)$(OutDir)CSharpGuidelinesAnalyzer.dll">
7660
<Output TaskParameter="Assemblies" ItemName="assemblyVersionInfo" />
@@ -81,13 +65,5 @@
8165
<VsixPackageVersion>$([System.Text.RegularExpressions.Regex]::Match($(In), $(Pattern)))</VsixPackageVersion>
8266
</PropertyGroup>
8367
</Target>
84-
<Target Name="ExcludeFilesFromVSIX" BeforeTargets="CreateVsixContainer" AfterTargets="GetVsixSourceItems">
85-
<ItemGroup>
86-
<VsixSourceItem Remove="$(SolutionDir)CSharpGuidelinesAnalyzer\CSharpGuidelinesAnalyzer\tools\install.ps1" />
87-
<VsixSourceItem Remove="$(SolutionDir)CSharpGuidelinesAnalyzer\CSharpGuidelinesAnalyzer\tools\uninstall.ps1" />
88-
</ItemGroup>
89-
<!--
90-
<Message Text="VsixSourceItem collection now contains: @(VsixSourceItem)" Importance="High" />
91-
-->
92-
</Target>
68+
9369
</Project>

0 commit comments

Comments
 (0)