mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-31 23:45:48 +02:00
Added support for Cargo builds (for Rust programming language)
This commit is contained in:
parent
6c6587eed3
commit
db1d2dd871
@ -2,9 +2,10 @@
|
|||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Builds a repo
|
Builds a repo
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script builds a Git repository by supporting the build systems: autogen, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
|
This PowerShell script builds a Git repository by supporting the following build
|
||||||
|
systems: autogen, cargo, cmake, configure, Gradle, Imakefile, Makefile, and Meson.
|
||||||
.PARAMETER path
|
.PARAMETER path
|
||||||
Specifies the path to the Git repository (current working directory by default)
|
Specifies the file path to the Git repository (default: current working directory)
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./build-repo.ps1 C:\Repos\ninja
|
PS> ./build-repo.ps1 C:\Repos\ninja
|
||||||
⏳ Building 📂ninja by using CMake...
|
⏳ Building 📂ninja by using CMake...
|
||||||
@ -39,6 +40,13 @@ function BuildFolder([string]$path) {
|
|||||||
"⏳ (4/4) Executing 'ctest -V'... (if tests are provided)"
|
"⏳ (4/4) Executing 'ctest -V'... (if tests are provided)"
|
||||||
& ctest -V
|
& ctest -V
|
||||||
if ($lastExitCode -ne 0) { throw "Executing 'ctest -V' failed with exit code $lastExitCode" }
|
if ($lastExitCode -ne 0) { throw "Executing 'ctest -V' failed with exit code $lastExitCode" }
|
||||||
|
} elseif (Test-Path "$path/.cargo/release.toml" -pathType leaf) {
|
||||||
|
"⏳ (1/4) Building 📂$dirName by using Cargo..."
|
||||||
|
Set-Location "$path/"
|
||||||
|
|
||||||
|
& cargo build --config .cargo/release.toml --release
|
||||||
|
if ($lastExitCode -ne 0) { throw "Executing 'cargo build' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
} elseif (Test-Path "$path/autogen.sh" -pathType leaf) {
|
} elseif (Test-Path "$path/autogen.sh" -pathType leaf) {
|
||||||
"⏳ Building 📂$dirName by executing 'autogen.sh'..."
|
"⏳ Building 📂$dirName by executing 'autogen.sh'..."
|
||||||
Set-Location "$path/"
|
Set-Location "$path/"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user