Skip to content

Commit

Permalink
Change netcore tfm to net8.0 for C# dev kit (dotnet#9406)
Browse files Browse the repository at this point in the history
  • Loading branch information
smitpatel authored Feb 26, 2024
1 parent 5dd937b commit a944c3f
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,6 @@ dotnet_diagnostic.CA1307.severity = suggestion # Specify StringComparison

# NETCOREUNDONE: Should be removed when obsolete System.Xaml types are moved from Microsoft.VisualStudio.ProjectSystem.XamlTypes into official package
# Disabling warning for C# files generated from xaml rules
[artifacts/*/obj/Microsoft.VisualStudio.ProjectSystem.Managed/net7.0/*.cs]
[artifacts/*/obj/Microsoft.VisualStudio.ProjectSystem.Managed/net8.0/*.cs]
# CS0618: Type or member is obsolete
dotnet_diagnostic.CS0618.severity = silent
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<PropertyGroup>
<MinimumVisualStudioVersion>17.0</MinimumVisualStudioVersion>
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
<NetCoreTargetFramework>net8.0</NetCoreTargetFramework>
<!--
IMPORTANT: The reason we use 99.0.0 is because we need a version number that will always be above the published version of the assemblies/packages.
This causes VS to always prefer our locally build packages for debugging (F5) purposes.
Expand Down
2 changes: 1 addition & 1 deletion eng/imports/HostAgnostic.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<!-- CPS -->
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.Sdk.Tools" PrivateAssets="all" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.XamlTypes" Condition="'$(TargetFramework)' == 'net7.0'" />
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.XamlTypes" Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'" />
<PackageReference Include="Microsoft.VisualStudio.Threading" />
<PackageReference Include="Microsoft.VisualStudio.Validation" />
<PackageReference Include="System.Threading.Tasks.Dataflow" />
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/templates/build-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
inputs:
packageType: runtime
# This should match the target of our unit test projects.
version: 7.0.x
version: 8.0.x

# Allows for accessing the internal AzDO feed (vs-impl-internal) for project restore via Azure Artifacts Credential Provider.
# See: https://github.com/microsoft/artifacts-credprovider#automatic-usage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- The value of RuleInjectionClassName of XamlPropertyRule items defined by this project -->
<XamlPropertyRuleInjectionClassName>ProjectProperties</XamlPropertyRuleInjectionClassName>
<IsManagedProjectSystemProject>true</IsManagedProjectSystemProject>
<TargetFrameworks>net472;net7.0</TargetFrameworks>
<TargetFrameworks>net472;$(NetCoreTargetFramework)</TargetFrameworks>

<!-- Nuget -->
<IsPackable>true</IsPackable>
Expand All @@ -18,15 +18,15 @@
<NoWarn>$(NoWarn);NU5125</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PropertyGroup Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'">
<!-- Sets the DependsOn for NPM packaging. We use the designated target to select the files to pack. -->
<!-- See: https://dev.azure.com/devdiv/DevDiv/_git/vs-green?path=/components&anchor=packaging-components -->
<StageForNpmPackDependsOn>$(StageForNpmPackDependsOn);AddFilesForNpmPackage</StageForNpmPackDependsOn>
<NpmPackageOutputPath>$(PackageOutputPath)</NpmPackageOutputPath>
</PropertyGroup>

<!-- TODO: Re-enable nullability and clean up warnings. -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PropertyGroup Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'">
<Nullable>annotations</Nullable>
<NoWarn>$(NoWarn);RS0037</NoWarn>
</PropertyGroup>
Expand Down Expand Up @@ -55,7 +55,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.Common" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'">
<!-- Package for creating an NPM package during build. -->
<!-- See: https://dev.azure.com/devdiv/DevDiv/_git/vs-green?path=/components&anchor=packaging-components -->
<PackageReference Include="Microsoft.VisualStudio.Internal.MicroBuild.NpmPack" PrivateAssets="all" />
Expand Down Expand Up @@ -641,9 +641,9 @@
<AdditionalFiles Include="PublicAPI\net472\*.txt" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<None Remove="PublicAPI\net7.0\*.txt" />
<AdditionalFiles Include="PublicAPI\net7.0\*.txt" />
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'">
<None Remove="PublicAPI\$(NetCoreTargetFramework)\*.txt" />
<AdditionalFiles Include="PublicAPI\$(NetCoreTargetFramework)\*.txt" />
</ItemGroup>

<ItemGroup>
Expand All @@ -652,7 +652,7 @@
</None>
</ItemGroup>

<Target Name="AddFilesForNpmPackage" DependsOnTargets="Build;SatelliteDllsProjectOutputGroup" Condition="'$(TargetFramework)' == 'net7.0'">
<Target Name="AddFilesForNpmPackage" DependsOnTargets="Build;SatelliteDllsProjectOutputGroup" Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'">
<ItemGroup>
<NpmContent Include="exports.json" />
<!-- We have a runtime dependency on Microsoft.CodeAnalysis.dll in VS Code scenarios. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks>net472;net7.0</TargetFrameworks>
<TargetFrameworks>net472;$(NetCoreTargetFramework)</TargetFrameworks>
</PropertyGroup>

<!-- TODO: Re-enable nullability and clean up warnings. -->
<PropertyGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PropertyGroup Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'">
<Nullable>annotations</Nullable>
<NoWarn>$(NoWarn);RS0037</NoWarn>
</PropertyGroup>

<!-- TODO: Remove this once ImageMoniker and related types are available in a net7.0-compatible package. -->
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<!-- TODO: Remove this once ImageMoniker and related types are available in a net8.0-compatible package. -->
<ItemGroup Condition="'$(TargetFramework)' == '$(NetCoreTargetFramework)'">
<!--<PackageReference Remove="Microsoft.VisualStudio.SDK.EmbedInteropTypes" />
<PackageReference Remove="Microsoft.VisualStudio.ImageCatalog" />-->

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE.md file in the project root for more information.

// The NPM package is only relevant to the net7.0 build.
// The NPM package is only relevant to the net8.0 build.
#if NETCOREAPP

using Microsoft.VisualStudio.Utilities;
Expand Down Expand Up @@ -36,7 +36,7 @@ private static IEnumerable<string> GetNpmPackageContents()
config,
"obj",
"Microsoft.VisualStudio.ProjectSystem.Managed",
"net7.0",
"net8.0",
"npmsrc");

return Directory.EnumerateFiles(packagesDirectory, "*", SearchOption.AllDirectories)
Expand Down

0 comments on commit a944c3f

Please sign in to comment.