<Project>
<PropertyGroup>
<_XfeBridgeScript>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../scripts/Build-Bridge.ps1'))</_XfeBridgeScript>
<XFEBridgePowerShellExe Condition="'$(XFEBridgePowerShellExe)' == ''">$(SystemRoot)\System32\WindowsPowerShell\v1.0\powershell.exe</XFEBridgePowerShellExe>
<XFEBridgeDotNetExe Condition="'$(XFEBridgeDotNetExe)' == ''">$([System.IO.Path]::Combine('$(NetCoreRoot)', 'dotnet.exe'))</XFEBridgeDotNetExe>
</PropertyGroup>
<Target Name="BuildBundledBridgePayload" AfterTargets="Build" Condition="'$(DesignTimeBuild)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'">
<Error Condition="!Exists('$(XFEBridgePowerShellExe)')" Text="Windows PowerShell was not found at $(XFEBridgePowerShellExe). Set XFEBridgePowerShellExe to an installed PowerShell executable." />
<Error Condition="!Exists('$(XFEBridgeDotNetExe)')" Text="The .NET SDK host was not found at $(XFEBridgeDotNetExe). Set XFEBridgeDotNetExe to the dotnet.exe used by this build." />
<Exec Command=""$(XFEBridgePowerShellExe)" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$(_XfeBridgeScript)" -Configuration "$(Configuration)" -IfNeeded -DotNetPath "$(XFEBridgeDotNetExe)" -Destination "$(TargetDir)Bridge"" />
</Target>
<Target Name="PublishBundledBridgePayload" AfterTargets="ComputeFilesToPublish">
<Error Condition="!Exists('$(TargetDir)Bridge/payload.json') or !Exists('$(TargetDir)Bridge/XFEWarframe.Bridge.dll')" Text="The bundled native component was not built. Build this application before publishing." />
<ItemGroup>
<ResolvedFileToPublish Include="$(TargetDir)Bridge/payload.json">
<RelativePath>Bridge/payload.json</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
<ResolvedFileToPublish Include="$(TargetDir)Bridge/XFEWarframe.Bridge.dll">
<RelativePath>Bridge/XFEWarframe.Bridge.dll</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>
<Project>
<PropertyGroup>
<_XfeBridgeScript>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../scripts/Build-Bridge.ps1'))</_XfeBridgeScript>
<XFEBridgePowerShellExe Condition="'$(XFEBridgePowerShellExe)' == ''">$(SystemRoot)\System32\WindowsPowerShell\v1.0\powershell.exe</XFEBridgePowerShellExe>
<XFEBridgeDotNetExe Condition="'$(XFEBridgeDotNetExe)' == ''">$([System.IO.Path]::Combine('$(NetCoreRoot)', 'dotnet.exe'))</XFEBridgeDotNetExe>
</PropertyGroup>
<Target Name="BuildBundledBridgePayload" AfterTargets="Build" Condition="'$(DesignTimeBuild)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'">
<Error Condition="!Exists('$(XFEBridgePowerShellExe)')" Text="Windows PowerShell was not found at $(XFEBridgePowerShellExe). Set XFEBridgePowerShellExe to an installed PowerShell executable." />
<Error Condition="!Exists('$(XFEBridgeDotNetExe)')" Text="The .NET SDK host was not found at $(XFEBridgeDotNetExe). Set XFEBridgeDotNetExe to the dotnet.exe used by this build." />
<Exec Command=""$(XFEBridgePowerShellExe)" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "$(_XfeBridgeScript)" -Configuration "$(Configuration)" -IfNeeded -DotNetPath "$(XFEBridgeDotNetExe)" -Destination "$(TargetDir)Bridge"" />
</Target>
<Target Name="PublishBundledBridgePayload" AfterTargets="ComputeFilesToPublish">
<Error Condition="!Exists('$(TargetDir)Bridge/payload.json') or !Exists('$(TargetDir)Bridge/XFEWarframe.Bridge.dll')" Text="The bundled native component was not built. Build this application before publishing." />
<ItemGroup>
<ResolvedFileToPublish Include="$(TargetDir)Bridge/payload.json">
<RelativePath>Bridge/payload.json</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
<ResolvedFileToPublish Include="$(TargetDir)Bridge/XFEWarframe.Bridge.dll">
<RelativePath>Bridge/XFEWarframe.Bridge.dll</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
</Project>