Skip to content

Commit

Permalink
Use .NET 8 assemblies for SDK (#534)
Browse files Browse the repository at this point in the history
* Use .NET 6 assemblies

* Update to .NET 8

* Fix build error

* Empty commit to retrigger checks
  • Loading branch information
zijchen authored Dec 9, 2024
1 parent 0dc963b commit 8b93df3
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 23 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>netstandard2.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PackageType>Template</PackageType>
<PackageId>Microsoft.Build.Sql.Templates</PackageId>
<Title>Microsoft.Build.Sql templates</Title>
Expand Down
20 changes: 10 additions & 10 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>netstandard2.1</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\netstandard2.1\</BuildBinariesPath>
<BuildBinariesPath>$(MSBuildThisFileDirectory)\tools\net8.0\</BuildBinariesPath>
</PropertyGroup>

<ItemGroup>
Expand All @@ -17,22 +17,22 @@
<PackageReference Include="Microsoft.SqlServer.Server" Version="1.0.0" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.SqlServer.TransactSql.ScriptDom" Version="$(ScriptDomPackageVersion)" GeneratePathProperty="true" />
<PackageReference Include="Microsoft.SqlServer.Types" Version="160.1000.6" GeneratePathProperty="true" />
<PackageReference Include="System.ComponentModel.Composition" Version="6.0.0" GeneratePathProperty="true" />
<PackageReference Include="System.ComponentModel.Composition" Version="8.0.0" GeneratePathProperty="true" />
<PackageReference Include="System.IO.Packaging" Version="8.0.1" GeneratePathProperty="true" />
</ItemGroup>

<Target Name="CopyBuildBinaries" BeforeTargets="Build">
<Message Text="Using DacFx version '$(DacFxPackageVersion)'" Importance="high" />
<ItemGroup>
<PackageFiles Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\netstandard2.1\*.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\netstandard2.1\**\*.resources.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_DacFx)\lib\netstandard2.1\*.targets" />
<PackageFiles Include="$(PkgMicrosoft_Data_SqlClient)\lib\netstandard2.1\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_SqlServer_DacFx)\lib\net8.0\**\*.resources.dll" />
<PackageFiles Include="$(PkgMicrosoft_Data_SqlClient)\lib\net6.0\Microsoft.Data.SqlClient.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_Server)\lib\netstandard2.0\Microsoft.SqlServer.Server.dll" />
<PackageFiles Include="$(PkgMicrosoft_SqlServer_TransactSql_ScriptDom)\lib\netstandard2.1\Microsoft.SqlServer.TransactSql.ScriptDom.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\netcoreapp3.1\System.ComponentModel.Composition.dll" />
<PackageFiles Include="$(PkgSystem_IO_Packaging)\lib\netstandard2.0\System.IO.Packaging.dll" />
<PackageFiles Include="$(PkgSystem_ComponentModel_Composition)\lib\net8.0\System.ComponentModel.Composition.dll" />
<PackageFiles Include="$(PkgSystem_IO_Packaging)\lib\net8.0\System.IO.Packaging.dll" />
</ItemGroup>
<Copy SourceFiles="@(PackageFiles)" DestinationFolder="$(BuildBinariesPath)\%(PackageFiles.RecursiveDir)" />
</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\netstandard2.1</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/netstandard2.1/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 8b93df3

Please sign in to comment.