Skip to content

Commit 35fe31b

Browse files
update
1 parent ecc7c7d commit 35fe31b

25 files changed

+624
-35
lines changed

build/build-core.ps1

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
$PSDefaultParameterValues["*:Force"] = $true
22
$PSDefaultParameterValues["*:Confirm"] = $false
3+
Push-Location /mnt/c/github/dbatools.library
34

45
if (Test-Path ./lib) {
56
write-warning "removing ./lib"
@@ -9,15 +10,22 @@ if (Test-Path ./lib) {
910
rm -rf third-party-licenses
1011
}
1112

12-
$root = Split-Path -Path $PSScriptRoot
13+
$scriptroot = $PSScriptRoot
14+
if (-not $scriptroot) {
15+
$scriptroot = "/mnt/c/github/dbatools.library/build"
16+
}
17+
18+
$root = Split-Path -Path $scriptroot
1319
Push-Location "$root/project"
20+
21+
1422
dotnet publish --configuration release --framework net6.0 | Out-String -OutVariable build
1523
dotnet test --framework net6.0 --verbosity normal | Out-String -OutVariable test
1624
Pop-Location
1725

1826
Remove-Item -Path lib/dbatools.xml
1927
Get-ChildItem -Path lib/net6.0 -File | Remove-Item
20-
Move-Item -Path lib/net6.0/publish/* -Destination lib/ -ErrorAction Ignore
28+
Move-Item -Path lib/net6.0/publish/* -Destination lib/ #-ErrorAction Ignore
2129
Remove-Item -Path lib/net6.0 -Recurse -ErrorAction Ignore
2230

2331
Get-ChildItem ./lib -Recurse -Include *.pdb | Remove-Item
@@ -81,7 +89,7 @@ msiextract --directory $(Resolve-Path .\temp\xe) $(Resolve-Path .\temp\XESmartTa
8189

8290
Get-ChildItem "./temp/xe/*.dll" -Recurse | Copy-Item -Destination third-party/XESmartTarget
8391
Get-ChildItem "./temp/dacfull/" -Include *.dll, *.exe, *.config -Recurse | Copy-Item -Destination ./lib/win
84-
Get-ChildItem "./temp/bogus/*/netstandard2.0/bogus.dll" -Recurse | Copy-Item -Destination ./third-party/bogus/bogus.dll
92+
Get-ChildItem "./temp/bogus/*/net6.0/bogus.dll" -Recurse | Copy-Item -Destination ./third-party/bogus/bogus.dll
8593
Copy-Item ./temp/LumenWorksCsvReader/lib/netstandard2.0/LumenWorks.Framework.IO.dll -Destination ./third-party/LumenWorks/LumenWorks.Framework.IO.dll
8694

8795
Register-PackageSource -provider NuGet -name nugetRepository -Location https://www.nuget.org/api/v2 -Trusted -ErrorAction Ignore
@@ -96,25 +104,26 @@ $parms = @{
96104
}
97105

98106
$parms.Name = "Microsoft.Data.SqlClient"
99-
$parms.RequiredVersion = "5.0.1"
107+
$parms.RequiredVersion = "5.1.1"
100108
$null = Install-Package @parms
101109

102110
$parms.Name = "Microsoft.Data.SqlClient.SNI.runtime"
103-
$parms.RequiredVersion = "5.0.1"
111+
$parms.RequiredVersion = "5.1.0"
104112
$null = Install-Package @parms
105113

106114
$parms.Name = "Microsoft.Identity.Client"
107-
$parms.RequiredVersion = "4.45.0"
115+
$parms.RequiredVersion = "4.53.0"
108116
$null = Install-Package @parms
109117

110-
Copy-Item "$tempdir/nuget/Microsoft.Data.SqlClient.5.0.1/runtimes/unix/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll" -Destination lib
111-
Copy-Item "$tempdir/nuget/Microsoft.Data.SqlClient.5.0.1/runtimes/win/lib/netcoreapp3.1/Microsoft.Data.SqlClient.dll" -Destination lib/win-sqlclient/
112-
Copy-Item "$tempdir/nuget/Microsoft.Identity.Client.4.45.0/lib/netcoreapp2.1/Microsoft.Identity.Client.dll" -Destination lib/win-sqlclient/
113-
Copy-Item "$tempdir/nuget/Microsoft.Data.SqlClient.SNI.runtime.5.0.1/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll" -Destination lib/win-sqlclient/
118+
Copy-Item "$tempdir/nuget/Microsoft.Data.SqlClient.5.1.1/runtimes/unix/lib/net6.0/Microsoft.Data.SqlClient.dll" -Destination lib
119+
Copy-Item "$tempdir/nuget/Microsoft.Data.SqlClient.5.1.1/runtimes/win/lib/net6.0/Microsoft.Data.SqlClient.dll" -Destination lib/win-sqlclient/
120+
Copy-Item "$tempdir/nuget/Microsoft.Identity.Client.4.53.0/lib/net6.0/Microsoft.Identity.Client.dll" -Destination lib/win-sqlclient/ #Maybe this will be a problem, i dont know
121+
Copy-Item "$tempdir/nuget/Microsoft.Data.SqlClient.SNI.runtime.5.1.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll" -Destination lib/win-sqlclient/
114122

115123
Copy-Item ./temp/linux/* -Destination lib -Exclude (Get-ChildItem lib -Recurse) -Recurse -Include *.exe, *.config -Verbose
116124

117-
Copy-Item "./var/replication/*.dll" -Destination ./lib/
125+
Copy-Item "./var/misc/core/*.dll" -Destination ./lib/
126+
Copy-Item "./var/misc/both/*.dll" -Destination ./lib/
118127
Copy-Item "./var/third-party-licenses" -Destination ./ -Recurse
119128

120129
$linux = 'libclrjit.so', 'libcoreclr.so', 'libhostfxr.so', 'libhostpolicy.so', 'libSystem.Native.so', 'libSystem.Security.Cryptography.Native.OpenSsl.so', 'Microsoft.Win32.Primitives.dll', 'sqlpackage', 'sqlpackage.deps.json', 'sqlpackage.dll', 'sqlpackage.pdb', 'sqlpackage.runtimeconfig.json', 'sqlpackage.xml', 'System.Collections.Concurrent.dll', 'System.Collections.dll', 'System.Console.dll', 'System.Diagnostics.FileVersionInfo.dll', 'System.Diagnostics.TraceSource.dll', 'System.Linq.dll', 'System.Memory.dll', 'System.Private.CoreLib.dll', 'System.Private.Xml.dll', 'System.Reflection.Metadata.dll', 'System.Runtime.dll', 'System.Security.Cryptography.Algorithms.dll', 'System.Security.Cryptography.Primitives.dll', 'System.Threading.dll', 'System.Threading.Thread.dll', 'System.Xml.ReaderWriter.dll', 'sqlpackage', 'sqlpackage.deps.json', 'sqlpackage.dll', 'sqlpackage.pdb', 'sqlpackage.runtimeconfig.json', 'sqlpackage.xml'
@@ -125,17 +134,23 @@ Copy-Item -Path $sqlp.FullName -Destination ./lib/
125134
Get-ChildItem -Directory -Path ./lib | Where-Object Name -notin 'win-sqlclient', 'x64', 'x86', 'win', 'mac', 'macos' | Remove-Item -Recurse
126135

127136
Get-ChildItem ./lib, ./lib/win, ./lib/mac | Where-Object BaseName -in (Get-ChildItem /opt/microsoft/powershell/7).BaseName -OutVariable files
128-
Remove-Item $files -Recurse
137+
138+
if ($files) {
139+
Remove-Item $files -Recurse
140+
}
141+
129142

130143
if ($isLinux -or $IsMacOs) {
131144
chmod +x ./lib/sqlpackage
132145
chmod +x ./lib/mac/sqlpackage
133146
}
134147

135148
Get-ChildItem ./lib/*.xml, ./lib/*.pdb -Recurse -OutVariable xmlpdb
136-
Remove-Item -Path $xmlpdb -Recurse -ErrorAction Ignore
149+
if ($xmlpdb) {
150+
Remove-Item -Path $xmlpdb -Recurse -ErrorAction Ignore
151+
}
137152

138-
Import-Module ./dbatools.core.library.psd1
153+
#Import-Module ./dbatools.core.library.psd1
139154

140155
<#
141156
if ((Get-ChildItem -Path C:\gallery\dbatools.library\core -ErrorAction Ignore)) {

build/build-full.ps1

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
$PSDefaultParameterValues["*:Force"] = $true
22
$PSDefaultParameterValues["*:Confirm"] = $false
3+
Push-Location C:\github\dbatools.library\
34

45
if (Test-Path "C:\github\dbatools.library\lib") {
56
write-warning "removing C:\github\dbatools.library\lib"
@@ -9,7 +10,11 @@ if (Test-Path "C:\github\dbatools.library\lib") {
910
Remove-Item -Path third-party-licenses -Recurse -ErrorAction Ignore
1011
}
1112

12-
$root = Split-Path -Path $PSScriptRoot
13+
$scriptroot = $PSScriptRoot
14+
if (-not $scriptroot) {
15+
$scriptroot = "C:\github\dbatools.library\build"
16+
}
17+
$root = Split-Path -Path $scriptroot
1318
Push-Location "$root\project"
1419

1520
dotnet publish --configuration release --framework net462 | Out-String -OutVariable build
@@ -74,21 +79,23 @@ $parms = @{
7479
}
7580

7681
$parms.Name = "Microsoft.Data.SqlClient"
77-
$parms.RequiredVersion = "5.0.1"
82+
$parms.RequiredVersion = "5.1.1"
7883
$null = Install-Package @parms
7984

8085
$parms.Name = "Microsoft.Data.SqlClient.SNI.runtime"
81-
$parms.RequiredVersion = "5.0.1"
86+
$parms.RequiredVersion = "5.1.0"
8287
$null = Install-Package @parms
8388

8489
$parms.Name = "Microsoft.Identity.Client"
85-
$parms.RequiredVersion = "4.45.0"
90+
$parms.RequiredVersion = "4.53.0"
8691
$null = Install-Package @parms
8792

88-
Copy-Item "$tempdir\nuget\Microsoft.Identity.Client.4.45.0\lib\net461\Microsoft.Identity.Client.dll" -Destination lib/
89-
Copy-Item "$tempdir\nuget\Microsoft.Data.SqlClient.SNI.runtime.5.0.1\runtimes\win-x64\native\Microsoft.Data.SqlClient.SNI.dll" -Destination lib/
93+
Copy-Item "$tempdir\nuget\Microsoft.Identity.Client.4.53.0\lib\net461\Microsoft.Identity.Client.dll" -Destination lib/
94+
Copy-Item "$tempdir\nuget\Microsoft.Data.SqlClient.SNI.runtime.5.1.0\runtimes\win-x64\native\Microsoft.Data.SqlClient.SNI.dll" -Destination lib/
95+
9096

91-
Copy-Item "./var/replication/*.dll" -Destination lib/
97+
Copy-Item "./var/misc/core/*.dll" -Destination ./lib/
98+
Copy-Item "./var/misc/both/*.dll" -Destination ./lib/
9299
Copy-Item "./var/third-party-licenses" -Destination ./ -Recurse
93100

94101
Remove-Item -Path lib/*.xml -Recurse -ErrorAction Ignore
@@ -105,11 +112,11 @@ if ((Get-ChildItem -Path C:\gallery\dbatools.library -ErrorAction Ignore)) {
105112
Remove-Item c:\gallery\dbatools.library\dbatools.core.library.psd1 -ErrorAction Ignore
106113
Copy-Item C:\github\dbatools.library\dbatools.library.psd1 C:\gallery\dbatools.library
107114

108-
Get-ChildItem -Recurse -Path C:\gallery\dbatools.library\*.ps*, C:\gallery\dbatools.library\dbatools.dll | Set-AuthenticodeSignature -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\fd0dde81152c4d4868afd88d727e78a9b6881cf4) -TimestampServer http://timestamp.digicert.com -HashAlgorithm SHA256
115+
$null = Get-ChildItem -Recurse -Path C:\gallery\dbatools.library\*.ps*, C:\gallery\dbatools.library\dbatools.dll | Set-AuthenticodeSignature -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\fd0dde81152c4d4868afd88d727e78a9b6881cf4) -TimestampServer http://timestamp.digicert.com -HashAlgorithm SHA256
109116
}
110117

111118
Import-Module C:\gallery\dbatools.library\dbatools.library.psd1 -Force
112-
119+
Pop-Location
113120
<#
114121
already there
115122
-rwxrwxrwx ctrlb ctrlb 10/08/2022 03:08 12132752 Microsoft.Data.Tools.Schema.Sql.dll

build/build-local.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ $parms = @{
8888

8989
$parms.Name = "System.Resources.Extensions"
9090
$parms.RequiredVersion = "6.0.0.0"
91-
#Install-Package @parms
91+
Install-Package @parms
9292

9393
$parms.Name = "Microsoft.SqlServer.DacFx"
9494
$parms.RequiredVersion = "161.6319.0-preview"
95-
#Install-Package @parms
95+
Install-Package @parms
9696

9797
$parms.Name = "Microsoft.SqlServer.SqlManagementObjects"
9898
$parms.RequiredVersion = "170.7.0-preview"

0 commit comments

Comments
 (0)