Skip to content
Permalink
Browse files

[Build] Adjust RuntimeIdentifier and XenkoPlatform detection

  • Loading branch information
xen2 committed Jan 10, 2019
1 parent f25b105 commit 855d27e26b109e9884c916beb6ae1ea1a8262989
Showing with 12 additions and 11 deletions.
  1. +10 −10 sources/targets/Xenko.Core.PreSettings.targets
  2. +2 −1 sources/targets/Xenko.GlobalSettings.targets
@@ -55,6 +55,8 @@
<XenkoRuntimeTargetFrameworks>$([MSBuild]::Unescape($(XenkoRuntimeTargetFrameworks.Trim(';'))))</XenkoRuntimeTargetFrameworks>
<XenkoRuntimeIdentifiers>$([MSBuild]::Unescape($(XenkoRuntimeIdentifiers.Trim(';'))))</XenkoRuntimeIdentifiers>

<XenkoRuntimeIdentifier Condition="'$(XenkoRuntimeIdentifiers)' != ''">$(XenkoRuntimeIdentifiers.Split(';')[0])</XenkoRuntimeIdentifier>

<TargetFrameworks>$(XenkoRuntimeTargetFrameworks)</TargetFrameworks>
<RuntimeIdentifiers Condition="'$(XenkoRuntimeIdentifiers)' != ''">$(XenkoRuntimeIdentifiers)</RuntimeIdentifiers>

@@ -65,13 +67,15 @@
<!--<TargetFrameworks>net461;uap10.0.16299;monoandroid81;xamarinios10;netstandard2.0</TargetFrameworks>-->
</PropertyGroup>

<PropertyGroup Condition=" '$(XenkoRuntime)' == 'true' And '$(XenkoRuntimeNetStandard)' == 'true' ">
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(XenkoGraphicsApiDependent)' != 'true'">
<!-- Force default runtime identifier -->
<RuntimeIdentifier Condition="'$(RuntimeIdentifiers)' == ''"></RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(RuntimeIdentifiers)' != ''">$(RuntimeIdentifiers.Split(';')[0])</RuntimeIdentifier>
<RuntimeIdentifier>$(XenkoRuntimeIdentifier)</RuntimeIdentifier>
</PropertyGroup>


<!-- Those two targets are used to properly set the RuntimeIdentifier of ProjectReference (since we have sometimes weird transitions like win => win-d3d11 or win => noRID)
If we don't do it, MSBuild slap current RID, and even if this RID is overriden inside the build of the project, it will still trigger an unecessary build w/ double writes -->
<Target Name="_XenkoSdkGetDefaultRidForTfm" Returns="$(RuntimeIdentifier)">
@@ -101,10 +105,6 @@
</Target>

<Target Name="GetPackagingOutputs" Condition=" '$(XenkoRuntime)' == 'true' And '$(XenkoRuntimeNetStandard)' == 'true' " />
<PropertyGroup Condition=" '$(XenkoRuntime)' == 'true' And '$(XenkoRuntimeNetStandard)' == 'true' ">
<TargetFramework>netstandard2.0</TargetFramework>
<RuntimeIdentifier></RuntimeIdentifier>
</PropertyGroup>

<!-- Use default runtime as ref assembly -->
<PropertyGroup>
@@ -128,9 +128,9 @@

<!-- Default values -->
<XenkoPlatformOriginal>$(XenkoPlatform)</XenkoPlatformOriginal>
<XenkoPlatform Condition=" ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And ('$(RuntimeIdentifier)' == '' Or $(RuntimeIdentifier.StartsWith('win'))) ">Windows</XenkoPlatform>
<XenkoPlatform Condition=" ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(RuntimeIdentifier.StartsWith('linux')) ">Linux</XenkoPlatform>
<XenkoPlatform Condition=" ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(RuntimeIdentifier.StartsWith('osx')) ">macOS</XenkoPlatform>
<XenkoPlatform Condition=" ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And ('$(XenkoRuntimeIdentifier)' == '' Or $(XenkoRuntimeIdentifier.StartsWith('win'))) ">Windows</XenkoPlatform>
<XenkoPlatform Condition=" ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(XenkoRuntimeIdentifier.StartsWith('linux')) ">Linux</XenkoPlatform>
<XenkoPlatform Condition=" ($(TargetFramework.StartsWith('net4')) Or '$(TargetFramework)' == 'netstandard2.0') And $(XenkoRuntimeIdentifier.StartsWith('osx')) ">macOS</XenkoPlatform>
<XenkoPlatform Condition=" $(TargetFramework.StartsWith('uap10.0')) ">UWP</XenkoPlatform>
<XenkoPlatform Condition=" '$(TargetFramework)' == 'monoandroid81' ">Android</XenkoPlatform>
<XenkoPlatform Condition=" '$(TargetFramework)' == 'xamarinios10' ">iOS</XenkoPlatform>
@@ -45,7 +45,8 @@
<PropertyGroup Condition="'$(XenkoGraphicsApiDependent)' == 'true'">
<RuntimeIdentifiers>$([MSBuild]::Unescape($(RuntimeIdentifiers.Trim(';'))))</RuntimeIdentifiers>
<!-- Default fallbacks -->
<RuntimeIdentifiers Condition="'$(TargetFramework)' == 'netstandard2.0' And '$(RuntimeIdentifiers)' == ''">win-d3d11</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(TargetFramework)' == 'netstandard2.0' And '$(XenkoPlatform)' == 'Linux' And '$(RuntimeIdentifiers)' == ''">linux-opengl</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(TargetFramework)' == 'netstandard2.0' And '$(XenkoPlatform)' == 'Windows' And '$(RuntimeIdentifiers)' == ''">win-d3d11</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="'$(TargetFramework)' != 'netstandard2.0' And '$(RuntimeIdentifiers)' == ''">any</RuntimeIdentifiers>
<RuntimeIdentifierDefault Condition="'$(RuntimeIdentifiers)' != ''">$(RuntimeIdentifiers.Split(';')[0])</RuntimeIdentifierDefault>

0 comments on commit 855d27e

Please sign in to comment.
You can’t perform that action at this time.