Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nuspec for the Microsoft.Data.SqlClient version, separate build outpu…
…t folders, adjust build script NuGet target to handle both packages
  • Loading branch information
smoothdeveloper committed May 6, 2026
commit 9f4cc5a4c474bb43d14cef19c5daf1ed1ef19d00
34 changes: 18 additions & 16 deletions build/build.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
testProjectsSlnPath = makeRootPath "TestProjects.sln"
testSlnPath = makeRootPath "Tests.sln"
testProjectPath = makeRootPath "tests/SqlClient.Tests/SqlClient.Tests.fsproj"

nugetSpec = "nuget/SqlClient.nuspec"
|}
let microsoftSqlProject = {|
runtime = "FSharp.Data.MicrosoftSqlClient"
Expand All @@ -43,6 +43,7 @@
testProjectsSlnPath = makeRootPath "MicrosoftTestProjects.sln"
testSlnPath = makeRootPath "MicrosoftTests.sln"
testProjectPath = makeRootPath "tests/SqlClient.Tests/MicrosoftSqlClient.Tests.fsproj"
nugetSpec = "nuget/MicrosoftSqlClient.nuspec"
|}

let projects = [systemSqlProject;microsoftSqlProject]
Expand Down Expand Up @@ -228,12 +229,12 @@
.ConnectionString <- gitHubActionSqlConnectionString
testConfigFile.Save()
gitHubActionSqlConnectionString
SqlConnectionStringBuilder connStr

Check warning on line 232 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.
testConnStr <- Some connStr
database <- Some connStr.InitialCatalog

Check warning on line 234 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.
conn <-
connStr.InitialCatalog <- ""

Check warning on line 236 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.
let cnx = new SqlConnection(string connStr)

Check warning on line 237 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.

Check warning on line 237 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.
cnx.Open()
Some cnx
)
Expand All @@ -245,7 +246,7 @@
//attach
let dbIsMissing =
let query = sprintf "SELECT COUNT(*) FROM sys.databases WHERE name = '%s'" database.Value
use cmd = new SqlCommand(query, conn.Value)

Check warning on line 249 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.

Check warning on line 249 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.
cmd.ExecuteScalar() = box 0

if dbIsMissing then
Expand All @@ -258,13 +259,13 @@
ZipFile.ExtractToDirectory(testsSourceRoot @@ (dataFileName + ".zip"), testsSourceRoot)

let dataPath =
use cmd = new SqlCommand("SELECT SERVERPROPERTY('InstanceDefaultDataPath')", conn.Value)

Check warning on line 262 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.

Check warning on line 262 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.
cmd.ExecuteScalar() |> string
do
let destFileName = dataPath @@ Path.GetFileName(sourceMdf)
File.Copy(sourceMdf, destFileName, overwrite = true)
File.Delete( sourceMdf)
use cmd = conn.Value.CreateCommand(CommandText = sprintf "CREATE DATABASE [%s] ON ( FILENAME = N'%s' ) FOR ATTACH" database.Value destFileName)

Check warning on line 268 in build/build.fs

View workflow job for this annotation

GitHub Actions / build

This construct is deprecated. Use the Microsoft.Data.SqlClient package instead.
cmd.ExecuteNonQuery() |> ignore
)
}
Expand Down Expand Up @@ -351,21 +352,22 @@
let description = description.Replace("\r", "").Replace("\n", "").Replace(" ", " ")
let nugetPath = "packages/build/NuGet.CommandLine/tools/NuGet.exe"

Fake.DotNet.NuGet.NuGet.NuGet (fun p ->
{ p with
Authors = authors
Project = systemSqlProject.runtime
Summary = summary
Description = description
Version = version
ReleaseNotes = releaseNotes
Tags = tags
OutputPath = "nuget"
ToolPath = nugetPath
AccessKey = Fake.Core.Environment.environVarOrDefault "nugetkey" ""
Publish = Fake.Core.Environment.hasEnvironVar "nugetkey"
Dependencies = [] })
"nuget/SqlClient.nuspec"
for entry in projects do
Fake.DotNet.NuGet.NuGet.NuGet (fun p ->
{ p with
Authors = authors
Project = entry.runtime
Summary = summary
Description = description
Version = version
ReleaseNotes = releaseNotes
Tags = tags
OutputPath = "nuget"
ToolPath = nugetPath
AccessKey = Fake.Core.Environment.environVarOrDefault "nugetkey" ""
Publish = Fake.Core.Environment.hasEnvironVar "nugetkey"
Dependencies = [] })
entry.nugetSpec
)

// --------------------------------------------------------------------------------------
Expand Down
43 changes: 43 additions & 0 deletions nuget/MicrosoftSqlClient.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>@project@</id>
<version>@build.number@</version>
<authors>@authors@</authors>
<owners>@authors@</owners>
<licenseUrl>http://github.com/fsprojects/FSharp.Data.SqlClient/blob/master/LICENSE.md</licenseUrl>
<projectUrl>http://fsprojects.github.io/FSharp.Data.SqlClient/</projectUrl>
<iconUrl>https://raw.githubusercontent.com/fsprojects/FSharp.Data.SqlClient/master/docs/files/img/logo.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>@description@</description>
<summary>@summary@</summary>
<releaseNotes>@releaseNotes@</releaseNotes>
<copyright>Copyright 2015</copyright>
<tags>@tags@</tags>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.Data" targetFramework="net462" />
<frameworkAssembly assemblyName="System.Xml" targetFramework="net462" />
</frameworkAssemblies>
<references>
<reference file="FSharp.Data.MicrosoftSqlClient.dll" />
</references>
<dependencies>
<group targetFramework="net462">
<dependency id="FSharp.Core" version="8.0.301" />
</group>
<group targetFramework="netstandard2.0">
<dependency id="FSharp.Core" version="8.0.301" />
<dependency id="Microsoft.Data.SqlClient" version="6.1.4" />
<dependency id="System.Configuration.ConfigurationManager" version="9.0.4" />
</group>
<group targetFramework="net8.0">
<dependency id="FSharp.Core" version="8.0.301" />
<dependency id="Microsoft.Data.SqlClient" version="6.1.4" />
<dependency id="System.Configuration.ConfigurationManager" version="9.0.4" />
</group>
</dependencies>
</metadata>
<files>
<file src="..\bin\microsoftsqlclient\**\*.*" exclude="**\*.deps.json" />
</files>
</package>
2 changes: 1 addition & 1 deletion nuget/SqlClient.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
</dependencies>
</metadata>
<files>
<file src="..\bin\**\*.*" exclude="**\*.deps.json" />
<file src="..\bin\sqlclient\**\*.*" exclude="**\*.deps.json" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<NoWarn>$(NoWarn);101;44</NoWarn>
<OutputPath>..\..\bin\typeproviders\fsharp41</OutputPath>
<OutputPath>..\..\bin\microsoftsqlclient\typeproviders\fsharp41</OutputPath>

<!--
note: TypeProvider SDK comes with few warnings
Expand Down
2 changes: 1 addition & 1 deletion src/SqlClient.DesignTime/SqlClient.DesignTime.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<NoWarn>$(NoWarn);101</NoWarn>
<OutputPath>..\..\bin\typeproviders\fsharp41</OutputPath>
<OutputPath>..\..\bin\sqlclient\typeproviders\fsharp41</OutputPath>

<!--
note: TypeProvider SDK comes with few warnings
Expand Down
6 changes: 3 additions & 3 deletions src/SqlClient.TestProjects/Lib/Lib.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<ItemGroup>
<Reference Include="netstandard" />
<Reference Condition="'$(TargetFramework)' == 'net8.0'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\..\bin\net8.0\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\..\bin\sqlclient\net8.0\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Condition="'$(TargetFramework)' == 'netstandard2.0'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\..\bin\sqlclient\netstandard2.0\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Condition="'$(TargetFramework)' == 'net471'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\..\bin\net462\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\..\bin\sqlclient\net462\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="FSharp.Data.SqlClient">
<HintPath>..\..\..\bin\net462\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\..\bin\sqlclient\net462\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="FSharp.Data.SqlClient">
<HintPath>..\..\..\bin\net8.0\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\..\bin\sqlclient\net8.0\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions src/SqlClient/MicrosoftSqlClient.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>..\..\bin\$(TargetFramework)\FSharp.Data.MicrosoftSqlClient.XML</DocumentationFile>
<DocumentationFile>..\..\bin\microsoftsqlclient\$(TargetFramework)\FSharp.Data.MicrosoftSqlClient.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="8.0.301" />
Expand All @@ -43,6 +43,6 @@
<ItemGroup>
<RuntimeAssemblies Include="$(OutputPath)\FSharp.Data.MicrosoftSqlClient.*" />
</ItemGroup>
<Copy SourceFiles="@(RuntimeAssemblies)" DestinationFolder="..\..\bin\$(TargetFramework)" />
<Copy SourceFiles="@(RuntimeAssemblies)" DestinationFolder="..\..\bin\microsoftsqlclient\$(TargetFramework)" />
</Target>
</Project>
4 changes: 2 additions & 2 deletions src/SqlClient/SqlClient.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DocumentationFile>..\..\bin\net462\FSharp.Data.SqlClient.XML</DocumentationFile>
<DocumentationFile>..\..\bin\sqlclient\$(TargetFramework)\FSharp.Data.SqlClient.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="8.0.301" />
Expand All @@ -43,6 +43,6 @@
<ItemGroup>
<RuntimeAssemblies Include="$(OutputPath)\FSharp.Data.SqlClient.*" />
</ItemGroup>
<Copy SourceFiles="@(RuntimeAssemblies)" DestinationFolder="..\..\bin\$(TargetFramework)" />
<Copy SourceFiles="@(RuntimeAssemblies)" DestinationFolder="..\..\bin\sqlclient\$(TargetFramework)" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
</ItemGroup>
<ItemGroup>
<Reference Condition="$(TargetFramework) == 'net462'" Include="FSharp.Data.MicrosoftSqlClient.DesignTime">
<HintPath>..\..\bin\typeproviders\fsharp41\net462\FSharp.Data.MicrosoftSqlClient.DesignTime.dll</HintPath>
<HintPath>..\..\bin\microsoftsqlclient\typeproviders\fsharp41\net462\FSharp.Data.MicrosoftSqlClient.DesignTime.dll</HintPath>
</Reference>
<Reference Condition="$(TargetFramework) == 'net8.0'" Include="FSharp.Data.MicrosoftSqlClient.DesignTime">
<HintPath>..\..\bin\typeproviders\fsharp41\net8.0\FSharp.Data.MicrosoftSqlClient.DesignTime.dll</HintPath>
<HintPath>..\..\bin\microsoftsqlclient\typeproviders\fsharp41\net8.0\FSharp.Data.MicrosoftSqlClient.DesignTime.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
</ItemGroup>
<ItemGroup>
<Reference Condition="$(TargetFramework) == 'net462'" Include="FSharp.Data.SqlClient.DesignTime">
<HintPath>..\..\bin\typeproviders\fsharp41\net462\FSharp.Data.SqlClient.DesignTime.dll</HintPath>
<HintPath>..\..\bin\sqlclient\typeproviders\fsharp41\net462\FSharp.Data.SqlClient.DesignTime.dll</HintPath>
</Reference>
<Reference Condition="$(TargetFramework) == 'net8.0'" Include="FSharp.Data.SqlClient.DesignTime">
<HintPath>..\..\bin\typeproviders\fsharp41\net8.0\FSharp.Data.SqlClient.DesignTime.dll</HintPath>
<HintPath>..\..\bin\sqlclient\typeproviders\fsharp41\net8.0\FSharp.Data.SqlClient.DesignTime.dll</HintPath>
</Reference>
</ItemGroup>
<Import Project="..\..\.paket\Paket.Restore.targets" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<OutputPath>bin\$(Configuration)\microsoftclient\</OutputPath>
<!--
disable error FS0044: This construct is deprecated. use 'FSharp.Data.SqlClient.Internals.ISqlCommand' instead
for the time necessary of the transition, this enables more coverage of the type aliases working the way expected in client code
Expand All @@ -18,13 +19,13 @@
</ItemGroup>
<ItemGroup>
<Reference Condition="$(TargetFramework) == 'net8.0'" Include="FSharp.Data.MicrosoftSqlClient">
<HintPath>..\..\bin\netstandard2.0\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
<HintPath>..\..\bin\microsoftsqlclient\netstandard2.0\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
</Reference>
<Reference Condition="$(TargetFramework) == 'netstandard2.0'" Include="FSharp.Data.MicrosoftSqlClient">
<HintPath>..\..\bin\netstandard2.0\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
<HintPath>..\..\bin\microsoftsqlclient\netstandard2.0\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
</Reference>
<Reference Condition="$(TargetFramework) == 'net462'" Include="FSharp.Data.MicrosoftSqlClient">
<HintPath>..\..\bin\net462\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
<HintPath>..\..\bin\microsoftsqlclient\net462\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
</Reference>

</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<OutputPath>bin\$(Configuration)\sqlclient\</OutputPath>
<!--
disable error FS0044: This construct is deprecated. use 'FSharp.Data.SqlClient.Internals.ISqlCommand' instead
for the time necessary of the transition, this enables more coverage of the type aliases working the way expected in client code
Expand All @@ -18,13 +19,13 @@
</ItemGroup>
<ItemGroup>
<Reference Condition="$(TargetFramework) == 'net8.0'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\bin\sqlclient\netstandard2.0\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Condition="$(TargetFramework) == 'netstandard2.0'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\bin\netstandard2.0\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\bin\sqlclient\netstandard2.0\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Condition="$(TargetFramework) == 'net462'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\bin\net462\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\bin\sqlclient\net462\FSharp.Data.SqlClient.dll</HintPath>
</Reference>

</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/SqlClient.Tests/MicrosoftSqlClient.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
</ItemGroup>
<ItemGroup>
<Reference Condition="'$(TargetFramework)' == 'net462'" Include="FSharp.Data.MicrosoftSqlClient">
<HintPath>..\..\bin\net462\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
<HintPath>..\..\bin\microsoftsqlclient\net462\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
</Reference>
<Reference Condition="'$(TargetFramework)' == 'net8.0'" Include="FSharp.Data.MicrosoftSqlClient">
<HintPath>..\..\bin\net8.0\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
<HintPath>..\..\bin\microsoftsqlclient\net8.0\FSharp.Data.MicrosoftSqlClient.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/SqlClient.Tests/SqlClient.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@
</ItemGroup>
<ItemGroup>
<Reference Condition="'$(TargetFramework)' == 'net462'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\bin\net462\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\bin\sqlclient\net462\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Condition="'$(TargetFramework)' == 'net8.0'" Include="FSharp.Data.SqlClient">
<HintPath>..\..\bin\net8.0\FSharp.Data.SqlClient.dll</HintPath>
<HintPath>..\..\bin\sqlclient\net8.0\FSharp.Data.SqlClient.dll</HintPath>
</Reference>
<Reference Include="System.Transactions" />
</ItemGroup>
Expand Down
Loading