Skip to content

Commit a17d804

Browse files
authored
Merge pull request #2485 from sharwell/vs2017
Upgrade solution for ongoing development in Visual Studio 2017
2 parents 0381278 + 763fd81 commit a17d804

9 files changed

Lines changed: 28 additions & 23 deletions

File tree

CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,4 @@ You can also help by filing issues, participating in discussions and doing code
2626

2727
## Building
2828

29-
Visual Studio 2015 RC is required for building this repository.
30-
The Visual Studio 2015 RC SDK is required for building the vsix extension project and for
31-
debugging in an experimental visual studio hive.
29+
Visual Studio 2017 (Community Edition or higher) is required for building this repository.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ The preferable way to use the analyzers is to add the nuget package [StyleCop.An
1414
to the project where you want to enforce StyleCop rules.
1515

1616
The severity of individual rules may be configured using [rule set files](https://msdn.microsoft.com/en-us/library/dd264996.aspx)
17-
in Visual Studio 2015. **Settings.StyleCop** is not supported, but a **stylecop.json** file may be used to customize the
18-
behavior of certain rules. See [Configuration.md](documentation/Configuration.md) for more information.
17+
in Visual Studio 2015 or newer. **Settings.StyleCop** is not supported, but a **stylecop.json** file may be used to
18+
customize the behavior of certain rules. See [Configuration.md](documentation/Configuration.md) for more information.
1919

2020
For users upgrading from StyleCop Classic, see [KnownChanges.md](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master/documentation/KnownChanges.md)
2121
for information about known differences which you may notice when switching to StyleCop Analyzers.
@@ -34,7 +34,7 @@ Install-Package StyleCop.Analyzers
3434

3535
## Team Considerations
3636

37-
If you use older versions of Visual Studio in addition to Visual Studio 2015, you may still install these analyzers. They will be automatically disabled when you open the project back up in Visual Studio 2013 or earlier.
37+
If you use older versions of Visual Studio in addition to Visual Studio 2015 or Visual Studio 2017, you may still install these analyzers. They will be automatically disabled when you open the project back up in Visual Studio 2013 or earlier.
3838

3939
## Contributing
4040

StyleCop.Analyzers/StyleCop.Analyzers.Vsix/StyleCop.Analyzers.Vsix.csproj

Lines changed: 12 additions & 3 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.15.1.192\build\Microsoft.VSSDK.BuildTools.props" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" />
34
<PropertyGroup>
4-
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
5-
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
5+
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
66
</PropertyGroup>
77
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
88
<PropertyGroup>
@@ -65,6 +65,7 @@
6565
<None Include="..\StyleCop.Analyzers.ruleset">
6666
<Link>StyleCop.Analyzers.ruleset</Link>
6767
</None>
68+
<None Include="packages.config" />
6869
<None Include="source.extension.vsixmanifest">
6970
<SubType>Designer</SubType>
7071
</None>
@@ -80,7 +81,15 @@
8081
</ProjectReference>
8182
</ItemGroup>
8283
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
83-
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
84+
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="Exists('$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets')" />
85+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
86+
<PropertyGroup>
87+
<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>
88+
</PropertyGroup>
89+
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.props'))" />
90+
<Error Condition="!Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets'))" />
91+
</Target>
92+
<Import Project="..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets" Condition="Exists('..\..\packages\Microsoft.VSSDK.BuildTools.15.1.192\build\Microsoft.VSSDK.BuildTools.targets')" />
8493
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
8594
Other similar extension points exist, see Microsoft.Common.targets.
8695
<Target Name="BeforeBuild">
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="Microsoft.VSSDK.BuildTools" version="15.1.192" targetFramework="net45" developmentDependency="true" />
4+
</packages>

StyleCop.Analyzers/StyleCop.Analyzers.Vsix/source.extension.vsixmanifest

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
<Description xml:space="preserve">An implementation of StyleCop's rules using Roslyn analyzers and code fixes</Description>
77
</Metadata>
88
<Installation>
9-
<InstallationTarget Version="[14.0,]" Id="Microsoft.VisualStudio.Pro" />
10-
<InstallationTarget Version="[14.0,]" Id="Microsoft.VisualStudio.VSWinDesktopExpress" />
11-
<InstallationTarget Version="[14.0,]" Id="Microsoft.VisualStudio.VWDExpress" />
12-
<InstallationTarget Version="[14.0,]" Id="Microsoft.VisualStudio.VSWinExpress" />
9+
<InstallationTarget Version="[14.0,]" Id="Microsoft.VisualStudio.Community" />
1310
</Installation>
14-
<Dependencies>
15-
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="4.5" />
16-
</Dependencies>
11+
<Prerequisites>
12+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[14.0,16.0)" DisplayName="Visual Studio core editor" />
13+
<Prerequisite Id="Microsoft.VisualStudio.Component.Roslyn.LanguageServices" Version="[14.0,16.0)" DisplayName="Roslyn Language Services" />
14+
</Prerequisites>
1715
<Assets>
1816
<Asset Type="Microsoft.VisualStudio.MefComponent" d:Source="Project" d:ProjectName="StyleCop.Analyzers" Path="|StyleCop.Analyzers|"/>
1917
<Asset Type="Microsoft.VisualStudio.Analyzer" d:Source="Project" d:ProjectName="StyleCop.Analyzers" Path="|StyleCop.Analyzers|"/>

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/ElementDocumentationSummaryBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ namespace StyleCop.Analyzers.DocumentationRules
1818
/// </summary>
1919
internal abstract class ElementDocumentationSummaryBase : DiagnosticAnalyzer
2020
{
21-
private readonly Action<CompilationStartAnalysisContext> compilationStartAction;
2221
private readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> typeDeclarationAction;
2322
private readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> methodDeclarationAction;
2423
private readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> constructorDeclarationAction;

StyleCop.Analyzers/StyleCop.Analyzers/DocumentationRules/PartialElementDocumentationSummaryBase.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ internal abstract class PartialElementDocumentationSummaryBase : DiagnosticAnaly
2323
{
2424
private static readonly XElement EmptyElement = new XElement("empty");
2525

26-
private readonly Action<CompilationStartAnalysisContext> compilationStartAction;
2726
private readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> typeDeclarationAction;
2827
private readonly Action<SyntaxNodeAnalysisContext, StyleCopSettings> methodDeclarationAction;
2928

StyleCopAnalyzers.sln

Lines changed: 2 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.25420.1
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26430.14
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StyleCop.Analyzers", "StyleCop.Analyzers\StyleCop.Analyzers\StyleCop.Analyzers.csproj", "{3B052737-06CE-4182-AE0F-08EB82DFA73E}"
77
EndProject

appveyor.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
version: 1.0.{build}
2-
os: Visual Studio 2015
2+
image: Visual Studio 2017
33
init:
44
- git config --global core.autocrlf true
5-
install:
6-
- set PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH%
75
before_build:
86
- nuget restore
97
build:

0 commit comments

Comments
 (0)