diff --git a/.gitmodules b/.gitmodules index 1c83be8bb..d09e656e9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,7 @@ path = BuildUtils url = https://github.com/aaubry/BuildUtils.git branch = master +[submodule "BuildUtils.UnityPrerequisites"] + path = BuildUtils.UnityPrerequisites + url = https://github.com/aaubry/BuildUtils.UnityPrerequisites.git + branch = master diff --git a/BuildUtils.UnityPrerequisites b/BuildUtils.UnityPrerequisites new file mode 160000 index 000000000..b83028b96 --- /dev/null +++ b/BuildUtils.UnityPrerequisites @@ -0,0 +1 @@ +Subproject commit b83028b96dffdc0bcbff14e4ddeaddd8c94a950d diff --git a/build.ps1 b/build.ps1 index ebfbf040b..2a6ff7cf7 100644 --- a/build.ps1 +++ b/build.ps1 @@ -2,52 +2,14 @@ $build_unity = $true -function Download-File($url, $path, $description) { - $wc = New-Object System.Net.WebClient - - Write-Host "Downloading $description" - Write-Host ": |---------|---------|---------|---------|---------|---------|---------|---------|---------|---------|" - Write-Host ": " -NoNewline - - $previousPercentage = 0 - $e = Register-ObjectEvent -InputObject $wc -EventName DownloadProgressChanged -Action { - $currentPercentage = $Args[1].ProgressPercentage - for(; $previousPercentage -le $currentPercentage; $previousPercentage++) { - Write-Host "#" -NoNewline - } - } - $e = Register-ObjectEvent -InputObject $wc -EventName DownloadFileCompleted -Action { - Write-Host " Done" - New-Event "DownloadComplete" - } - - $canceling = $true - $wc.DownloadFileAsync($url, $path, $description) - try { - $e = Wait-Event "DownloadComplete" - $canceling = $false - } - finally { - if($canceling) { - Write-Host " - cancelling - " -NoNewline - } - $wc.CancelAsync() - $e = Wait-Event "DownloadComplete" - Remove-Event "DownloadComplete" - Write-Host "" - } -} - $targets = "Release-Unsigned", "Release-Signed", "Release-Portable-Unsigned", "Release-Portable-Signed" if($build_unity) { $targets += "Release-UnitySubset-v35" - Download-File "https://visualstudiogallery.msdn.microsoft.com/20b80b8c-659b-45ef-96c1-437828fe7cf2/file/92287/8/Visual%20Studio%202013%20Tools%20for%20Unity.msi" "$env:TEMP\Unity.msi" "VS Tools for Unity" - - Write-Host "Installing VS Tools for Unity... " -NoNewline - & .\BuildUtils\MsiInstaller\bin\Release\MsiInstaller.exe "$env:TEMP\Unity.msi" - Write-Host "Done" + cd BuildUtils.UnityPrerequisites + .\install.ps1 + cd .. } $targets |