@@ -35,26 +35,26 @@ $unityEditor = Get-ChildItem $UnityDirectory -Filter 'Unity.exe' -Recurse | Sele
35
35
if (-not $unityEditor ) {
36
36
throw " Unable to find the Unity editor executable in $UnityDirectory "
37
37
}
38
- Write-Verbose $unityEditor ;
38
+ Write-Verbose $unityEditor
39
39
40
40
function RunUnityTask {
41
41
param ([string ]$taskName , [string ]$methodToExecute )
42
42
Write-Output " Starting running Unity task: $ ( $taskName ) "
43
43
$logFile = New-Item - Path " Logs\Unity.$ ( $taskName ) .$ ( $Version ) .log" - ItemType File - Force
44
-
44
+
45
45
$ProjectLocation = Resolve-Path " $ ( Get-Location ) \..\"
46
46
Write-Output $ProjectLocation
47
47
$proc = Start-Process - FilePath " $unityEditor " - ArgumentList " -projectPath $ProjectLocation -batchmode -executeMethod $ ( $methodToExecute ) -logFile $ ( $logFile.FullName ) -nographics -quit" - PassThru
48
48
$ljob = Start-Job - ScriptBlock { param ($log ) Get-Content " $log " - Wait } - ArgumentList $logFile.FullName
49
-
49
+
50
50
while (-not $proc.HasExited -and $ljob.HasMoreData ) {
51
51
Receive-Job $ljob
52
52
Start-Sleep - Milliseconds 200
53
53
}
54
54
Receive-Job $ljob
55
-
55
+
56
56
Stop-Job $ljob
57
-
57
+
58
58
Remove-Job $ljob
59
59
Stop-Process $proc
60
60
if ($proc.ExitCode -ge 1 ) {
@@ -75,14 +75,15 @@ try {
75
75
76
76
# ## Build the needed flavor for MRTK
77
77
Write-Output " ============ Building InEditor WSA ============ "
78
- $logFilePath = " Logs\Build.InEditor.WSA.$ ( $Version ) .log"
78
+ $logFilePath = " $ ( Get-Location ) \ Logs\Build.InEditor.WSA.$ ( $Version ) .log"
79
79
dotnet msbuild ..\NuGet\BuildSource.proj - target:BuildWSAEditor > $logFilePath
80
80
if ($lastexitcode -ge 1 ) {
81
- Write-Error " Building InEditor WSA Failed! See log file for more information $ ( Get-Location ) \$logFilePath " ;
82
- Copy-Item - Path $logFilePath - Destination " $OutputDirectory \"
81
+ Write-Output " Copying $logFilePath to $OutputDirectory "
82
+ Copy-Item - Path $logFilePath - Destination " $OutputDirectory "
83
+ Write-Error " Building InEditor WSA Failed! See log file for more information $logFilePath "
83
84
exit ($lastexitcode )
84
85
}
85
-
86
+
86
87
Write-Output " ============ Copying the binaries ============ "
87
88
New-Item - ItemType Directory " MRTK_$ ( $Version ) "
88
89
New-Item - ItemType Directory " MRTK_$ ( $Version ) \dependencies"
99
100
nuget install Microsoft.Windows.MixedReality.DotNetWinRT - OutputDirectory packages
100
101
Copy-Item " packages\Microsoft.Windows.MixedReality.DotNetWinRT*\lib\unity\net46\Microsoft.Windows.MixedReality.DotNetWinRT.dll" " MRTK_$ ( $Version ) \dependencies\"
101
102
Copy-Item - Path " MRTK_$ ( $Version ) " - Destination " $OutputDirectory " - Recurse
102
-
103
103
}
104
104
finally {
105
105
Set-Location $OriginalPath
0 commit comments