Skip to content

Commit

Permalink
update library
Browse files Browse the repository at this point in the history
  • Loading branch information
potatoqualitee committed Jan 29, 2023
1 parent 60e6a5c commit e63bba4
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 124 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/sqlpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ jobs:
- name: Install and cache PowerShell modules
uses: potatoqualitee/[email protected]
with:
modules-to-cache: dbatools.core.library:2022.11.8
modules-to-cache-prerelease: dbatools.library:2022.11.8-preview
modules-to-cache: dbatools.library:2023.1.29

- name: Execute sqlpackage
shell: pwsh
Expand Down
24 changes: 13 additions & 11 deletions build/build-core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ $PSDefaultParameterValues["*:Force"] = $true
$PSDefaultParameterValues["*:Confirm"] = $false

if (Test-Path ./lib) {
write-warning removing
write-warning "removing ./lib"
rm -rf lib
rm -rf temp
rm -rf third-party
rm -rf third-party-licenses
}
Push-Location "./project"

$root = Split-Path -Path $PSScriptRoot
Push-Location "$root/project"
dotnet publish --configuration release --framework net6.0 | Out-String -OutVariable build
dotnet test --framework net6.0 --verbosity normal | Out-String -OutVariable test
Pop-Location
Expand Down Expand Up @@ -136,14 +138,14 @@ Remove-Item -Path $xmlpdb -Recurse -ErrorAction Ignore
Import-Module ./dbatools.core.library.psd1

<#
if ((Get-ChildItem -Path C:\gallery\dbatools.core.library -ErrorAction Ignore)) {
$null = Remove-Item C:\gallery\dbatools.core.library -Recurse
$null = mkdir C:\gallery\dbatools.core.library
$null = robocopy c:\github\dbatools.library C:\gallery\dbatools.core.library /S /XF actions-build.ps1 .markdownlint.json *.psproj* *.git* *.yml *.md dac.ps1 *build*.ps1 /XD .git .github Tests .vscode project temp runtime runtimes replication var opt | Out-String | Out-Null
Remove-Item c:\gallery\dbatools.core.library\dac.ps1 -ErrorAction Ignore
Remove-Item c:\gallery\dbatools.core.library\dbatools.library.psd1 -ErrorAction Ignore
Copy-Item C:\github\dbatools.library\dbatools.core.library.psd1 C:\github\dbatools.core.library
Get-ChildItem -Recurse -Path C:\gallery\dbatools.core.library\*.ps*, C:\gallery\dbatools.core.library\dbatools.dll | Set-AuthenticodeSignature -Certificate (Get-ChildItem -Path Cert:\CurrentUser\My\fd0dde81152c4d4868afd88d727e78a9b6881cf4) -TimestampServer http://timestamp.digicert.com -HashAlgorithm SHA256
if ((Get-ChildItem -Path C:\gallery\dbatools.library\core -ErrorAction Ignore)) {
$null = Remove-Item C:\gallery\dbatools.library\core -Recurse
$null = mkdir C:\gallery\dbatools.library\core
$null = robocopy c:\github\dbatools.library C:\gallery\dbatools.library\core /S /XF actions-build.ps1 .markdownlint.json *.psproj* *.git* *.yml *.md dac.ps1 *build*.ps1 /XD .git .github Tests .vscode project temp runtime runtimes replication var opt | Out-String | Out-Null
Remove-Item c:\gallery\dbatools.library\core\dac.ps1 -ErrorAction Ignore
Remove-Item c:\gallery\dbatools.library\core\dbatools.library.psd1 -ErrorAction Ignore
#Copy-Item C:\github\dbatools.library\dbatools.core.library.psd1 C:\github\dbatools.core.library
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
}
#>
6 changes: 4 additions & 2 deletions build/build-full.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ $PSDefaultParameterValues["*:Force"] = $true
$PSDefaultParameterValues["*:Confirm"] = $false

if (Test-Path "C:\github\dbatools.library\lib") {
write-warning removing
write-warning "removing C:\github\dbatools.library\lib"
Remove-Item -Path lib -Recurse -ErrorAction Ignore
Remove-Item -Path temp -Recurse -ErrorAction Ignore
Remove-Item -Path third-party -Recurse -ErrorAction Ignore
Remove-Item -Path third-party-licenses -Recurse -ErrorAction Ignore
}

Push-Location ".\project"
$root = Split-Path -Path $PSScriptRoot
Push-Location "$root\project"

dotnet publish --configuration release --framework net462 | Out-String -OutVariable build
dotnet test --framework net462 --verbosity normal | Out-String -OutVariable test
Pop-Location
Expand Down
90 changes: 0 additions & 90 deletions dbatools.core.library.psd1

This file was deleted.

16 changes: 3 additions & 13 deletions dbatools.library.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#
@{
# Version number of this module.
ModuleVersion = '2022.11.8'
ModuleVersion = '2023.1.29'

# ID used to uniquely identify this module
GUID = '00b61a37-6c36-40d8-8865-ac0180288c84'
Expand All @@ -19,20 +19,11 @@
CompanyName = 'dbatools.io'

# Copyright statement for this module
Copyright = 'Copyright (c) 2022 by dbatools, licensed under MIT'
Copyright = 'Copyright (c) 2023 by dbatools, licensed under MIT'

# Description of the functionality provided by this module
Description = "The library that powers dbatools, the community module for SQL Server Pros"

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '5.1'

# Minimum version of the .NET Framework required by this module
DotNetFrameworkVersion = '4.6.2'

# Supported PSEditions
CompatiblePSEditions = @('Desktop')

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @()

Expand Down Expand Up @@ -76,8 +67,7 @@
# RequireLicenseAcceptance = ""

# Indicates this is a pre-release/testing version of the module.
IsPrerelease = 'true'
Prerelease = 'preview'
IsPrerelease = 'false'
}
}
}
6 changes: 5 additions & 1 deletion dbatools.library.psm1
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
function Get-DbatoolsLibraryPath {
[CmdletBinding()]
param()
$PSScriptRoot
if ($PSVersionTable.PSEdition -eq "Core") {
Join-Path -Path $PSScriptRoot -ChildPath core
} else {
Join-Path -Path $PSScriptRoot -ChildPath desktop
}
}
6 changes: 3 additions & 3 deletions project/dbatools.Tests/dbatools.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
</PropertyGroup>
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" />
<PackageReference Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageReference Include="MSTest.TestFramework" Version="2.2.10" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
<PackageReference Include="MSTest.TestAdapter" Version="3.0.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\dbatools\dbatools.csproj" />
Expand Down
5 changes: 3 additions & 2 deletions project/dbatools/dbatools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Identity.Client" Version="4.49.1" />
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="7.0.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.0.1" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="170.8.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.0" />
<PackageReference Include="Microsoft.SqlServer.SqlManagementObjects" Version="170.11.0" />
<PackageReference Include="Microsoft.SqlServer.XEvent.XELite" Version="2022.11.10.6" />
<PackageReference Include="Microsoft.SqlServer.DacFx" Version="161.6374.0" />
</ItemGroup>
Expand Down

0 comments on commit e63bba4

Please sign in to comment.