|
| 1 | +# Copyright (c) Microsoft Corporation. |
| 2 | +# Licensed under the MIT License. |
| 3 | +# |
| 4 | +# https://go.microsoft.com/fwlink/?LinkID=324981 |
| 5 | + |
| 6 | +# Builds the library using the Microsoft GDK. |
| 7 | + |
| 8 | +schedules: |
| 9 | +- cron: "0 6 * * *" |
| 10 | + displayName: 'Nightly build' |
| 11 | + branches: |
| 12 | + include: |
| 13 | + - main |
| 14 | + |
| 15 | +trigger: none |
| 16 | + |
| 17 | +pr: |
| 18 | + branches: |
| 19 | + include: |
| 20 | + - main |
| 21 | + paths: |
| 22 | + include: |
| 23 | + - CMakeList.txt |
| 24 | + - build/UVAtlas-GitHub-GDK-Dev17.yml |
| 25 | + - build/*.in |
| 26 | + - build/*.cmake |
| 27 | + - build/SetupBWOI.* |
| 28 | + |
| 29 | +resources: |
| 30 | + repositories: |
| 31 | + - repository: self |
| 32 | + type: git |
| 33 | + ref: refs/heads/main |
| 34 | + trigger: none |
| 35 | + |
| 36 | +name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r) |
| 37 | + |
| 38 | +pool: |
| 39 | + vmImage: windows-2022 |
| 40 | + |
| 41 | +variables: |
| 42 | + Codeql.Enabled: false |
| 43 | + EXTRACTED_FOLDER: $(ExtractedFolder) |
| 44 | + GDK_EDITION: $(GDKEditionNumber) |
| 45 | + GDKEnableBWOI: true |
| 46 | + URL_FEED: $(ADOFeedURL) |
| 47 | + VC_PATH: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC' |
| 48 | + skipNugetSecurityAnalysis: true # We explicitly call this task so we don't need it to be auto-injected |
| 49 | + |
| 50 | +jobs: |
| 51 | +- job: BUILD_GDK_CMAKE_SCAR |
| 52 | + displayName: 'Microsoft Game Development Kit (GDK) using CMake (Scarlett)' |
| 53 | + timeoutInMinutes: 120 |
| 54 | + cancelTimeoutInMinutes: 1 |
| 55 | + steps: |
| 56 | + - checkout: self |
| 57 | + clean: true |
| 58 | + fetchTags: false |
| 59 | + - task: NuGetToolInstaller@1 |
| 60 | + displayName: 'Use NuGet' |
| 61 | + - task: PowerShell@2 |
| 62 | + displayName: 'Create nuget.config with single source' |
| 63 | + inputs: |
| 64 | + targetType: inline |
| 65 | + script: | |
| 66 | + $xml = @' |
| 67 | + <?xml version="1.0" encoding="utf-8"?> |
| 68 | + <configuration> |
| 69 | + <packageSources> |
| 70 | + <clear /> |
| 71 | + </packageSources> |
| 72 | + </configuration> |
| 73 | + '@ |
| 74 | + $xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config" |
| 75 | +
|
| 76 | + - task: NuGetCommand@2 |
| 77 | + # We have to use a nuget.config to provide the feed for the 'nuget install' option. |
| 78 | + displayName: 'NuGet set package source to ADO feed' |
| 79 | + inputs: |
| 80 | + command: custom |
| 81 | + arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config |
| 82 | + - task: nuget-security-analysis@0 |
| 83 | + displayName: 'Secure Supply Chain Analysis' |
| 84 | + - task: NuGetAuthenticate@1 |
| 85 | + displayName: 'NuGet Auth' |
| 86 | + - task: NuGetCommand@2 |
| 87 | + displayName: NuGet install PGDK |
| 88 | + inputs: |
| 89 | + command: custom |
| 90 | + arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) |
| 91 | + - task: NuGetCommand@2 |
| 92 | + displayName: NuGet install GDKX |
| 93 | + inputs: |
| 94 | + command: custom |
| 95 | + arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) |
| 96 | + - task: CmdLine@2 |
| 97 | + displayName: Setup BWOI for GDK command-line |
| 98 | + inputs: |
| 99 | + script: | |
| 100 | + call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat" |
| 101 | + echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath% |
| 102 | + echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja |
| 103 | + echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin |
| 104 | + echo ##vso[task.prependpath]%WindowsSdkBinPath%x64 |
| 105 | + echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64 |
| 106 | + echo ##vso[task.prependpath]%VCToolsInstallDir%bin\HostX64\x64 |
| 107 | + call $(Build.SourcesDirectory)\build\SetupBWOI.cmd $(EXTRACTED_FOLDER) $(GDK_EDITION) Scarlett |
| 108 | + echo ##vso[task.setvariable variable=GameDKLatest;]%GameDKLatest% |
| 109 | + echo ##vso[task.setvariable variable=GRDKLatest;]%GRDKLatest% |
| 110 | + echo ##vso[task.setvariable variable=GXDKLatest;]%GXDKLatest% |
| 111 | + echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE% |
| 112 | + echo ##vso[task.setvariable variable=LIB;]%LIB% |
| 113 | + echo ##vso[task.prependpath]%ADDBIN% |
| 114 | +
|
| 115 | + failOnStderr: true |
| 116 | + - task: CMake@1 |
| 117 | + displayName: 'CMake (MSVC): Config Scarlett Debug' |
| 118 | + inputs: |
| 119 | + cwd: '$(Build.SourcesDirectory)' |
| 120 | + cmakeArgs: --preset=x64-Debug-Scarlett |
| 121 | + - task: CMake@1 |
| 122 | + displayName: 'CMake (MSVC): Build Scarlett Debug' |
| 123 | + inputs: |
| 124 | + cwd: '$(Build.SourcesDirectory)' |
| 125 | + cmakeArgs: --build out\build\x64-Debug-Scarlett |
| 126 | + - task: CMake@1 |
| 127 | + displayName: 'CMake (MSVC): Config Scarlett Release' |
| 128 | + inputs: |
| 129 | + cwd: '$(Build.SourcesDirectory)' |
| 130 | + cmakeArgs: --preset=x64-Release-Scarlett |
| 131 | + - task: CMake@1 |
| 132 | + displayName: 'CMake (MSVC): Build Scarlett Release' |
| 133 | + inputs: |
| 134 | + cwd: '$(Build.SourcesDirectory)' |
| 135 | + cmakeArgs: --build out\build\x64-Release-Scarlett |
| 136 | + - task: CMake@1 |
| 137 | + displayName: 'CMake (Clang): Config Scarlett Debug' |
| 138 | + inputs: |
| 139 | + cwd: '$(Build.SourcesDirectory)' |
| 140 | + cmakeArgs: --preset=x64-Debug-Scarlett-Clang |
| 141 | + - task: CMake@1 |
| 142 | + displayName: 'CMake (Clang): Build Scarlett Debug' |
| 143 | + inputs: |
| 144 | + cwd: '$(Build.SourcesDirectory)' |
| 145 | + cmakeArgs: --build out\build\x64-Debug-Scarlett-Clang |
| 146 | + - task: CMake@1 |
| 147 | + displayName: 'CMake (Clang): Config Scarlett Release' |
| 148 | + inputs: |
| 149 | + cwd: '$(Build.SourcesDirectory)' |
| 150 | + cmakeArgs: --preset=x64-Release-Scarlett-Clang |
| 151 | + - task: CMake@1 |
| 152 | + displayName: 'CMake (Clang): Build Scarlett Release' |
| 153 | + inputs: |
| 154 | + cwd: '$(Build.SourcesDirectory)' |
| 155 | + cmakeArgs: --build out\build\x64-Release-Scarlett-Clang |
| 156 | + - task: DeleteFiles@1 |
| 157 | + inputs: |
| 158 | + Contents: 'out/build' |
| 159 | + - task: CMake@1 |
| 160 | + displayName: 'CMake (MSVC, DLL): Config Scarlett Debug' |
| 161 | + inputs: |
| 162 | + cwd: '$(Build.SourcesDirectory)' |
| 163 | + cmakeArgs: --preset=x64-Debug-Scarlett -DBUILD_SHARED_LIBS=ON |
| 164 | + - task: CMake@1 |
| 165 | + displayName: 'CMake (MSVC, DLL): Build Scarlett Debug' |
| 166 | + inputs: |
| 167 | + cwd: '$(Build.SourcesDirectory)' |
| 168 | + cmakeArgs: --build out\build\x64-Debug-Scarlett |
| 169 | + |
| 170 | +- job: BUILD_GDK_CMAKE_XBONE |
| 171 | + displayName: 'Microsoft Game Development Kit (GDK) using CMake (XboxOne)' |
| 172 | + timeoutInMinutes: 120 |
| 173 | + cancelTimeoutInMinutes: 1 |
| 174 | + steps: |
| 175 | + - checkout: self |
| 176 | + clean: true |
| 177 | + fetchTags: false |
| 178 | + - task: NuGetToolInstaller@1 |
| 179 | + displayName: 'Use NuGet' |
| 180 | + - task: PowerShell@2 |
| 181 | + displayName: 'Create nuget.config with single source' |
| 182 | + inputs: |
| 183 | + targetType: inline |
| 184 | + script: | |
| 185 | + $xml = @' |
| 186 | + <?xml version="1.0" encoding="utf-8"?> |
| 187 | + <configuration> |
| 188 | + <packageSources> |
| 189 | + <clear /> |
| 190 | + </packageSources> |
| 191 | + </configuration> |
| 192 | + '@ |
| 193 | + $xml | Set-Content -Path "$(Build.SourcesDirectory)\NuGet.config" |
| 194 | +
|
| 195 | + - task: NuGetCommand@2 |
| 196 | + # We have to use a nuget.config to provide the feed for the 'nuget install' option. |
| 197 | + displayName: 'NuGet set package source to ADO feed' |
| 198 | + inputs: |
| 199 | + command: custom |
| 200 | + arguments: sources add -Name xboxgdk -Source $(URL_FEED) -ConfigFile $(Build.SourcesDirectory)\NuGet.config |
| 201 | + - task: nuget-security-analysis@0 |
| 202 | + displayName: 'Secure Supply Chain Analysis' |
| 203 | + - task: NuGetAuthenticate@1 |
| 204 | + displayName: 'NuGet Auth' |
| 205 | + - task: NuGetCommand@2 |
| 206 | + displayName: NuGet install PGDK |
| 207 | + inputs: |
| 208 | + command: custom |
| 209 | + arguments: install -prerelease Microsoft.GDK.PC.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) |
| 210 | + - task: NuGetCommand@2 |
| 211 | + displayName: NuGet install GDKX |
| 212 | + inputs: |
| 213 | + command: custom |
| 214 | + arguments: install -prerelease Microsoft.GDK.Xbox.$(GDK_EDITION) -ExcludeVersion -OutputDirectory $(EXTRACTED_FOLDER) |
| 215 | + - task: CmdLine@2 |
| 216 | + displayName: Setup BWOI for GDK command-line |
| 217 | + inputs: |
| 218 | + script: | |
| 219 | + call "$(VC_PATH)\Auxiliary\Build\vcvars64.bat" |
| 220 | + echo ##vso[task.setvariable variable=WindowsSdkVerBinPath;]%WindowsSdkVerBinPath% |
| 221 | + echo ##vso[task.prependpath]%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja |
| 222 | + echo ##vso[task.prependpath]%VCINSTALLDIR%Tools\Llvm\x64\bin |
| 223 | + echo ##vso[task.prependpath]%WindowsSdkBinPath%x64 |
| 224 | + echo ##vso[task.prependpath]%WindowsSdkVerBinPath%x64 |
| 225 | + echo ##vso[task.prependpath]%VCToolsInstallDir%bin\HostX64\x64 |
| 226 | + call $(Build.SourcesDirectory)\build\SetupBWOI.cmd $(EXTRACTED_FOLDER) $(GDK_EDITION) XboxOne |
| 227 | + echo ##vso[task.setvariable variable=GameDKLatest;]%GameDKLatest% |
| 228 | + echo ##vso[task.setvariable variable=GRDKLatest;]%GRDKLatest% |
| 229 | + echo ##vso[task.setvariable variable=GXDKLatest;]%GXDKLatest% |
| 230 | + echo ##vso[task.setvariable variable=INCLUDE;]%INCLUDE% |
| 231 | + echo ##vso[task.setvariable variable=LIB;]%LIB% |
| 232 | + echo ##vso[task.prependpath]%ADDBIN% |
| 233 | +
|
| 234 | + failOnStderr: true |
| 235 | + - task: CMake@1 |
| 236 | + displayName: 'CMake (MSVC): Config XboxOne Debug' |
| 237 | + inputs: |
| 238 | + cwd: '$(Build.SourcesDirectory)' |
| 239 | + cmakeArgs: --preset=x64-Debug-XboxOne |
| 240 | + - task: CMake@1 |
| 241 | + displayName: 'CMake (MSVC): Build XboxOne Debug' |
| 242 | + inputs: |
| 243 | + cwd: '$(Build.SourcesDirectory)' |
| 244 | + cmakeArgs: --build out\build\x64-Debug-XboxOne |
| 245 | + - task: CMake@1 |
| 246 | + displayName: 'CMake (MSVC): Config XboxOne Release' |
| 247 | + inputs: |
| 248 | + cwd: '$(Build.SourcesDirectory)' |
| 249 | + cmakeArgs: --preset=x64-Release-XboxOne |
| 250 | + - task: CMake@1 |
| 251 | + displayName: 'CMake (MSVC): Build XboxOne Release' |
| 252 | + inputs: |
| 253 | + cwd: '$(Build.SourcesDirectory)' |
| 254 | + cmakeArgs: --build out\build\x64-Release-XboxOne |
| 255 | + - task: CMake@1 |
| 256 | + displayName: 'CMake (Clang): Config XboxOne Debug' |
| 257 | + inputs: |
| 258 | + cwd: '$(Build.SourcesDirectory)' |
| 259 | + cmakeArgs: --preset=x64-Debug-XboxOne-Clang |
| 260 | + - task: CMake@1 |
| 261 | + displayName: 'CMake (Clang): Build XboxOne Debug' |
| 262 | + inputs: |
| 263 | + cwd: '$(Build.SourcesDirectory)' |
| 264 | + cmakeArgs: --build out\build\x64-Debug-XboxOne-Clang |
| 265 | + - task: CMake@1 |
| 266 | + displayName: 'CMake (Clang): Config XboxOne Release' |
| 267 | + inputs: |
| 268 | + cwd: '$(Build.SourcesDirectory)' |
| 269 | + cmakeArgs: --preset=x64-Release-XboxOne-Clang |
| 270 | + - task: CMake@1 |
| 271 | + displayName: 'CMake (Clang): Build XboxOne Release' |
| 272 | + inputs: |
| 273 | + cwd: '$(Build.SourcesDirectory)' |
| 274 | + cmakeArgs: --build out\build\x64-Release-XboxOne-Clang |
| 275 | + - task: DeleteFiles@1 |
| 276 | + inputs: |
| 277 | + Contents: 'out/build' |
| 278 | + - task: CMake@1 |
| 279 | + displayName: 'CMake (MSVC, DLL): Config XboxOne Debug' |
| 280 | + inputs: |
| 281 | + cwd: '$(Build.SourcesDirectory)' |
| 282 | + cmakeArgs: --preset=x64-Debug-XboxOne -DBUILD_SHARED_LIBS=ON |
| 283 | + - task: CMake@1 |
| 284 | + displayName: 'CMake (MSVC, DLL): Build XboxOne Debug' |
| 285 | + inputs: |
| 286 | + cwd: '$(Build.SourcesDirectory)' |
| 287 | + cmakeArgs: --build out\build\x64-Debug-XboxOne |
0 commit comments