Skip to content

Commit

Permalink
Update to .NET 8
Browse files Browse the repository at this point in the history
  • Loading branch information
zijchen committed Dec 3, 2024
1 parent 031ad4f commit 8212977
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 19 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
targetFramework: [net6.0, net7.0, net8.0, net9.0]
targetFramework: [net8.0, net9.0]
include:
- targetFramework: net6.0
dotnetVersion: 6.x
- targetFramework: net7.0
dotnetVersion: 7.x
- targetFramework: net8.0
dotnetVersion: 8.x
- targetFramework: net9.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PackageType>Template</PackageType>
<PackageId>Microsoft.Build.Sql.Templates</PackageId>
<Title>Microsoft.Build.Sql templates</Title>
Expand Down
12 changes: 6 additions & 6 deletions src/Microsoft.Build.Sql/Microsoft.Build.Sql.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<NuspecFile>$(MSBuildThisFileDirectory)Microsoft.Build.Sql.nuspec</NuspecFile>
<PackageType>MSBuildSDK</PackageType>
<IncludeBuildOutput>false</IncludeBuildOutput>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>

<!-- Path where all the DLLs build depends on will be copied to -->
<BuildBinariesPath>$(MSBuildThisFileDirectory)\tools\net6.0\</BuildBinariesPath>
<BuildBinariesPath>$(MSBuildThisFileDirectory)\tools\net8.0\</BuildBinariesPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,14 +24,14 @@
<Target Name="CopyBuildBinaries" BeforeTargets="Build">
<Message Text="Using DacFx version '$(DacFxPackageVersion)'" Importance="high" />
<ItemGroup>
<PackageFiles Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net6.0\*.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net6.0\*.targets" />
<PackageFiles Include="$(PkgMicrosoft_Data_SqlClient)\lib\net6.0\Microsoft.Data.SqlClient.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net8.0\*.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\net8.0\*.targets" />
<PackageFiles Include="$(PkgMicrosoft_Data_SqlClient)\lib\net8.0\Microsoft.Data.SqlClient.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_Server)\lib\netstandard2.0\Microsoft.SqlServer.Server.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_TransactSql_ScriptDom)\lib\net6.0\Microsoft.SqlServer.TransactSql.ScriptDom.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_Types)\lib\netstandard2.1\Microsoft.SqlServer.Types.dll" />
<PackageFiles Include="$(PkgSystem_ComponentModel_Composition)\lib\net6.0\System.ComponentModel.Composition.dll" />
<PackageFiles Include="$(PkgSystem_IO_Packaging)\lib\net6.0\System.IO.Packaging.dll" />
<PackageFiles Include="$(PkgSystem_IO_Packaging)\lib\net8.0\System.IO.Packaging.dll" />
</ItemGroup>
<Copy SourceFiles="@(PackageFiles)" DestinationFolder="$(BuildBinariesPath)" />
</Target>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Build.Sql/sdk/Sdk.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<PropertyGroup>
<NetCoreBuild Condition="'$(NetCoreBuild)' == '' And '$(MSBuildRuntimeType)' == 'Core'">true</NetCoreBuild>
<NetCoreBuild Condition="'$(NetCoreBuild)' == '' And '$(MSBuildRuntimeType)' == 'Full'">false</NetCoreBuild>
<NETCoreTargetsPath Condition="$(NETCoreTargetsPath) == ''">$(MSBuildThisFileDirectory)..\tools\net6.0</NETCoreTargetsPath>
<NETCoreTargetsPath Condition="$(NETCoreTargetsPath) == ''">$(MSBuildThisFileDirectory)..\tools\net8.0</NETCoreTargetsPath>
<TargetFramework Condition="'$(TargetFramework)' == '' AND '$(NetCoreBuild)' == 'true'">netstandard2.1</TargetFramework>
<!-- Allow packages of all target frameworks to be referenced by the sqlproj -->
<PackageTargetFallback Condition="'$(PackageTargetFallback)' == ''">@(SupportedTargetFramework->'%(Alias)')</PackageTargetFallback>
Expand Down
2 changes: 1 addition & 1 deletion src/Microsoft.Build.Sql/sdk/Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
-->
<Target Name="CoreCompile" />

<Import Condition="'$(NetCoreBuild)' == 'true'" Project="$(MSBuildThisFileDirectory)../tools/net6.0/Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
<Import Condition="'$(NetCoreBuild)' == 'true'" Project="$(MSBuildThisFileDirectory)../tools/net8.0/Microsoft.Data.Tools.Schema.SqlTasks.targets"/>
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' != ''" Project="$(SQLDBExtensionsRefPath)\Microsoft.Data.Tools.Schema.SqlTasks.targets" />
<Import Condition="'$(NetCoreBuild)' != 'true' AND '$(SQLDBExtensionsRefPath)' == ''" Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets" />

Expand Down
4 changes: 0 additions & 4 deletions test/Microsoft.Build.Sql.Tests/BuildTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,8 @@ public void VerifyBuildWithTransitiveProjectReferences()
[TestCase("netcoreapp3.1")]
[TestCase("net5.0")]
[TestCase("net6.0")]
#if NET7_0_OR_GREATER
[TestCase("net7.0")]
#endif
#if NET8_0_OR_GREATER
[TestCase("net8.0")]
#endif
#if NET9_0_OR_GREATER
[TestCase("net9.0")]
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<!-- Multi-targeting to test SDK on different .NET versions, requires all of the following SDKs to be installed. -->
<!-- To build and test only one version, add -f to dotnet command. -->
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<!-- Disable EOL target framework check since we're explicitly testing against older .NET versions. -->
<CheckEolTargetFramework>false</CheckEolTargetFramework>
Expand Down

0 comments on commit 8212977

Please sign in to comment.