mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-04 04:16:12 +01:00
Update ADO pipeline to use GDK new layouts for 2510 (#649)
This commit is contained in:
@@ -12,27 +12,11 @@
|
||||
|
||||
<_AlternativeVCTargetsPath170>$(ExtractedFolder)VCTargets170\</_AlternativeVCTargetsPath170>
|
||||
<_AlternativeVCTargetsPath160>$(ExtractedFolder)VCTargets160\</_AlternativeVCTargetsPath160>
|
||||
<_AlternativeVCTargetsPath150 Condition="'$(GDKEditionNumber)' != '' AND '$(GDKEditionNumber)' < '241000'">$(ExtractedFolder)VCTargets150\</_AlternativeVCTargetsPath150>
|
||||
|
||||
<!-- Workaround for VS bug -->
|
||||
<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GDKEditionNumber)' != '' AND '$(GDKEditionNumber)' < '220300'">
|
||||
<_PCNuGetPackage>Microsoft.PGDK</_PCNuGetPackage>
|
||||
<_XboxNuGetPackage>Microsoft.GDK</_XboxNuGetPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GDKEditionNumber)' != '' AND '$(GDKEditionNumber)' >= '220300'">
|
||||
<_PCNuGetPackage>Microsoft.GDK.PC</_PCNuGetPackage>
|
||||
<_XboxNuGetPackage>Microsoft.GDK.Xbox</_XboxNuGetPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GDKEditionNumber)' != '' AND '$(GDKEditionNumber)' < '241000'">
|
||||
<_PCNuGetPackage>$(_PCNuGetPackage).$(GDKEditionNumber)</_PCNuGetPackage>
|
||||
<_XboxNuGetPackage>$(_XboxNuGetPackage).$(GDKEditionNumber)</_XboxNuGetPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Windows SDK NuGet -->
|
||||
<Import Condition="'$(WSDKEnableBWOI)' == 'true'"
|
||||
Project="$(ExtractedFolder)Microsoft.Windows.SDK.cpp\build\Microsoft.Windows.SDK.cpp.props" />
|
||||
@@ -47,11 +31,32 @@
|
||||
Project="$(ExtractedFolder)Microsoft.Windows.SDK.cpp.arm64\build\native\Microsoft.Windows.SDK.cpp.arm64.props" />
|
||||
|
||||
<!-- Microsoft GDK NuGet -->
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and $(Platform.Contains('x64')) and Exists('$(ExtractedFolder)$(_PCNuGetPackage)\build\$(_PCNuGetPackage).props')"
|
||||
Project="$(ExtractedFolder)$(_PCNuGetPackage)\build\$(_PCNuGetPackage).props" />
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and Exists('$(ExtractedFolder)Microsoft.GDK.Core\build\Microsoft.GDK.Core.props')"
|
||||
Project="$(ExtractedFolder)Microsoft.GDK.Core\build\Microsoft.GDK.Core.props" />
|
||||
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and $(Platform.Contains('x64')) and Exists('$(ExtractedFolder)$(_XboxNuGetPackage)\build\$(_XboxNuGetPackage).props')"
|
||||
Project="$(ExtractedFolder)$(_XboxNuGetPackage)\build\$(_XboxNuGetPackage).props" />
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and '$(Platform)'=='ARM64' and Exists('$(ExtractedFolder)Microsoft.GDK.Windows\build\Microsoft.GDK.Windows.props')"
|
||||
Project="$(ExtractedFolder)Microsoft.GDK.Windows\build\Microsoft.GDK.Windows.props" />
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and '$(Platform)'=='x64' and Exists('$(ExtractedFolder)Microsoft.GDK.Windows\build\Microsoft.GDK.Windows.props')"
|
||||
Project="$(ExtractedFolder)Microsoft.GDK.Windows\build\Microsoft.GDK.Windows.props" />
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and '$(Platform)'=='Gaming.Desktop.x64' and Exists('$(ExtractedFolder)Microsoft.GDK.Windows\build\Microsoft.GDK.Windows.props')"
|
||||
Project="$(ExtractedFolder)Microsoft.GDK.Windows\build\Microsoft.GDK.Windows.props" />
|
||||
|
||||
<ImportGroup Condition="'$(GDKEnableBWOI)' == 'true' and Exists('$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\build\Microsoft.GDK.Xbox.XboxSeriesX_S.props')">
|
||||
<Import Project="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\build\Microsoft.GDK.Xbox.XboxSeriesX_S.props" />
|
||||
<Import Project="$(ExtractedFolder)Microsoft.GDK.Xbox.GameOS\build\Microsoft.GDK.Xbox.GameOS.props" />
|
||||
</ImportGroup>
|
||||
|
||||
<ImportGroup Condition="'$(GDKEnableBWOI)' == 'true' and Exists('$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\build\Microsoft.GDK.Xbox.XboxOne.props')">
|
||||
<Import Project="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\build\Microsoft.GDK.Xbox.XboxOne.props" />
|
||||
<Import Project="$(ExtractedFolder)Microsoft.GDK.Xbox.GameOS\build\Microsoft.GDK.Xbox.GameOS.props" />
|
||||
</ImportGroup>
|
||||
|
||||
<!-- Microsoft GDK NuGet (Old Layouts)-->
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and $(Platform.Contains('x64')) and Exists('$(ExtractedFolder)Microsoft.GDK.PC\build\Microsoft.GDK.PC.props')"
|
||||
Project="$(ExtractedFolder)Microsoft.GDK.PC\build\Microsoft.GDK.PC.props" />
|
||||
|
||||
<Import Condition="'$(GDKEnableBWOI)' == 'true' and $(Platform.Contains('x64')) and Exists('$(ExtractedFolder)Microsoft.GDK.Xbox\build\Microsoft.GDK.Xbox.props')"
|
||||
Project="$(ExtractedFolder)Microsoft.GDK.Xbox\build\Microsoft.GDK.Xbox.props" />
|
||||
|
||||
<!-- Remove copy of real gameos.xvd since this is a build validation only pipeline -->
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Gaming.Xbox.XboxOne.x64' or '$(Platform)' == 'Gaming.Xbox.Scarlett.x64'">
|
||||
@@ -66,21 +71,18 @@
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Gaming.Xbox.XboxOne.x64' and '$(VisualStudioVersion)' == '16.0'">
|
||||
<AdditionalVCTargetsPath>$(_AlternativeVCTargetsPath160)</AdditionalVCTargetsPath>
|
||||
<DisableInstalledVCTargetsUse>true</DisableInstalledVCTargetsUse>
|
||||
<VCTargetsPath15 Condition="'$(_AlternativeVCTargetsPath150)'!=''">$(_AlternativeVCTargetsPath150)</VCTargetsPath15>
|
||||
<VCTargetsPath16>$(_AlternativeVCTargetsPath160)</VCTargetsPath16>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Gaming.Xbox.Scarlett.x64' and '$(VisualStudioVersion)' == '16.0'">
|
||||
<AdditionalVCTargetsPath>$(_AlternativeVCTargetsPath160)</AdditionalVCTargetsPath>
|
||||
<DisableInstalledVCTargetsUse>true</DisableInstalledVCTargetsUse>
|
||||
<VCTargetsPath15 Condition="'$(_AlternativeVCTargetsPath150)'!=''">$(_AlternativeVCTargetsPath150)</VCTargetsPath15>
|
||||
<VCTargetsPath16>$(_AlternativeVCTargetsPath160)</VCTargetsPath16>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Gaming.Desktop.x64' and '$(VisualStudioVersion)' == '16.0'">
|
||||
<AdditionalVCTargetsPath>$(_AlternativeVCTargetsPath160)</AdditionalVCTargetsPath>
|
||||
<DisableInstalledVCTargetsUse>true</DisableInstalledVCTargetsUse>
|
||||
<VCTargetsPath15 Condition="'$(_AlternativeVCTargetsPath150)'!=''">$(_AlternativeVCTargetsPath150)</VCTargetsPath15>
|
||||
<VCTargetsPath16>$(_AlternativeVCTargetsPath160)</VCTargetsPath16>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -91,21 +93,18 @@
|
||||
-->
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Gaming.Xbox.XboxOne.x64' and '$(VisualStudioVersion)' == '17.0'">
|
||||
<DisableInstalledVCTargetsUse>true</DisableInstalledVCTargetsUse>
|
||||
<VCTargetsPath15 Condition="'$(_AlternativeVCTargetsPath150)'!=''">$(_AlternativeVCTargetsPath150)</VCTargetsPath15>
|
||||
<VCTargetsPath16 Condition="'$(_AlternativeVCTargetsPath160)'!=''">$(_AlternativeVCTargetsPath160)</VCTargetsPath16>
|
||||
<VCTargetsPath17>$(_AlternativeVCTargetsPath170)</VCTargetsPath17>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Gaming.Xbox.Scarlett.x64' and '$(VisualStudioVersion)' == '17.0'">
|
||||
<DisableInstalledVCTargetsUse>true</DisableInstalledVCTargetsUse>
|
||||
<VCTargetsPath15 Condition="'$(_AlternativeVCTargetsPath150)'!=''">$(_AlternativeVCTargetsPath150)</VCTargetsPath15>
|
||||
<VCTargetsPath16 Condition="'$(_AlternativeVCTargetsPath160)'!=''">$(_AlternativeVCTargetsPath160)</VCTargetsPath16>
|
||||
<VCTargetsPath17>$(_AlternativeVCTargetsPath170)</VCTargetsPath17>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Platform)' == 'Gaming.Desktop.x64' and '$(VisualStudioVersion)' == '17.0'">
|
||||
<DisableInstalledVCTargetsUse>true</DisableInstalledVCTargetsUse>
|
||||
<VCTargetsPath15 Condition="'$(_AlternativeVCTargetsPath150)'!=''">$(_AlternativeVCTargetsPath150)</VCTargetsPath15>
|
||||
<VCTargetsPath16 Condition="'$(_AlternativeVCTargetsPath160)'!=''">$(_AlternativeVCTargetsPath160)</VCTargetsPath16>
|
||||
<VCTargetsPath17>$(_AlternativeVCTargetsPath170)</VCTargetsPath17>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<Platforms>x64</Platforms>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.GDK.PC" Version="$(EditionYearMonth).$(EditionQFE).*" />
|
||||
<PackageReference Include="Microsoft.GDK.Xbox" Version="$(EditionYearMonth).$(EditionQFE).*" />
|
||||
<PackageReference Include="$(GDKNuGetPackage)" Version="$(EditionYearMonth).$(EditionQFE).*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<#
|
||||
|
||||
.SYNOPSIS
|
||||
Download and extract GDK NuGet based on edition number
|
||||
Download and extract the 'base' GDK NuGet based on edition number, returning the full version number that can be used to restore other GDK packages in the set.
|
||||
|
||||
.DESCRIPTION
|
||||
This script determines the NuGet package id to use based on the provided GDK edition number. It makes use of MSBuild PackageReference floating version numbers to do the restore operation.
|
||||
@@ -12,6 +12,12 @@ The GDK edition number in the form of YYMMQQ.
|
||||
.PARAMETER OutputDirectory
|
||||
Directory to write the packages into. Path should not already contain the packages.
|
||||
|
||||
.PARAMETER NewLayout
|
||||
Switch to indicate to use the 'new layout' of GDK packages (October 2025 and later).
|
||||
|
||||
.PARAMETER AutoLayout
|
||||
Switch to indicate to automatically choose layout style based on edition number.
|
||||
|
||||
#>
|
||||
|
||||
param(
|
||||
@@ -24,9 +30,15 @@ param(
|
||||
Mandatory,
|
||||
Position = 1
|
||||
)]
|
||||
[string]$OutputDirectory
|
||||
[string]$OutputDirectory,
|
||||
[switch]$NewLayout,
|
||||
[switch]$AutoLayout
|
||||
)
|
||||
|
||||
if ($NewLayout -and $AutoLayout) {
|
||||
Write-Error "##[error]Cannot specify both NewLayout and AutoLayout switches" -ErrorAction Stop
|
||||
}
|
||||
|
||||
# Validate output directory
|
||||
if ([string]::IsNullOrEmpty($OutputDirectory)) {
|
||||
Write-Error "##[error]Output Directory is required" -ErrorAction Stop
|
||||
@@ -65,29 +77,40 @@ if (-Not $nuget) {
|
||||
}
|
||||
|
||||
# Determine NuGet package ID
|
||||
if ($GDKEditionNumber -ge 241000) {
|
||||
$PGDK_ID = "Microsoft.GDK.PC"
|
||||
$GDKX_ID = "Microsoft.GDK.Xbox"
|
||||
}
|
||||
else {
|
||||
if ($GDKEditionNumber -lt 241000) {
|
||||
Write-Error "##[error]Script supports October 2024 or later" -ErrorAction Stop
|
||||
}
|
||||
|
||||
# Check that the package isn't already present
|
||||
$PGDK_DIR = [IO.Path]::Combine($OutputDirectory, $PGDK_ID)
|
||||
if (Test-Path $PGDK_DIR) {
|
||||
Write-Error "##[error]PC Package ID already exists!" -ErrorAction Stop
|
||||
if ($AutoLayout) {
|
||||
if ($GDKEditionNumber -ge 251000) {
|
||||
$NewLayout = $true
|
||||
}
|
||||
else {
|
||||
$NewLayout = $false
|
||||
}
|
||||
}
|
||||
|
||||
$GDKX_DIR = [IO.Path]::Combine($OutputDirectory, $GDKX_ID)
|
||||
if (Test-Path $GDKX_DIR) {
|
||||
Write-Error "##[error]Xbox Package ID already exists!" -ErrorAction Stop
|
||||
if ($NewLayout) {
|
||||
if ($GDKEditionNumber -lt 251000) {
|
||||
Write-Error "##[error]New layout only supported for October 2025 or later" -ErrorAction Stop
|
||||
}
|
||||
$GDK_ID = "Microsoft.GDK.Core"
|
||||
}
|
||||
else {
|
||||
$GDK_ID = "Microsoft.GDK.PC"
|
||||
}
|
||||
|
||||
# Check that the package isn't already present
|
||||
$GDK_DIR = [IO.Path]::Combine($OutputDirectory, $GDK_ID)
|
||||
if (Test-Path $GDK_DIR) {
|
||||
Write-Error "##[error]NuGet Package ID already exists!" -ErrorAction Stop
|
||||
}
|
||||
|
||||
# Restore Nuget packages using floating versions
|
||||
$propsfile = [IO.Path]::Combine( $PSScriptRoot , "gdkedition.props")
|
||||
$props = Get-Content -Path $propsfile
|
||||
$props = $props -replace '<GDKEditionNumber>.+</GDKEditionNumber>', ("<GDKEditionNumber>{0}</GDKEditionNumber>" -f $GDKEditionNumber)
|
||||
$props = $props -replace '<GDKNuGetPackage>.+</GDKNuGetPackage>', ("<GDKNuGetPackage>{0}</GDKNuGetPackage>" -f $GDK_ID)
|
||||
Set-Content -Path $propsfile -Value $props
|
||||
|
||||
$nugetArgs = "restore RestoreGDK.proj -PackageSaveMode nuspec -packagesDirectory `"{0}`"" -f $OutputDirectory.TrimEnd('\')
|
||||
@@ -98,62 +121,31 @@ if ($nugetrun.ExitCode -gt 0) {
|
||||
}
|
||||
|
||||
# Verify expected output of restore
|
||||
if (-Not (Test-Path $PGDK_DIR)) {
|
||||
Write-Error "##[error]Missing PC package after restore!" -ErrorAction Stop
|
||||
}
|
||||
|
||||
if (-Not (Test-Path $GDKX_DIR)) {
|
||||
Write-Error "##[error]Missing Xbox package after restore!" -ErrorAction Stop
|
||||
if (-Not (Test-Path $GDK_DIR)) {
|
||||
Write-Error "##[error]Missing NuGet package after restore!" -ErrorAction Stop
|
||||
}
|
||||
|
||||
# Reduce path depth removing version folder
|
||||
$PGDK_VER = Get-ChildItem $PGDK_DIR
|
||||
if ($PGDK_VER.Count -ne 1) {
|
||||
$GDK_VER = Get-ChildItem $GDK_DIR
|
||||
if ($GDK_VER.Count -ne 1) {
|
||||
Write-Error "##[error]Expected a single directory for the version!" -ErrorAction Stop
|
||||
}
|
||||
|
||||
$content = Get-ChildItem $PGDK_VER.Fullname
|
||||
ForEach-Object -InputObject $content { Move-Item $_.Fullname -Destination $PGDK_DIR }
|
||||
Remove-Item $PGDK_VER.Fullname
|
||||
$content = Get-ChildItem $GDK_VER.Fullname
|
||||
ForEach-Object -InputObject $content { Move-Item $_.Fullname -Destination $GDK_DIR }
|
||||
Remove-Item $GDK_VER.Fullname
|
||||
|
||||
$GDKX_VER = Get-ChildItem $GDKX_DIR
|
||||
if ($GDKX_VER.Count -ne 1) {
|
||||
Write-Error "##[error]Expected a single directory for the version!" -ErrorAction Stop
|
||||
}
|
||||
|
||||
$content = Get-ChildItem $GDKX_VER.Fullname
|
||||
ForEach-Object -InputObject $content { Move-Item $_.Fullname -Destination $GDKX_DIR }
|
||||
Remove-Item $GDKX_VER.Fullname
|
||||
|
||||
Write-Host ("##[debug]PC Package ID: {0} Version: {1}" -f $PGDK_ID, $PGDK_VER)
|
||||
Write-Host ("##[debug]Xbox Package ID: {0} Version: {1}" -f $GDKX_ID, $GDKX_VER)
|
||||
Write-Host ("##[debug]NuGet Package ID: {0} Version: {1}" -f $GDK_ID, $GDK_VER)
|
||||
|
||||
# Read the nuspec files
|
||||
$PGDK_NUSPEC = New-Object xml
|
||||
$PGDK_NUSPEC.PreserveWhitespace = $true
|
||||
$PGDK_NUSPEC.Load([IO.Path]::Combine($PGDK_DIR, $PGDK_ID + ".nuspec"))
|
||||
|
||||
$GDKX_NUSPEC = New-Object xml
|
||||
$GDKX_NUSPEC.PreserveWhitespace = $true
|
||||
$GDKX_NUSPEC.Load([IO.Path]::Combine($GDKX_DIR, $GDKX_ID + ".nuspec"))
|
||||
$GDK_NUSPEC = New-Object xml
|
||||
$GDK_NUSPEC.PreserveWhitespace = $true
|
||||
$GDK_NUSPEC.Load([IO.Path]::Combine($GDK_DIR, $GDK_ID + ".nuspec"))
|
||||
|
||||
# Log results
|
||||
Write-Host "##[group]PC Nuget Package nuspec"
|
||||
Write-host $PGDK_NUSPEC.outerxml
|
||||
Write-Host "##[group]NuGet Nuget Package nuspec"
|
||||
Write-host $GDK_NUSPEC.outerxml
|
||||
Write-Host "##[endgroup]"
|
||||
|
||||
Write-Host "##[group]Xbox Nuget Package nuspec"
|
||||
Write-host $GDKX_NUSPEC.outerxml
|
||||
Write-Host "##[endgroup]"
|
||||
|
||||
$id = $PGDK_NUSPEC.package.metadata.id
|
||||
Write-Host "##vso[task.setvariable variable=PCNuGetPackage;]$id"
|
||||
|
||||
$id = $GDKX_NUSPEC.package.metadata.id
|
||||
Write-Host "##vso[task.setvariable variable=XboxNuGetPackage;]$id"
|
||||
|
||||
$ver = $PGDK_NUSPEC.package.metadata.version
|
||||
Write-Host "##vso[task.setvariable variable=PCNuGetPackageVersion;]$ver"
|
||||
|
||||
$ver = $GDKX_NUSPEC.package.metadata.version
|
||||
Write-Host "##vso[task.setvariable variable=XboxNuGetPackageVersion;]$ver"
|
||||
$ver = $GDK_NUSPEC.package.metadata.version
|
||||
Write-Host "##vso[task.setvariable variable=GDKNuGetPackageVersion;]$ver"
|
||||
|
||||
@@ -13,9 +13,73 @@ goto needconsole
|
||||
set GXDKEDITION=%2
|
||||
echo GXDKEDITION: %GXDKEDITION%
|
||||
|
||||
set PCNUGET=%1\Microsoft.GDK.PC\
|
||||
if NOT EXIST %PCNUGET% goto missingpcnuget
|
||||
set CORENUGET=%1\Microsoft.GDK.Core\
|
||||
if EXIST %CORENUGET% goto newlayout
|
||||
|
||||
set PCNUGET=%1\Microsoft.GDK.PC\
|
||||
if EXIST %PCNUGET% goto oldlayout
|
||||
|
||||
goto missingpcnuget
|
||||
|
||||
REM Use new layouts (October 2025 GDK and later)
|
||||
:newlayout
|
||||
|
||||
set GameDK=%CORENUGET%native\bin\
|
||||
|
||||
if %3.==PC. goto newlayoutpc
|
||||
if %3.==XboxOne. goto newlayoutxboxone
|
||||
if %3.==Scarlett. goto newlayoutscarlett
|
||||
goto needconsole
|
||||
|
||||
:newlayoutpc
|
||||
set WINDOWSNUGET=%1\Microsoft.GDK.Windows\
|
||||
if NOT EXIST %WINDOWSNUGET% goto missingpcnuget
|
||||
|
||||
set GameDKCoreLatest=%WINDOWSNUGET%native\%GXDKEDITION%\
|
||||
|
||||
set ADDINCLUDE=%GameDKCoreLatest%windows\include
|
||||
REM arm64?
|
||||
set ADDBIN=%GameDKCoreLatest%windows\bin\x64;%CORENUGET%native\bin
|
||||
set ADDLIB=%GameDKCoreLatest%windows\lib\x64
|
||||
goto continuenew
|
||||
|
||||
:newlayoutxboxone
|
||||
set XBOXNUGET=%1\Microsoft.GDK.Xbox.XboxOne\
|
||||
if NOT EXIST %XBOXNUGET% goto missingxboxnuget
|
||||
|
||||
set GameDKXboxLatest=%XBOXNUGET%native\%GXDKEDITION%\
|
||||
|
||||
set ADDINCLUDE=%GameDKXboxLatest%xbox\include\gen8;%GameDKXboxLatest%xbox\include
|
||||
set ADDBIN=%GameDKXboxLatest%xbox\bin\gen8;%GameDKXboxLatest%xbox\bin\x64;%CORENUGET%native\bin
|
||||
set ADDLIB=%GameDKXboxLatest%xbox\lib\gen8;%GameDKXboxLatest%xbox\lib\x64
|
||||
goto continuenew
|
||||
|
||||
:newlayoutscarlett
|
||||
set XBOXNUGET=%1\Microsoft.GDK.Xbox.XboxSeriesX_S\
|
||||
if NOT EXIST %XBOXNUGET% goto missingxboxnuget
|
||||
|
||||
set GameDKXboxLatest=%XBOXNUGET%native\%GXDKEDITION%\
|
||||
|
||||
set ADDINCLUDE=%GameDKXboxLatest%xbox\include\gen9;%GameDKXboxLatest%xbox\include
|
||||
set ADDBIN=%GameDKXboxLatest%xbox\bin\gen9;%GameDKXboxLatest%xbox\bin\x64;%CORENUGET%native\bin
|
||||
set ADDLIB=%GameDKXboxLatest%xbox\lib\gen9;%GameDKXboxLatest%xbox\lib\x64
|
||||
goto continuenew
|
||||
|
||||
:continuenew
|
||||
echo GameDK: %GameDK%
|
||||
echo GameDKCoreLatest: %GameDKCoreLatest%
|
||||
echo GameDKXboxLatest: %GameDKXboxLatest%
|
||||
echo ADDBIN: %ADDBIN%
|
||||
echo ADDINCLUDE: %ADDINCLUDE%
|
||||
echo ADDLIB: %ADDLIB%
|
||||
|
||||
set PATH=%ADDBIN%;%PATH%
|
||||
set INCLUDE=%INCLUDE%;%ADDINCLUDE%
|
||||
set LIB=%LIB%;%ADDLIB%
|
||||
exit /b 0
|
||||
|
||||
REM Use old layouts (pre-October 2025 GDK)
|
||||
:oldlayout
|
||||
set GRDKLatest=%PCNUGET%native\%GXDKEDITION%\GRDK\
|
||||
echo GRDKLatest: %GRDKLatest%
|
||||
|
||||
@@ -33,7 +97,7 @@ set GameDKLatest=%XBOXNUGET%native\%GXDKEDITION%\
|
||||
set ADDBIN=%GXDKLatest%bin\%3;%PCNUGET%native\bin;%XBOXNUGET%native\bin
|
||||
set ADDINCLUDE=%GXDKLatest%gamekit\include\%3;%GXDKLatest%gamekit\include;%GRDKLatest%gamekit\include
|
||||
set ADDLIB=%GXDKLatest%gamekit\lib\amd64\%3;%GXDKLatest%gamekit\lib\amd64;%GRDKLatest%gamekit\lib\amd64
|
||||
goto continue
|
||||
goto continueold
|
||||
|
||||
:grdkonly
|
||||
set GameDK=%PCNUGET%native\
|
||||
@@ -43,7 +107,7 @@ set ADDBIN=%PCNUGET%native\bin
|
||||
set ADDINCLUDE=%GRDKLatest%gamekit\include
|
||||
set ADDLIB=%GRDKLatest%gamekit\lib\amd64
|
||||
|
||||
:continue
|
||||
:continueold
|
||||
echo GameDK: %GameDK%
|
||||
echo GameDKLatest: %GameDKLatest%
|
||||
echo ADDBIN: %ADDBIN%
|
||||
@@ -68,9 +132,9 @@ echo Usage: This script requires the target type of PC, Scarlett, or XboxOne in
|
||||
exit /b 1
|
||||
|
||||
:missingpcnuget
|
||||
echo ERROR - Cannot find Microsoft.GDK.PC installed at '%1'
|
||||
echo ERROR - Cannot find Microsoft.GDK.Core/Windows/PC installed at '%1'
|
||||
exit /b 1
|
||||
|
||||
:missingxboxnuget
|
||||
echo ERROR - Cannot find Microsoft.GDK.Xbox installed at '%1'
|
||||
echo ERROR - Cannot find Microsoft.GDK.Xbox/.XboxOne/.XboxSeriesX_S installed at '%1'
|
||||
exit /b 1
|
||||
|
||||
@@ -7,25 +7,11 @@
|
||||
-->
|
||||
|
||||
<PropertyGroup>
|
||||
<GDKEditionNumber Condition="$(GDKEditionNumber)==''">999999</GDKEditionNumber>
|
||||
<ExtractedFolder Condition="'$(ExtractedFolder)'==''">C:\xtracted\</ExtractedFolder>
|
||||
<ExtractedFolder Condition="!HasTrailingSlash('$(ExtractedFolder)')">$(ExtractedFolder)\</ExtractedFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GDKEditionNumber)' < '220300'">
|
||||
<_PCNuGetPackage>Microsoft.PGDK</_PCNuGetPackage>
|
||||
<_XboxNuGetPackage>Microsoft.GDK</_XboxNuGetPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GDKEditionNumber)' >= '220300'">
|
||||
<_PCNuGetPackage>Microsoft.GDK.PC</_PCNuGetPackage>
|
||||
<_XboxNuGetPackage>Microsoft.GDK.Xbox</_XboxNuGetPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(GDKEditionNumber)' < '241000'">
|
||||
<_PCNuGetPackage>$(_PCNuGetPackage).$(GDKEditionNumber)</_PCNuGetPackage>
|
||||
<_XboxNuGetPackage>$(_XboxNuGetPackage).$(GDKEditionNumber)</_XboxNuGetPackage>
|
||||
</PropertyGroup>
|
||||
|
||||
<!--
|
||||
A list of VCTargets folders that we expect to exist after copying the BWOI VS files
|
||||
If any of these folders is not present then we assume that the VCTargets has not been setup
|
||||
@@ -66,7 +52,11 @@ SixtyFourBit = (IntPtr.Size == 8) ? true : false;
|
||||
</Is64BitMSBuild>
|
||||
|
||||
<Error Condition="'$(_SixtyFourBit)'=='false'"
|
||||
Text="The 64-bit version of MSBuild is required to support NuGet GDK packages." />
|
||||
Text="##[error]The 64-bit version of MSBuild is required to support NuGet GDK packages." />
|
||||
</Target>
|
||||
|
||||
<Target Name="_ValidateGDK">
|
||||
<Error Condition="'$(GDKEditionNumber)'=='999999'" Text="##[error]GDKEditionNumber was not set!" />
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
@@ -75,7 +65,7 @@ SixtyFourBit = (IntPtr.Size == 8) ? true : false;
|
||||
<Target Name="_ProbeForExtractedVCTargets"
|
||||
Outputs="%(BWOIVCFolders.Identity)">
|
||||
<Error Condition="'$(ExtractedFolder)'==''"
|
||||
Text="ExtractedFolder property is required" />
|
||||
Text="##[error]ExtractedFolder property is required" />
|
||||
|
||||
<PropertyGroup>
|
||||
<_BWOIFolder>%(BWOIVCFolders.Identity)</_BWOIFolder>
|
||||
@@ -93,12 +83,6 @@ SixtyFourBit = (IntPtr.Size == 8) ? true : false;
|
||||
|
||||
<Target Name="_CreateVCTargetsFolder"
|
||||
Condition="'@(_MissingBWOIVCFolders)' != ''">
|
||||
<Error Condition="'$(GDKEditionNumber)'==''"
|
||||
Text="GDKEditionNumber property is required" />
|
||||
<Error Condition="!Exists('$(ExtractedFolder)$(_PCNuGetPackage)')"
|
||||
Text="NuGet package $(_PCNuGetPackage) not found in $(ExtractedFolder)" />
|
||||
<Error Condition="!Exists('$(ExtractedFolder)$(_XboxNuGetPackage)')"
|
||||
Text="NuGet package $(_XboxNuGetPackage) not found in $(ExtractedFolder)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<_VSFolder Condition="'$(VisualStudioVersion)' == '17.0'">VS2022</_VSFolder>
|
||||
@@ -106,20 +90,68 @@ SixtyFourBit = (IntPtr.Size == 8) ? true : false;
|
||||
</PropertyGroup>
|
||||
|
||||
<Error Condition="'$(_VSFolder)'==''"
|
||||
Text="Only supports VS 2019 or VS 2022" />
|
||||
Text="##[error]Only supports VS 2019 or VS 2022" />
|
||||
|
||||
<!-- Set up files for v141 platform toolset projects -->
|
||||
<ItemGroup Condition="'$(GDKEditionNumber)' < '241000'">
|
||||
<SourceVCTargetsFilesV150 Include="$(MSBuildExtensionsPath32)\Microsoft\VC\v150\**" />
|
||||
<!-- Set up files for v142 platform toolset projects -->
|
||||
<ItemGroup>
|
||||
<SourceVCTargetsFilesV160 Include="$(MSBuildExtensionsPath32)\Microsoft\VC\v160\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(GDKEditionNumber)' < '241000'">
|
||||
<GDKVCTargetsFilesV150 Include="$(ExtractedFolder)$(_PCNuGetPackage)\native\$(GDKEditionNumber)\GRDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v150\**" />
|
||||
<GDKVCTargetsFilesV150 Include="$(ExtractedFolder)$(_XboxNuGetPackage)\native\$(GDKEditionNumber)\GXDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v150\**" />
|
||||
<ItemGroup Condition="Exists('$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build')">
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\pc\v160\**" />
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen8\v160\**" />
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen9\v160\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<Copy Condition="'$(GDKEditionNumber)' < '241000'" SkipUnchangedFiles="true" SourceFiles="@(SourceVCTargetsFilesV150)" DestinationFolder="$(ExtractedFolder)VCTargets150\%(RecursiveDir)/" />
|
||||
<Copy Condition="'$(GDKEditionNumber)' < '241000'" SourceFiles="@(GDKVCTargetsFilesV150)" DestinationFolder="$(ExtractedFolder)VCTargets150\%(RecursiveDir)/" />
|
||||
<ItemGroup Condition="Exists('$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build')">
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\pc\v160\**" />
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen8\v160\**" />
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen9\v160\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<Error Condition="@(GDKVCTargetsFilesV160->Count()) == 0"
|
||||
Text="##[error]No MSBuild v142 files found in NuGets. Check GDKEditionNumber."/>
|
||||
|
||||
<Copy SkipUnchangedFiles="true" SourceFiles="@(SourceVCTargetsFilesV160)" DestinationFolder="$(ExtractedFolder)VCTargets160\%(RecursiveDir)/" />
|
||||
<Copy SourceFiles="@(GDKVCTargetsFilesV160)" DestinationFolder="$(ExtractedFolder)VCTargets160\%(RecursiveDir)/" />
|
||||
|
||||
<!-- Set up files for v143 platform toolset projects -->
|
||||
<ItemGroup Condition="'$(VisualStudioVersion)' == '17.0'">
|
||||
<SourceVCTargetsFilesV170 Include="$(MSBuildExtensionsPath32)\Microsoft\VC\v170\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(VisualStudioVersion)' == '17.0' and Exists('$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build')">
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\pc\v170\**" />
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen8\v170\**" />
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxOne\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen9\v170\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(VisualStudioVersion)' == '17.0' and Exists('$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build')">
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\pc\v170\**" />
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen8\v170\**" />
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.Xbox.XboxSeriesX_S\native\$(GDKEditionNumber)\xbox\build\$(_VSFolder)\gen9\v170\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<Error Condition="'$(VisualStudioVersion)' == '17.0' AND @(GDKVCTargetsFilesV170->Count()) == 0"
|
||||
Text="##[error]No MSBuild v143 files found in NuGets. Check GDKEditionNumber."/>
|
||||
|
||||
<Copy SkipUnchangedFiles="true" SourceFiles="@(SourceVCTargetsFilesV170)" DestinationFolder="$(ExtractedFolder)VCTargets170\%(RecursiveDir)/" />
|
||||
<Copy SourceFiles="@(GDKVCTargetsFilesV170)" DestinationFolder="$(ExtractedFolder)VCTargets170\%(RecursiveDir)/" />
|
||||
|
||||
</Target>
|
||||
|
||||
<Target Name="_CreateVCTargetsFolderOld"
|
||||
Condition="'@(_MissingBWOIVCFolders)' != ''">
|
||||
<Error Condition="!Exists('$(ExtractedFolder)Microsoft.GDK.PC')"
|
||||
Text="##[error]NuGet package Microsoft.GDK.PC not found in $(ExtractedFolder)" />
|
||||
|
||||
<PropertyGroup>
|
||||
<_VSFolder Condition="'$(VisualStudioVersion)' == '17.0'">VS2022</_VSFolder>
|
||||
<_VSFolder Condition="'$(VisualStudioVersion)' == '16.0'">VS2019</_VSFolder>
|
||||
</PropertyGroup>
|
||||
|
||||
<Error Condition="'$(_VSFolder)'==''"
|
||||
Text="##[error]Only supports VS 2019 or VS 2022" />
|
||||
|
||||
<!-- Set up files for v142 platform toolset projects -->
|
||||
<ItemGroup>
|
||||
@@ -127,10 +159,13 @@ SixtyFourBit = (IntPtr.Size == 8) ? true : false;
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)$(_PCNuGetPackage)\native\$(GDKEditionNumber)\GRDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v160\**" />
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)$(_XboxNuGetPackage)\native\$(GDKEditionNumber)\GXDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v160\**" />
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.PC\native\$(GDKEditionNumber)\GRDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v160\**" />
|
||||
<GDKVCTargetsFilesV160 Include="$(ExtractedFolder)Microsoft.GDK.Xbox\native\$(GDKEditionNumber)\GXDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v160\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<Error Condition="@(GDKVCTargetsFilesV160->Count()) == 0"
|
||||
Text="##[error]No MSBuild v142 files found in NuGets. Check GDKEditionNumber."/>
|
||||
|
||||
<Copy SkipUnchangedFiles="true" SourceFiles="@(SourceVCTargetsFilesV160)" DestinationFolder="$(ExtractedFolder)VCTargets160\%(RecursiveDir)/" />
|
||||
<Copy SourceFiles="@(GDKVCTargetsFilesV160)" DestinationFolder="$(ExtractedFolder)VCTargets160\%(RecursiveDir)/" />
|
||||
|
||||
@@ -140,14 +175,24 @@ SixtyFourBit = (IntPtr.Size == 8) ? true : false;
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(VisualStudioVersion)' == '17.0'">
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)$(_PCNuGetPackage)\native\$(GDKEditionNumber)\GRDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v170\**" />
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)$(_XboxNuGetPackage)\native\$(GDKEditionNumber)\GXDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v170\**" />
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.PC\native\$(GDKEditionNumber)\GRDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v170\**" />
|
||||
<GDKVCTargetsFilesV170 Include="$(ExtractedFolder)Microsoft.GDK.Xbox\native\$(GDKEditionNumber)\GXDK\$(_VSFolder)\flatDeployment\MSBuild\Microsoft\VC\v170\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<Error Condition="'$(VisualStudioVersion)' == '17.0' AND @(GDKVCTargetsFilesV170->Count()) == 0"
|
||||
Text="##[error]No MSBuild v143 files found in NuGets. Check GDKEditionNumber."/>
|
||||
|
||||
<Copy SkipUnchangedFiles="true" SourceFiles="@(SourceVCTargetsFilesV170)" DestinationFolder="$(ExtractedFolder)VCTargets170\%(RecursiveDir)/" />
|
||||
<Copy SourceFiles="@(GDKVCTargetsFilesV170)" DestinationFolder="$(ExtractedFolder)VCTargets170\%(RecursiveDir)/" />
|
||||
|
||||
</Target>
|
||||
|
||||
<Target Name="SetupVCTargets" DependsOnTargets="_CheckMSBuild64;_ProbeForExtractedVCTargets;_CreateVCTargetsFolder" />
|
||||
<PropertyGroup>
|
||||
<SetupTargets></SetupTargets>
|
||||
<SetupTargets Condition="Exists('$(ExtractedFolder)Microsoft.GDK.Core')">;_CreateVCTargetsFolder</SetupTargets>
|
||||
<SetupTargets Condition="'$(SetupTargets)'=='' AND Exists('$(ExtractedFolder)Microsoft.GDK.Xbox')">;_CreateVCTargetsFolderOld</SetupTargets>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="SetupVCTargets" DependsOnTargets="_CheckMSBuild64;_ValidateGDK;_ProbeForExtractedVCTargets$(SetupTargets)" />
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -2,5 +2,6 @@
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<GDKEditionNumber>000000</GDKEditionNumber>
|
||||
<GDKNuGetPackage>Microsoft.GDK.xyz</GDKNuGetPackage>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user