-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.ps1
40 lines (30 loc) · 1009 Bytes
/
build.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
$ErrorActionPreference = "Stop"
$platform="Windows"
# Make sure the source is up to date
&git submodule init
&git submodule update
if ($LASTEXITCODE -ne 0)
{
Write-Error "Git failed"
exit -1
}
# Get a version of NuGet
if (!(Test-Path .\nuget.exe))
{
Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile nuget.exe
}
# Clean up the output directory first
Remove-Item -Force -Recurse -ErrorAction Continue contents
function BuildForRid([string] $rid, [string] $toolchain, [string] $buildscript)
{
Write-Host "compiling for $rid using $toolchain"
&rustup default $toolchain
&cmd /c $buildscript
# create a folder for the package to reside in
&mkdir -p contents/runtimes/$rid/native/
Copy-Item rure/target/release/rure* contents/runtimes/$rid/native/
}
BuildForRid "win-x86" "stable-i686" "buildi686.bat"
BuildForRid "win-x64" "stable-x86_64" "buildx86_64.bat"
# Pack it all up
&.\nuget.exe pack IronRure.Batteries-$platform.nuspec