From 6040f92b9b39d3e2e5bcb9dfac44cbbcc12f13fe Mon Sep 17 00:00:00 2001 From: silverqx Date: Sun, 11 Feb 2024 19:04:01 +0100 Subject: [PATCH] tools added source and deploy pwsh scripts --- tools/qsdb-deploy.ps1.example | 26 ++++++++++++++++++++++++++ tools/std.ps1 | 14 ++++++++++++++ tools/stdm6.ps1.example | 10 ++++++++++ tools/stpm6.ps1.example | 10 ++++++++++ tools/str.ps1 | 14 ++++++++++++++ tools/strm6.ps1.example | 10 ++++++++++ 6 files changed, 84 insertions(+) create mode 100644 tools/qsdb-deploy.ps1.example create mode 100644 tools/std.ps1 create mode 100644 tools/stdm6.ps1.example create mode 100644 tools/stpm6.ps1.example create mode 100644 tools/str.ps1 create mode 100644 tools/strm6.ps1.example diff --git a/tools/qsdb-deploy.ps1.example b/tools/qsdb-deploy.ps1.example new file mode 100644 index 000000000..b2ca626fb --- /dev/null +++ b/tools/qsdb-deploy.ps1.example @@ -0,0 +1,26 @@ +#!/usr/bin/env pwsh + +Set-StrictMode -Version 3.0 + +$Script:BuildPath = '\TinyORM\TinyORM-builds-qmake\' + + 'build-TinyORM-Desktop_Qt_6_6_1_MSVC2022_64bit-Release' + +$Script:DestinationPath = '\dotfiles\bin' +$Script:TinyDriversPath = "${Script:BuildPath}\src\release\TinyDrivers0.dll" +$Script:TinyMySqlPath = "${Script:BuildPath}\src\release\TinyMySql0.dll" + +if (Test-Path $Script:TinyDriversPath) { + Copy-Item -Path $Script:TinyDriversPath -Destination $Script:DestinationPath +} + +if (Test-Path $Script:TinyMySqlPath) { + Copy-Item -Path $Script:TinyMySqlPath -Destination $Script:DestinationPath +} + +Copy-Item -Path ` + "${Script:BuildPath}\src\release\TinyOrm0.dll", ` + "${Script:BuildPath}\tests\testdata_tom\release\tom_testdata.exe", ` + "${Script:BuildPath}\examples\tom\release\tom.exe"` + -Destination $Script:DestinationPath + +Write-Host 'TinyORM was deployed successfully. 🥳' -ForegroundColor DarkGreen diff --git a/tools/std.ps1 b/tools/std.ps1 new file mode 100644 index 000000000..859bae599 --- /dev/null +++ b/tools/std.ps1 @@ -0,0 +1,14 @@ +#!/usr/bin/env pwsh + +Param( + [Parameter(Position = 0, ValueFromPipeline, ValueFromPipelinebyPropertyName, + HelpMessage = 'Specifies the TinyORM debug build folder to add.')] + [ValidateNotNullOrEmpty()] + [string[]] $BuildPath = $($(Get-Location).Path) +) + +Set-StrictMode -Version 3.0 + +Add-FolderOnPath.ps1 -Path $BuildPath\src\debug, + $BuildPath\examples\tom\debug, + $BuildPath\tests\testdata_tom\debug diff --git a/tools/stdm6.ps1.example b/tools/stdm6.ps1.example new file mode 100644 index 000000000..3ca8b039c --- /dev/null +++ b/tools/stdm6.ps1.example @@ -0,0 +1,10 @@ +#!/usr/bin/env pwsh + +Set-StrictMode -Version 3.0 + +# Initialize build environment if it's not already there +if (-not (Test-Path env:WindowsSDKLibVersion)) { + . qtenv6.ps1 +} + +std.ps1 -BuildPath '\TinyORM\TinyORM-builds-qmake\build-TinyORM-Desktop_Qt_6_6_1_MSVC2022_64bit-Debug' diff --git a/tools/stpm6.ps1.example b/tools/stpm6.ps1.example new file mode 100644 index 000000000..e7bcd4de9 --- /dev/null +++ b/tools/stpm6.ps1.example @@ -0,0 +1,10 @@ +#!/usr/bin/env pwsh + +Set-StrictMode -Version 3.0 + +# Initialize build environment if it's not already there +if (-not (Test-Path env:WindowsSDKLibVersion)) { + . qtenv6.ps1 +} + +str.ps1 -BuildPath '\TinyORM\TinyORM-builds-qmake\build-TinyORM-Desktop_Qt_6_6_1_MSVC2022_64bit-Profile' diff --git a/tools/str.ps1 b/tools/str.ps1 new file mode 100644 index 000000000..e3ede3fca --- /dev/null +++ b/tools/str.ps1 @@ -0,0 +1,14 @@ +#!/usr/bin/env pwsh + +Param( + [Parameter(Position = 0, ValueFromPipeline, ValueFromPipelinebyPropertyName, + HelpMessage = 'Specifies the TinyORM release build folder to add.')] + [ValidateNotNullOrEmpty()] + [string[]] $BuildPath = $($(Get-Location).Path) +) + +Set-StrictMode -Version 3.0 + +Add-FolderOnPath.ps1 -Path $BuildPath\src\release, + $BuildPath\examples\tom\release, + $BuildPath\tests\testdata_tom\release diff --git a/tools/strm6.ps1.example b/tools/strm6.ps1.example new file mode 100644 index 000000000..38d64b706 --- /dev/null +++ b/tools/strm6.ps1.example @@ -0,0 +1,10 @@ +#!/usr/bin/env pwsh + +Set-StrictMode -Version 3.0 + +# Initialize build environment if it's not already there +if (-not (Test-Path env:WindowsSDKLibVersion)) { + . qtenv6.ps1 +} + +str.ps1 -BuildPath '\TinyORM\TinyORM-builds-qmake\build-TinyORM-Desktop_Qt_6_6_1_MSVC2022_64bit-Release'