Skip to content

Commit b15e011

Browse files
authored
Merge pull request #9295 from microsoft/feature/docs
Create a pipeline for docs binaries generation
2 parents b6a8261 + 6cf327f commit b15e011

File tree

5 files changed

+203
-9
lines changed

5 files changed

+203
-9
lines changed

Assets/MRTK/SDK/Editor/Inspectors/Experimental/InteractiveElement/MRTK.SDK.Editor.Experimental.Interactive.asmdef

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "Microsoft.MixedReality.Toolkit.SDK.Experimental.Editor.Interactive",
33
"references": [
4-
"GUID:829e63f67f814aae828de5ab51326cf6",
5-
"GUID:ef09babcbd528db4aaac034285605f7f",
6-
"GUID:a7a4c34601384f9389d5c4207f3c6331",
7-
"GUID:7404ed9ad29ad3844ac3a261c8d45b60",
8-
"GUID:3fd8365dd9cf49cc9886d651945cdaae",
9-
"GUID:8b7cc3e86d77403b8b984c08cbaeaf8f"
4+
"Microsoft.MixedReality.Toolkit.SDK.Editor",
5+
"Microsoft.MixedReality.Toolkit.SDK.Experimental.Interactive",
6+
"Microsoft.MixedReality.Toolkit",
7+
"Microsoft.MixedReality.Toolkit.Services.InputSystem",
8+
"Microsoft.MixedReality.Toolkit.Editor.Inspectors",
9+
"Microsoft.MixedReality.Toolkit.SDK"
1010
],
1111
"includePlatforms": [
1212
"Editor"

Assets/MRTK/SDK/Experimental/InteractiveElement/MRTK.SDK.Experimental.Interactive.asmdef

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "Microsoft.MixedReality.Toolkit.SDK.Experimental.Interactive",
33
"references": [
4-
"GUID:8b7cc3e86d77403b8b984c08cbaeaf8f",
5-
"GUID:a7a4c34601384f9389d5c4207f3c6331",
6-
"GUID:7404ed9ad29ad3844ac3a261c8d45b60"
4+
"Microsoft.MixedReality.Toolkit.SDK",
5+
"Microsoft.MixedReality.Toolkit",
6+
"Microsoft.MixedReality.Toolkit.Services.InputSystem"
77
],
88
"includePlatforms": [],
99
"excludePlatforms": [],

pipelines/config/settings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ variables:
55
# Unity version on internal build agents (release builds)
66
Unity2018VersionInternal: Unity2018.4.23f1
77
Unity2019VersionInternal: Unity2019.4.6f1
8+
Unity2020VersionInternal: Unity2020.2.2f1
89

910
# Note that when updating this value also ensure that you update the
1011
# following locations to match. There will be a CI failure if they don't

pipelines/docs-binaries.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
variables:
2+
- template: config/settings.yml
3+
4+
trigger:
5+
- releases/*
6+
pr: none
7+
8+
jobs:
9+
- job: BuildUnity2020
10+
pool:
11+
name: Analog On-Prem
12+
demands:
13+
- ${{ variables.Unity2020VersionInternal }}
14+
- COG-UnityCache-WUS2-01
15+
16+
steps:
17+
- checkout: self
18+
clean: true
19+
fetchDepth: 1
20+
21+
- task: PowerShell@2
22+
displayName: 'Create binaries for docs generation'
23+
inputs:
24+
targetType: filePath
25+
filePath: ./scripts/packaging/createbinariesfordocs.ps1
26+
arguments: >
27+
-Version $(MRTKVersion)
28+
-UnityDirectory ${Env:$(Unity2020VersionInternal)}/Editor
29+
-OutputDirectory $(Build.ArtifactStagingDirectory)
30+
31+
- task: PublishPipelineArtifact@1
32+
displayName: Publish docs binaries
33+
condition: always()
34+
inputs:
35+
targetPath: $(Build.ArtifactStagingDirectory)
36+
artifactName: DocsBinariesForUnity2020
37+
38+
- job: BuildUnity2019
39+
pool:
40+
name: Analog On-Prem
41+
demands:
42+
- ${{ variables.Unity2019VersionInternal }}
43+
- COG-UnityCache-WUS2-01
44+
45+
steps:
46+
- checkout: self
47+
clean: true
48+
fetchDepth: 1
49+
50+
- task: PowerShell@2
51+
displayName: 'Create binaries for docs generation'
52+
inputs:
53+
targetType: filePath
54+
filePath: ./scripts/packaging/createbinariesfordocs.ps1
55+
arguments: >
56+
-Version $(MRTKVersion)
57+
-UnityDirectory ${Env:$(Unity2019VersionInternal)}/Editor
58+
-OutputDirectory $(Build.ArtifactStagingDirectory)
59+
60+
- task: PublishPipelineArtifact@1
61+
displayName: Publish docs binaries
62+
condition: always()
63+
inputs:
64+
targetPath: $(Build.ArtifactStagingDirectory)
65+
artifactName: DocsBinariesForUnity2019
66+
67+
- job: BuildUnity2018
68+
pool:
69+
name: Analog On-Prem
70+
demands:
71+
- ${{ variables.Unity2018VersionInternal }}
72+
- COG-UnityCache-WUS2-01
73+
74+
steps:
75+
- checkout: self
76+
clean: true
77+
fetchDepth: 1
78+
79+
- task: PowerShell@2
80+
displayName: 'Create binaries for docs generation'
81+
inputs:
82+
targetType: filePath
83+
filePath: ./scripts/packaging/createbinariesfordocs.ps1
84+
arguments: >
85+
-Version $(MRTKVersion)
86+
-UnityDirectory ${Env:$(Unity2018VersionInternal)}/Editor
87+
-OutputDirectory $(Build.ArtifactStagingDirectory)
88+
89+
- task: PublishPipelineArtifact@1
90+
displayName: Publish docs binaries
91+
inputs:
92+
targetPath: $(Build.ArtifactStagingDirectory)
93+
artifactName: DocsBinariesForUnity2018
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# Licensed under the MIT License.
3+
4+
<#
5+
.SYNOPSIS
6+
Builds the binaries needed to generate API reference docs for Mixed Reality Toolkit.
7+
.DESCRIPTION
8+
Builds the binaries needed to generate API reference docs for Mixed Reality Toolkit.
9+
.PARAMETER OutputDirectory
10+
Where should we place the output?
11+
.PARAMETER Version
12+
What version of the artifacts should we build?
13+
.PARAMETER UnityDirectory
14+
Where is the directory of the version of Unity we use to generate the binaries?
15+
#>
16+
param(
17+
[string]$OutputDirectory,
18+
[ValidatePattern("^\d+\.\d+\.\d+$")]
19+
[string]$Version,
20+
[string]$UnityDirectory
21+
)
22+
23+
Write-Verbose "Checking parameters:"
24+
if (-not $OutputDirectory) {
25+
throw "-OutputDirectory is a required flag"
26+
}
27+
if (-not $Version) {
28+
throw "-Version is a required flag"
29+
}
30+
if (-not $UnityDirectory) {
31+
throw "-UnityDirectory is a required flag"
32+
}
33+
34+
$unityEditor = Get-ChildItem $UnityDirectory -Filter 'Unity.exe' -Recurse | Select-Object -First 1 -ExpandProperty FullName
35+
if (-not $unityEditor) {
36+
throw "Unable to find the Unity editor executable in $UnityDirectory"
37+
}
38+
Write-Verbose $unityEditor;
39+
40+
function RunUnityTask {
41+
param([string]$taskName, [string]$methodToExecute)
42+
Write-Output "Starting running Unity task: $($taskName)"
43+
$logFile = New-Item -Path "Logs\Unity.$($taskName).$($Version).log" -ItemType File -Force
44+
45+
$ProjectLocation = Resolve-Path "$(Get-Location)\..\"
46+
Write-Output $ProjectLocation
47+
$proc = Start-Process -FilePath "$unityEditor" -ArgumentList "-projectPath $ProjectLocation -batchmode -executeMethod $($methodToExecute) -logFile $($logFile.FullName) -nographics -quit" -PassThru
48+
$ljob = Start-Job -ScriptBlock { param($log) Get-Content "$log" -Wait } -ArgumentList $logFile.FullName
49+
50+
while (-not $proc.HasExited -and $ljob.HasMoreData) {
51+
Receive-Job $ljob
52+
Start-Sleep -Milliseconds 200
53+
}
54+
Receive-Job $ljob
55+
56+
Stop-Job $ljob
57+
58+
Remove-Job $ljob
59+
Stop-Process $proc
60+
if ($proc.ExitCode -ge 1) {
61+
Write-Error "Failed to execute Unity Task '$($taskName)', see log '$($logFile)' for more information."
62+
exit($proc.ExitCode)
63+
}
64+
}
65+
66+
$OriginalPath = Get-Location
67+
try {
68+
Set-Location (Split-Path $MyInvocation.MyCommand.Path)
69+
Set-Location "..\\..\\"
70+
New-Item -ItemType Directory "BinariesForDocs" -ErrorAction SilentlyContinue
71+
Set-Location "BinariesForDocs"
72+
73+
### Run MSBuild Generation
74+
RunUnityTask -taskName "MSBuildGeneration" -methodToExecute "Microsoft.MixedReality.Toolkit.MSBuild.MSBuildTools.GenerateSDKProjects"
75+
76+
### Build the needed flavor for MRTK
77+
Write-Output "============ Building InEditor WSA ============ "
78+
dotnet msbuild ..\NuGet\BuildSource.proj -target:BuildWSAEditor > "Logs\Build.InEditor.WSA.$($Version).log"
79+
if ($lastexitcode -ge 1) {
80+
Write-Error "Building InEditor WSA Failed! See log file for more information $(Get-Location)\Logs\Build.InEditor.WSA.$($Version).log";
81+
Copy-Item -Path "Logs\Unity.MSBuildGeneration.$($Version).log" -Destination "$OutputDirectory\"
82+
exit($lastexitcode)
83+
}
84+
85+
Write-Output "============ Copying the binaries ============ "
86+
New-Item -ItemType Directory "MRTK_$($Version)"
87+
New-Item -ItemType Directory "MRTK_$($Version)\dependencies"
88+
Remove-Item "..\MSBuild\Publish\InEditor\WSA\*.pdb"
89+
Move-Item "..\MSBuild\Publish\InEditor\WSA\Microsoft.MixedReality.Toolkit*" "MRTK_$($Version)\"
90+
Move-Item "..\MSBuild\Publish\InEditor\WSA\*.dll" "MRTK_$($Version)\dependencies\"
91+
Copy-Item "$($UnityDirectory)\Data\Managed\UnityEditor.dll" "MRTK_$($Version)\dependencies\"
92+
Copy-Item "$($UnityDirectory)\Data\Managed\UnityEngine.dll" "MRTK_$($Version)\dependencies\"
93+
nuget install Microsoft.Windows.MixedReality.DotNetWinRT -OutputDirectory packages
94+
Copy-Item "packages\Microsoft.Windows.MixedReality.DotNetWinRT*\lib\unity\net46\Microsoft.Windows.MixedReality.DotNetWinRT.dll" "MRTK_$($Version)\dependencies\"
95+
Copy-Item -Path "MRTK_$($Version)" -Destination "$OutputDirectory" -Recurse
96+
97+
}
98+
finally {
99+
Set-Location $OriginalPath
100+
}

0 commit comments

Comments
 (0)