diff --git a/scripts/build-repo.ps1 b/scripts/build-repo.ps1 index 076a705d..fc331a3e 100755 --- a/scripts/build-repo.ps1 +++ b/scripts/build-repo.ps1 @@ -29,22 +29,36 @@ function BuildInDir([string]$path) { "⏳ (2/4) Executing 'cmake' to generate the Makefile..." & cmake .. - if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'cmake ..' exited with error code $lastExitCode" } "⏳ (3/4) Executing 'make -j4' to compile and link..." & make -j4 - if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'make -j4' exited with error code $lastExitCode" } "⏳ (4/4) Executing 'ctest -V' to perform tests (optional)..." & ctest -V - if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'ctest -V' exited with error code $lastExitCode" } + + } elseif (Test-Path "$path/autogen.sh" -pathType leaf) { + "⏳ Building 📂$dirName by using 'autogen.sh'..." + Set-Location "$path/" + + & ./autogen.sh --force + if ($lastExitCode -ne "0") { throw "Executing './autogen.sh --force' exited with error code $lastExitCode" } + + & ./configure + if ($lastExitCode -ne "0") { throw "Executing './configure' exited with error code $lastExitCode" } + + & make -j4 + if ($lastExitCode -ne "0") { throw "Executing 'make -j4' exited with error code $lastExitCode" } + } elseif (Test-Path "$path/configure" -pathType leaf) { "⏳ Building 📂$dirName by using 'configure'..." Set-Location "$path/" & ./configure - #if ($lastExitCode -ne "0") { throw "Script 'configure' exited with error code $lastExitCode" } + #if ($lastExitCode -ne "0") { throw "Executing './configure' exited with error code $lastExitCode" } & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } @@ -52,31 +66,21 @@ function BuildInDir([string]$path) { & make test if ($lastExitCode -ne "0") { throw "Executing 'make test' has failed" } - } elseif (Test-Path "$path/autogen.sh" -pathType leaf) { - "⏳ Building 📂$dirName by using 'autogen.sh'..." - Set-Location "$path/" - - & ./autogen.sh - if ($lastExitCode -ne "0") { throw "Script 'autogen.sh' exited with error code $lastExitCode" } - - & make -j4 - if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } - } elseif (Test-Path "$path/build.gradle" -pathType leaf) { "⏳ Building 📂$dirName by using Gradle..." Set-Location "$path" & gradle build - if ($lastExitCode -ne "0") { throw "'gradle build' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'gradle build' exited with error code $lastExitCode" } & gradle test - if ($lastExitCode -ne "0") { throw "'gradle test' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'gradle test' exited with error code $lastExitCode" } } elseif (Test-Path "$path/meson.build" -pathType leaf) { "⏳ Building 📂$dirName by using Meson..." Set-Location "$path" & meson . build --prefix=/usr/local - if ($lastExitCode -ne "0") { throw "'meson . build' has failed" } + if ($lastExitCode -ne "0") { throw "Executing 'meson . build' exited with error code $lastExitCode" } } elseif (Test-Path "$path/Imakefile" -pathType leaf) { "⏳ Building 📂$dirName by using Imakefile..." @@ -107,7 +111,7 @@ function BuildInDir([string]$path) { Set-Location "$path/" & ./compile.sh - if ($lastExitCode -ne "0") { throw "Script 'compile.sh' exited with error code $lastExitCode" } + if ($lastExitCode -ne "0") { throw "Executing './compile.sh' exited with error code $lastExitCode" } & make -j4 if ($lastExitCode -ne "0") { throw "Executing 'make -j4' has failed" } @@ -117,7 +121,7 @@ function BuildInDir([string]$path) { Set-Location "$path/attower/src/build/DevBuild/" & ./build.bat build-all-release - if ($lastExitCode -ne "0") { throw "Script 'build.bat' exited with error code $lastExitCode" } + if ($lastExitCode -ne "0") { throw "Executing 'build.bat build-all-release' exited with error code $lastExitCode" } } elseif (Test-Path "$path/$dirName" -pathType container) { "⏳ No make rule found, trying subfolder 📂$($dirName)..."