This repository has been archived by the owner on Jan 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tool.ps1
71 lines (55 loc) · 1.42 KB
/
tool.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
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
66
67
68
69
70
71
$ErrorActionPreference = "Stop"
function p([string]$out) {
Write-Host $out
}
function c([string]$cmd) {
p "> $cmd"
Invoke-Expression $cmd
}
function help() {
p "OVRSalt Dev Tools"
p "~~~~~~~~~~~~~~~~~"
p ""
p "Commands:"
p " help - this help text"
p " vr - builds prerequistites for a VR dev environment"
p " ui - starts UI dev environment"
p " rel - builds the entire project for release"
}
function vr() {
Set-Location $PSScriptRoot\Frontend
c "yarn"
c "yarn build"
Set-Location $PSScriptRoot\Runtime
c "yarn"
p ""
p "** OK. You're good to build and run stuff in Visual Studio now."
Set-Location $PSScriptRoot
}
function ui() {
Set-Location $PSScriptRoot\Frontend
c "yarn"
c "yarn start"
Set-Location $PSScriptRoot
}
function rel() {
$BuildRoot = $args[1]
if ($BuildRoot -match "") {
$BuildRoot = ".\x64\Release"
}
vr
Set-Location $PSScriptRoot\Runtime
c "yarn build"
Set-Location $PSScriptRoot
$ErrorActionPreference = ""
Copy-Item -Recurse $PSScriptRoot\Backend\lib\openvr-sdk\bin\win64\* $BuildRoot
mkdir $BuildRoot\runtime
Copy-Item -Recurse $PSScriptRoot\Runtime\build\* $BuildRoot\runtime
$ErrorActionPreference = "Stop"
Set-Location $PSScriptRoot
}
function main([string]$action = "help") {
Set-Location $PSScriptRoot
&$action
}
main $args[0]