Skip to content

Commit

Permalink
chore: update winlibs package
Browse files Browse the repository at this point in the history
  • Loading branch information
xxthunder committed Jun 21, 2024
1 parent 0fa0519 commit d833d3d
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bootstrap.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"scoop_ignore_scoopfile": true
}
}
4 changes: 1 addition & 3 deletions build.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
pushd %~dp0
powershell -ExecutionPolicy Bypass -File .\build.ps1 %* || exit /b 1
popd
powershell -ExecutionPolicy Bypass -File %~dp0build.ps1 %* || exit /b 1
61 changes: 46 additions & 15 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,54 @@
<#
.DESCRIPTION
Wrapper for installing dependencies, running and testing the project
#>

param(
[Parameter(Mandatory = $false, HelpMessage = 'Clean build, wipe out all build artifacts. (Switch, default: false)')]
[switch]$clean = $false,
[Parameter(Mandatory = $false, HelpMessage = 'Install all dependencies required to build. (Switch, default: false)')]
[switch]$install = $false
[switch]$clean ## clean build, wipe out all build artifacts
, [switch]$install ## install mandatory packages
)

function Test-RunningInCIorTestEnvironment {
return [Boolean]($Env:JENKINS_URL -or $Env:PYTEST_CURRENT_TEST -or $Env:GITHUB_ACTIONS)
function Invoke-CommandLine {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingInvokeExpression', '', Justification = 'Usually this statement must be avoided (https://learn.microsoft.com/en-us/powershell/scripting/learn/deep-dives/avoid-using-invoke-expression?view=powershell-7.3), here it is OK as it does not execute unknown code.')]
param (
[Parameter(Mandatory = $true, Position = 0)]
[string]$CommandLine,
[Parameter(Mandatory = $false, Position = 1)]
[bool]$StopAtError = $true,
[Parameter(Mandatory = $false, Position = 2)]
[bool]$PrintCommand = $true,
[Parameter(Mandatory = $false, Position = 3)]
[bool]$Silent = $false
)
if ($PrintCommand) {
Write-Output "Executing: $CommandLine"
}
$global:LASTEXITCODE = 0
if ($Silent) {
# Omit information stream (6) and stdout (1)
Invoke-Expression $CommandLine 6>&1 | Out-Null
}
else {
Invoke-Expression $CommandLine
}
if ($global:LASTEXITCODE -ne 0) {
if ($StopAtError) {
Write-Error "Command line call `"$CommandLine`" failed with exit code $global:LASTEXITCODE"
}
else {
Write-Output "Command line call `"$CommandLine`" failed with exit code $global:LASTEXITCODE, continuing ..."
}
}
}

function Invoke-Bootstrap {
# Download bootstrap scripts from external repository
Invoke-RestMethod https://raw.githubusercontent.com/avengineers/bootstrap-installer/v1.6.0/install.ps1 | Invoke-Expression
Invoke-RestMethod https://raw.githubusercontent.com/avengineers/bootstrap-installer/v1.9.0/install.ps1 | Invoke-Expression
# Execute bootstrap script
. .\.bootstrap\bootstrap.ps1
}

Function Remove-Path {
function Remove-Path {
param (
[Parameter(Mandatory = $true, Position = 0)]
[string]$path
Expand All @@ -32,7 +64,8 @@ Function Remove-Path {
}

## start of script
# Always set the $InformationPreference variable to "Continue" globally, this way it gets printed on execution and continues execution afterwards.
# Always set the $InformationPreference variable to "Continue" globally,
# this way it gets printed on execution and continues execution afterwards.
$InformationPreference = "Continue"

# Stop on first error
Expand All @@ -42,24 +75,22 @@ Push-Location $PSScriptRoot
Write-Output "Running in ${pwd}"

try {
# clean build
if ($clean) {
Remove-Path "build"
Remove-Path ".venv"
}

# bootstrap environment
Invoke-Bootstrap

if (-Not $install) {
if ($clean) {
Remove-Path "build"
}
# Run pypeline
.\.venv\Scripts\pypeline run
Invoke-CommandLine ".venv\Scripts\pypeline run"
}
}
finally {
Pop-Location
if (-Not (Test-RunningInCIorTestEnvironment)) {
Read-Host -Prompt "Press Enter to continue ..."
}
}
## end of script
6 changes: 4 additions & 2 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"extends": ["github>browniebroke/renovate-configs:python"]
}
"extends": [
"github>browniebroke/renovate-configs:python"
]
}
2 changes: 1 addition & 1 deletion scoopfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"Source": "spl",
"Name": "mingw-winlibs-llvm-ucrt",
"Version": "12.3.0-16.0.4-11.0.0-ucrt-r1"
"Version": "13.2.0-16.0.6-11.0.0-ucrt-r1"
}
]
}

0 comments on commit d833d3d

Please sign in to comment.