[CmdletBinding()]
param(
[ValidateSet('Debug','Release')][string]$Configuration='Release',
[switch]$ExportDiagnostics
)
$ErrorActionPreference='Stop'
$taskRoot=Split-Path -Parent $PSScriptRoot
$taskBundle=Join-Path $taskRoot 'native/ManagedPlugin/Bundle/Bundle.csproj'
# The same project graph is used by the application. No source-tree staging.
dotnet build $taskBundle -c $Configuration -p:Platform=x64 --nologo
if($LASTEXITCODE -ne 0){throw 'Native support bundle build failed.'}
if($ExportDiagnostics){
$taskLayoutJson=dotnet msbuild $taskBundle -nologo -p:Configuration=$Configuration -p:Platform=x64 -getProperty:MSBuildProjectDirectory,IntermediateOutputPath
if($LASTEXITCODE -ne 0){throw 'Native support output location could not be resolved.'}
$taskLayout=($taskLayoutJson -join "`n")|ConvertFrom-Json
$taskGenerated=Join-Path (Join-Path $taskLayout.Properties.MSBuildProjectDirectory $taskLayout.Properties.IntermediateOutputPath) 'native-support'
foreach($taskExport in @(
@{Kind='Loader';Directory='artifacts/plugin-build';Files=@('dinput8.dll','package.json')},
@{Kind='Interaction';Directory='artifacts/interaction-native-build';Files=@('XFEEDInteraction.dll','interaction.json')}
)){
$taskOutput=Join-Path $taskRoot $taskExport.Directory
New-Item -ItemType Directory -Path $taskOutput -Force|Out-Null
foreach($taskFile in $taskExport.Files){
Copy-Item -LiteralPath (Join-Path (Join-Path $taskGenerated $taskExport.Kind) $taskFile) -Destination (Join-Path $taskOutput $taskFile) -Force
}
}
# Standalone is an ABI/self-test fixture; production uses the Loader bundle.
& (Join-Path $PSScriptRoot 'Build-ManagedPlugin.ps1') -Flavor Standalone -OutputDirectory 'artifacts/navigation-native-build' -Configuration $Configuration
}
[CmdletBinding()]
param(
[ValidateSet('Debug','Release')][string]$Configuration='Release',
[switch]$ExportDiagnostics
)
$ErrorActionPreference='Stop'
$taskRoot=Split-Path -Parent $PSScriptRoot
$taskBundle=Join-Path $taskRoot 'native/ManagedPlugin/Bundle/Bundle.csproj'
# The same project graph is used by the application. No source-tree staging.
dotnet build $taskBundle -c $Configuration -p:Platform=x64 --nologo
if($LASTEXITCODE -ne 0){throw 'Native support bundle build failed.'}
if($ExportDiagnostics){
$taskLayoutJson=dotnet msbuild $taskBundle -nologo -p:Configuration=$Configuration -p:Platform=x64 -getProperty:MSBuildProjectDirectory,IntermediateOutputPath
if($LASTEXITCODE -ne 0){throw 'Native support output location could not be resolved.'}
$taskLayout=($taskLayoutJson -join "`n")|ConvertFrom-Json
$taskGenerated=Join-Path (Join-Path $taskLayout.Properties.MSBuildProjectDirectory $taskLayout.Properties.IntermediateOutputPath) 'native-support'
foreach($taskExport in @(
@{Kind='Loader';Directory='artifacts/plugin-build';Files=@('dinput8.dll','package.json')},
@{Kind='Interaction';Directory='artifacts/interaction-native-build';Files=@('XFEEDInteraction.dll','interaction.json')}
)){
$taskOutput=Join-Path $taskRoot $taskExport.Directory
New-Item -ItemType Directory -Path $taskOutput -Force|Out-Null
foreach($taskFile in $taskExport.Files){
Copy-Item -LiteralPath (Join-Path (Join-Path $taskGenerated $taskExport.Kind) $taskFile) -Destination (Join-Path $taskOutput $taskFile) -Force
}
}
# Standalone is an ABI/self-test fixture; production uses the Loader bundle.
& (Join-Path $PSScriptRoot 'Build-ManagedPlugin.ps1') -Flavor Standalone -OutputDirectory 'artifacts/navigation-native-build' -Configuration $Configuration
}