-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.ps1
More file actions
65 lines (57 loc) · 1.26 KB
/
build.ps1
File metadata and controls
65 lines (57 loc) · 1.26 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<#
Build Script
#>
function DeleteFolder($file){
if (Test-Path $file){
Remove-Item $file -Force -Recurse
}
}
function DeleteFile($file){
if (Test-Path $file){
Remove-Item $file -Force
}
}
function is64bit() {
return ([IntPtr]::Size -eq 8)
}
function get-programfilesdir() {
if (is64bit -eq $true) {
(Get-Item "Env:ProgramFiles(x86)").Value
}
else {
(Get-Item "Env:ProgramFiles").Value
}
}
function get-X64() {
if (is64bit -eq $true) {
return "X64"
}
else {
return ""
}
}
function LoadFile($file){
$lines = Get-Content $file
$text = ""
foreach($line in $lines){
$text += $line + "`r`n"
}
return $text
}
#cd "C:\DVT\.NET\DSSharpLibrary"
"Build..."
$CLR_VERSION = "0.1.10.0"
$OS_VERSION = "0.1.10.0"
$MSBUILD40 = "C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
$NUGET = ".\nuget.exe"
$X64 = get-X64
# Clean stuff before we start
DeleteFolder "Output"
# Create version file
$Properties = "/p:Configuration=Debug;X64=$X64"
& $MSBUILD40 Build.xml /v:m /t:BuildDebug $Properties
if($LASTEXITCODE -ne 0){ throw "Debug build failed" }
$Properties = "/p:Configuration=Release;X64=$X64"
& $MSBUILD40 Build.xml /v:m /t:BuildRelease $Properties
if($LASTEXITCODE -ne 0){ throw "Release build failed" }
"Done"