Skip to content

Commit

Permalink
Drop support for VS2019 (#5444)
Browse files Browse the repository at this point in the history
Part of #5345
  • Loading branch information
ugras-ergun-sonarsource authored and pavel-mikula-sonarsource committed May 27, 2024
1 parent ecc5706 commit 03de235
Show file tree
Hide file tree
Showing 40 changed files with 89 additions and 888 deletions.
3 changes: 0 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
in devenv.exe.config that can change the version is loaded at runtime. However, this
should not cause a problem as we will end up with a compatible version.
Also, VS2019 ships with NewtonSoft v12.x i.e. we are using a newer version. This
should not cause a problem since VS can load both versions.
Finally, NewtonSoft.Json v12 has vulnerabilities reported against it which Mend
will complain about. By referencing v13.x we avoid those warnings.
Expand Down
13 changes: 0 additions & 13 deletions MarketPlaceFiles/VS2019/manifest-2019.json

This file was deleted.

153 changes: 0 additions & 153 deletions MarketPlaceFiles/VS2019/overview-2019.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SonarLint is free, open source, and available in the Visual Studio Marketplace:
* [SonarLint for Visual Studio 2019](https://marketplace.visualstudio.com/items?itemName=SonarSource.SonarLintforVisualStudio2019)
* [SonarLint for Visual Studio 2017](https://marketplace.visualstudio.com/items?itemName=SonarSource.SonarLintforVisualStudio2017)

Note: SonarLint for Visual Studio 2017 has been deprecated. New versions will not be shipped after March 1, 2022.
Note: SonarLint for Visual Studio 2017 and 2019 has been deprecated. New versions of SonarLint for Visual Studio 2017 and 2019 will not be shipped after March 1, 2022 and April 2, 2024 respectively.


## Features
Expand Down
13 changes: 6 additions & 7 deletions SonarLint.VsTargetVersion.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
==============================
When building from the VS developer command line, by default the targeted version of VS will
depend on the version of the developer command prompt
i.e. building from the VS2019 developer command prompt will build for VS2019 etc.
i.e. building from the VS2022 developer command prompt will build for VS2022 etc.
Alternatively, you can explicitly specify the version of VS to target e.g.
msbuild.exe SonarLint.VisualStudio.Integration.sln /p:VsTargetVersion=2019
msbuild.exe SonarLint.VisualStudio.Integration.sln /p:VsTargetVersion=2022
The allowed values for VsTargetVersion are 2019 and 2022.
The allowed value for VsTargetVersion is 2022.
-->

Expand All @@ -30,7 +30,6 @@

<!-- Set the VsTargetVersion based on the version of VS -->
<PropertyGroup Condition=" $(VsTargetVersion) == '' " >
<VsTargetVersion Condition="$(VisualStudioVersion)=='16.0'">2019</VsTargetVersion>
<VsTargetVersion Condition="$(VisualStudioVersion)=='17.0'">2022</VsTargetVersion>
</PropertyGroup>

Expand All @@ -40,11 +39,11 @@
<Target Name="CheckVsTargetVersionSetting" BeforeTargets="PrepareForBuild">
<Error
Condition=" $(BuildingInsideVisualStudio) != 'true' AND $(VsTargetVersion) == '' "
Text="Must set VsTargetVersion build property when building outside Visual Studio. Expected values: 2019, 2022"/>
Text="Must set VsTargetVersion build property when building outside Visual Studio. Expected values: 2022"/>

<Error
Condition=" $(VsTargetVersion) != '2019' AND $(VsTargetVersion) != '2022' "
Text="Invalid value for VsTargetVersion. Expected values: 2019, 2022. Actual value: $(VsTargetVersion)"/>
Condition="$(VsTargetVersion) != '2022' "
Text="Invalid value for VsTargetVersion. Expected values: 2022. Actual value: $(VsTargetVersion)"/>

<Message Importance="high" Text="SonarLint VsTargetVersion: $(VsTargetVersion)" />

Expand Down
21 changes: 2 additions & 19 deletions pipeline/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Dropped support for VS 2019 in https://github.com/SonarSource/sonarlint-visualstudio/pull/5444

variables:
- group: sonarsource-build-variables
- group: digicert-keylocker
Expand All @@ -20,8 +22,6 @@ jobs:
strategy:
maxParallel: 2
matrix:
2019:
vsTargetVersion: 2019
2022:
vsTargetVersion: 2022
displayName: "Build:"
Expand Down Expand Up @@ -60,16 +60,6 @@ jobs:
nugetConfigPath: nuget.config
arguments: restore -LockedMode -Verbosity detailed

- task: NuGetCommand@2
displayName: NuGet restore without LockedMode check (VS2019)
condition: and(succeeded(), ne(variables['vsTargetVersion'], '2022'))
env:
ARTIFACTORY_USER: $(ARTIFACTORY_PRIVATE_READER_USERNAME)
ARTIFACTORY_PASSWORD: $(ARTIFACTORY_PRIVATE_READER_ACCESS_TOKEN)
inputs:
solution: $(BuildParameters.solution)
selectOrConfig: config

- task: PowerShell@2
displayName: 'Read Sonar project version from the versions.props file '
inputs:
Expand Down Expand Up @@ -299,13 +289,6 @@ jobs:
SourceFolder: $(Build.SourcesDirectory)\MarketPlaceFiles\VS2022
TargetFolder: $(Build.ArtifactStagingDirectory)

- task: CopyFiles@2
displayName: 'Copy marketplace files to: $(Build.ArtifactStagingDirectory) (VS2019 only)'
condition: and(succeeded(), eq(variables['vsTargetVersion'], '2019'))
inputs:
SourceFolder: $(Build.SourcesDirectory)\MarketPlaceFiles\VS2019
TargetFolder: $(Build.ArtifactStagingDirectory)

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: vsix'
inputs:
Expand Down
2 changes: 0 additions & 2 deletions pipeline/custom/mend-only-azure-piplines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
strategy:
maxParallel: 2
matrix:
2019:
vsTargetVersion: 2019
2022:
vsTargetVersion: 2022
displayName: "Build:"
Expand Down
14 changes: 4 additions & 10 deletions src/Core/IThreadHandling.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface IThreadHandling
Task RunOnUIThreadAsync(Action op);

/// <summary>
/// Executes the operation asynchronously on the main thread. While synchronously blocking
/// Executes the operation asynchronously on the main thread. While synchronously blocking
/// synchronously the calling thread.
/// If the caller is on the main thread already then the operation is executed directly.
/// If the caller is not on the main thread then the method will switch to the main thread,
Expand Down Expand Up @@ -100,7 +100,7 @@ public interface IThreadHandling
/// </summary>
/// <remarks>Wrapper that calls <see cref="TaskScheduler.Default"/></remarks>
IAwaitableWrapper SwitchToBackgroundThread();

/// <summary>
/// Switches to the main thread
/// </summary>
Expand All @@ -114,16 +114,10 @@ public interface IAwaitableWrapper
IAwaiterWrapper GetAwaiter();
}

public interface IAwaiterWrapper :
#if VS2022
// Earlier versions of VS don't implement ICriticalNotifyCompletion
ICriticalNotifyCompletion
#else
INotifyCompletion
#endif
public interface IAwaiterWrapper : ICriticalNotifyCompletion
{
bool IsCompleted { get; }
void GetResult();

void GetResult();
}
}
2 changes: 1 addition & 1 deletion src/Core/VsVersion/IVsVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace SonarLint.VisualStudio.Core.VsVersion
public interface IVsVersion
{
/// <summary>
/// VS full product name, including edition. Example: "Visual Studio Enterprise 2019"
/// VS full product name, including edition. Example: "Visual Studio Enterprise 2022"
/// </summary>
string DisplayName { get; }

Expand Down
6 changes: 0 additions & 6 deletions src/EmbeddedVsix/EmbeddedVsix.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@
<!-- ***************************************************************** -->

<ItemGroup Label="VSSDK Build Tools">
<PackageReference Condition=" $(VsTargetVersion) != '2022' " Include="Microsoft.VSSDK.BuildTools" Version="16.8.3038" GeneratePathProperty="true">
<IncludeAssets>runtime; build; native; contentfiles; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<PackageReference Condition=" $(VsTargetVersion) == '2022' " Include="Microsoft.VSSDK.BuildTools" Version="17.0.5232" GeneratePathProperty="true">
<IncludeAssets>runtime; build; native; contentfiles; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand All @@ -88,7 +83,6 @@
<!-- Select the manifest to use -->
<!-- VS2022+ are 64bit. Earlier versions are 32bit. -->
<PropertyGroup>
<ManifestFolder>Manifests\PreVS2022\</ManifestFolder>
<ManifestFolder Condition=" $(VSTargetVersion) == '2022' ">Manifests\VS2022\</ManifestFolder>
</PropertyGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 03de235

Please sign in to comment.