forked from Nova-reward/Nova-Rewards
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-contracts.ps1
More file actions
16 lines (12 loc) · 786 Bytes
/
Copy pathbuild-contracts.ps1
File metadata and controls
16 lines (12 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ErrorActionPreference = "Stop"
$gnuRustc = Join-Path $env:USERPROFILE ".rustup\toolchains\stable-x86_64-pc-windows-gnu\bin\rustc.exe"
$gnuCargo = Join-Path $env:USERPROFILE ".rustup\toolchains\stable-x86_64-pc-windows-gnu\bin\cargo.exe"
$cargo = if (Test-Path $gnuCargo) { $gnuCargo } else { (Get-Command cargo -ErrorAction Stop).Source }
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
Set-Location $repoRoot
$env:PATH = (($env:PATH -split ";") | Where-Object { $_ -and $_ -notmatch "\\Git\\usr\\bin$" } | Select-Object -Unique) -join ";"
if (Test-Path $gnuRustc) {
$env:RUSTC = $gnuRustc
}
& $cargo build --manifest-path contracts/Cargo.toml --workspace --target wasm32v1-none --release
Write-Host "Built contracts into contracts/target/wasm32v1-none/release"