Skip to content

Commit ff98ba0

Browse files
authored
fix RCC generation with resource file checks
Added resource file verification in RCC generation process which were missing and causing actions to build incorrectly.
1 parent 486f170 commit ff98ba0

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,14 +208,42 @@ jobs:
208208
$rccInput = "src/Res/resources.qrc"
209209
$rccOutput = "GeneratedFiles/qrc_resources.cpp"
210210
if (Test-Path $rccInput) {
211+
Write-Host "RCC Input: $rccInput"
212+
Write-Host "RCC Output: $rccOutput"
213+
Write-Host "Current directory: $(Get-Location)"
214+
215+
Write-Host "Verifying resource files..."
216+
$qrcContent = Get-Content $rccInput -Raw
217+
if ($qrcContent -match '<file>(.*?)</file>') {
218+
$resourceFiles = [regex]::Matches($qrcContent, '<file>(.*?)</file>') | ForEach-Object { $_.Groups[1].Value }
219+
$qrcDir = Split-Path (Resolve-Path $rccInput) -Parent
220+
foreach ($resFile in $resourceFiles) {
221+
$fullPath = Join-Path $qrcDir $resFile
222+
$fullPath = [System.IO.Path]::GetFullPath($fullPath)
223+
if (Test-Path $fullPath) {
224+
Write-Host " Found: $resFile"
225+
} else {
226+
Write-Host " WARNING: Missing resource file: $resFile (expected at: $fullPath)"
227+
}
228+
}
229+
}
230+
211231
& $rccPath -name resources $rccInput -o $rccOutput
212232
if ($LASTEXITCODE -eq 0) {
213233
Write-Host "Successfully generated RCC file: $rccOutput"
234+
if (Test-Path $rccOutput) {
235+
$fileSize = (Get-Item $rccOutput).Length
236+
Write-Host "RCC file size: $fileSize bytes"
237+
}
214238
} else {
215239
Write-Host "RCC generation failed with exit code: $LASTEXITCODE"
240+
Write-Host "RCC command: $rccPath -name resources $rccInput -o $rccOutput"
216241
}
217242
} else {
218243
Write-Host "RCC input file not found: $rccInput"
244+
Write-Host "Current directory: $(Get-Location)"
245+
Write-Host "Files in current directory:"
246+
Get-ChildItem -Recurse -Filter "resources.qrc" | ForEach-Object { Write-Host " Found: $($_.FullName)" }
219247
}
220248
} else {
221249
Write-Host "RCC tool not found, skipping resource compilation"

0 commit comments

Comments
 (0)