Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,8 @@
</PropertyGroup>
</Target>

<PropertyGroup Condition="('$(RuntimeIdentifier)' != '' Or '$(RuntimeIdentifiers)' != '') And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS')">
<_IsDotNetSimulatorBuild Condition="$(RuntimeIdentifier.Contains('simulator')) Or $(RuntimeIdentifiers.Contains('simulator'))">true</_IsDotNetSimulatorBuild>
<_IsDotNetSimulatorBuild Condition="'$(_IsDotNetSimulatorBuild)' == ''">false</_IsDotNetSimulatorBuild>
</PropertyGroup>

<PropertyGroup Condition="'$(ComputedPlatform)' == '' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS') ">
<ComputedPlatform Condition="'$(_IsDotNetSimulatorBuild)' == 'true'">iPhoneSimulator</ComputedPlatform>
<ComputedPlatform Condition="'$(SdkIsSimulator)' == 'true'">iPhoneSimulator</ComputedPlatform>
<ComputedPlatform Condition="'$(ComputedPlatform)' == ''">iPhone</ComputedPlatform>
</PropertyGroup>

Expand Down
35 changes: 3 additions & 32 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/DetectSdkLocation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ public class DetectSdkLocations : XamarinTask, ICancelableTask {
const string SdkVersionDefaultValue = "default";
#region Inputs

public string TargetArchitectures {
get; set;
} = "";

public string IsDotNetSimulatorBuild {
[Required]
public bool SdkIsSimulator {
get; set;
} = "";
}

#endregion Inputs

Expand All @@ -37,11 +34,6 @@ public string SdkDevPath {
get; set;
} = "";

[Output]
public bool SdkIsSimulator {
get; set;
}

[Output]
public string SdkPlatform {
get; set;
Expand Down Expand Up @@ -154,8 +146,6 @@ bool ExecuteImpl ()

AppleSdkSettings.Init ();

SetIsSimulator ();

if (EnsureAppleSdkRoot ())
EnsureSdkPath ();
EnsureXamarinSdkRoot ();
Expand All @@ -165,25 +155,6 @@ bool ExecuteImpl ()
return !Log.HasLoggedErrors;
}

void SetIsSimulator ()
{
switch (Platform) {
case ApplePlatform.MacCatalyst:
case ApplePlatform.MacOSX:
return;
}

TargetArchitecture architectures;
if (string.IsNullOrEmpty (TargetArchitectures) || !Enum.TryParse (TargetArchitectures, out architectures))
architectures = TargetArchitecture.Default;

if (!string.IsNullOrEmpty (IsDotNetSimulatorBuild)) {
SdkIsSimulator = string.Equals (IsDotNetSimulatorBuild, "true", StringComparison.OrdinalIgnoreCase);
} else {
SdkIsSimulator = (architectures & (TargetArchitecture.i386 | TargetArchitecture.x86_64)) != 0;
}
}

protected bool EnsureAppleSdkRoot ()
{
var currentSdk = CurrentSdk;
Expand Down
4 changes: 1 addition & 3 deletions msbuild/Xamarin.Shared/Xamarin.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2067,18 +2067,16 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<DetectSdkLocations
SessionId="$(BuildSessionId)"
Condition="'$(IsMacEnabled)' == 'true'"
IsDotNetSimulatorBuild="$(_IsDotNetSimulatorBuild)"
SdkVersion="$(_SdkVersion)"
SdkIsSimulator="$(SdkIsSimulator)"
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
TargetArchitectures="$(TargetArchitectures)"
XamarinSdkRoot="$(_XamarinSdkRootOnMac)"
>

<Output TaskParameter="SdkVersion" PropertyName="_SdkVersion" />
<Output TaskParameter="SdkRoot" PropertyName="_SdkRoot" />
<Output TaskParameter="SdkDevPath" PropertyName="_SdkDevPath" />
<Output TaskParameter="SdkPlatform" PropertyName="_SdkPlatform" />
<Output TaskParameter="SdkIsSimulator" PropertyName="_SdkIsSimulator" />
<Output TaskParameter="XamarinSdkRoot" PropertyName="_XamarinSdkRoot" />
<Output TaskParameter="XcodeVersion" PropertyName="_XcodeVersion" />
</DetectSdkLocations>
Expand Down
Loading