Skip to content

Commit 47a15c4

Browse files
Copilotrolfbjarne
andcommitted
Merge main and add ProjectInspector.csproj to .gitignore
Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
1 parent 20e527b commit 47a15c4

File tree

343 files changed

+3643
-7850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

343 files changed

+3643
-7850
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Make.config.inc
33
Make.config.local
44
configure.inc
55
dotnet.config
6+
ProjectInspector.csproj
67
_ios-build
78
_mac-build
89
_build

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[submodule "external/Xamarin.MacDev"]
22
path = external/Xamarin.MacDev
3-
url = ../../dotnet/macios-devtools
3+
url = https://github.com/dotnet/macios-devtools
44
branch = main
55

Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
<MicrosoftBuildFrameworkPackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildFrameworkPackageVersion>
99
<MicrosoftBuildTasksCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildTasksCorePackageVersion>
1010
<MicrosoftBuildUtilitiesCorePackageVersion>$(MicrosoftBuildPackageVersion)</MicrosoftBuildUtilitiesCorePackageVersion>
11+
<NUnitPackageVersion>4.4.0</NUnitPackageVersion>
12+
<NUnitConsoleRunnerPackageVersion>3.22.0</NUnitConsoleRunnerPackageVersion>
13+
<NUnit3TestAdapterPackageVersion>6.1.0</NUnit3TestAdapterPackageVersion>
1114
<NUnitXmlTestLoggerPackageVersion>3.1.15</NUnitXmlTestLoggerPackageVersion>
15+
<MicrosoftNETTestSdkPackageVersion>18.0.1</MicrosoftNETTestSdkPackageVersion>
1216
<!-- Fix transient dependency issue found by component governance 4.7.0 -> 4.7.2 brought by Microsoft.Build package -->
1317
<SystemDrawingCommonPackageVersion>4.7.2</SystemDrawingCommonPackageVersion>
1418
<!-- Fix transient dependency issue found by component governance 4.7.0 -> 4.7.1 brought by Microsoft.Build.Tasks.Core package -->

NuGet.config

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<clear />
1111
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
1212
<!-- Begin: Package sources from dotnet-dotnet -->
13-
<add key="darc-pub-dotnet-dotnet-9441e5b" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-9441e5bb/nuget/v3/index.json" />
13+
<add key="darc-pub-dotnet-dotnet-455f135" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-dotnet-455f1358/nuget/v3/index.json" />
1414
<!-- End: Package sources from dotnet-dotnet -->
1515
<!-- Begin: Package sources from dotnet-macios -->
16-
<add key="darc-pub-dotnet-macios-e6a0fb7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-macios-e6a0fb79/nuget/v3/index.json" />
16+
<add key="darc-pub-dotnet-macios-6406450" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-macios-64064500/nuget/v3/index.json" />
1717
<!-- End: Package sources from dotnet-macios -->
1818
<!-- Begin: Package sources from xamarin-xamarin-macios -->
1919
<!-- End: Package sources from xamarin-xamarin-macios -->
@@ -38,10 +38,14 @@
3838
<add key="darc-pub-dotnet-runtime-ad2d4fbc" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-ad2d4fbc/nuget/v3/index.json" />
3939
<!-- Add a 8.0.23 feed -->
4040
<add key="darc-pub-dotnet-runtime-891f8976" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-891f8976/nuget/v3/index.json" />
41+
<!-- Add a 8.0.24 feed -->
42+
<add key="darc-pub-dotnet-runtime-b43df221" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-b43df221/nuget/v3/index.json" />
4143
<!-- Add a 9.0.11 feed -->
4244
<add key="darc-pub-dotnet-runtime-35fe9c61" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-35fe9c61/nuget/v3/index.json" />
4345
<!-- Add a 9.0.12 feed -->
4446
<add key="darc-pub-dotnet-runtime-9c2fb4b7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-9c2fb4b7/nuget/v3/index.json" />
47+
<!-- Add a 9.0.13 feed -->
48+
<add key="darc-pub-dotnet-runtime-7dd1559a" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-runtime-7dd1559a/nuget/v3/index.json" />
4549
</packageSources>
4650
<disabledPackageSources>
4751
<clear />

docs/building-apps/build-properties.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,20 @@ Only applicable to macOS and Mac Catalyst projects.
344344

345345
See [BuildIpa](#buildipa) for iOS and tvOS projects.
346346

347+
## Device
348+
349+
Specifies which mobile device or emulator to target when using `dotnet run
350+
--device <Device>` or MSBuild targets that interact with devices (such as
351+
`Run`, `Install`, or `Uninstall`).
352+
353+
The value can be anything the command-line tools `simctl` or `devicectl`
354+
accept for the device name; this is typically either the UDID or the name of
355+
the device. For example, for the device `My iOS Device` with UDID `00001111-012301230123ABCD`, use
356+
either `-p:Device="My iOS Device"` or `-p:Device=00001111-012301230123ABCD`.
357+
358+
For more information about device selection, see the
359+
[.NET SDK device selection specification](https://github.com/dotnet/sdk/blob/2b9fc02a265c735f2132e4e3626e94962e48bdf5/documentation/specs/dotnet-run-for-maui.md).
360+
347361
## DeviceSpecificBuild
348362

349363
If the build should be specific to the selected device.

docs/building-apps/build-targets.md

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,39 @@ Builds the source code within a project and all dependencies.
1616

1717
Removes all files generated by the build process.
1818

19+
## ComputeAvailableDevices
20+
21+
Queries and returns a list of available iOS or tvOS devices and simulators that can be used with `dotnet run`.
22+
23+
This target is called automatically by the .NET SDK's `dotnet run` command to
24+
support device selection via the `--device` option. It returns a `@(Devices)`
25+
item group where each device has the following metadata:
26+
27+
- **Description**: The name of the device (e.g., "iPhone 16 - iOS 26.0" for simulators, "My iPhone 16" for physical devices)
28+
- **Type**: Either "Device" or "Simulator"
29+
- **OSVersion**: The OS version of the device
30+
- **UDID**: The UDID of the device
31+
- **RuntimeIdentifier**: The RuntimeIdentifier of the device
32+
33+
For example, to list all available devices:
34+
35+
```shell
36+
$ dotnet build -t:ComputeAvailableDevices
37+
```
38+
39+
This target is part of the [.NET SDK device selection specification](https://github.com/dotnet/sdk/blob/2b9fc02a265c735f2132e4e3626e94962e48bdf5/documentation/specs/dotnet-run-for-maui.md) and enables commands like:
40+
41+
```shell
42+
$ dotnet run --device UDID
43+
```
44+
45+
Added in .NET 11.
46+
1947
## Run
2048

2149
Builds the source code within a project and all dependencies, and then deploys and runs it
22-
on a default simulator/device. A specific deployment target can be set by using the `$(_DeviceName)` property.
50+
on a default simulator/device. A specific deployment target can be set by using the `$(Device)` property.
2351

2452
```dotnetcli
25-
dotnet build -t:Run project.csproj -p:_DeviceName=$(MY_DEVICE_UDID)
53+
dotnet build -t:Run project.csproj -p:Device=$(MY_DEVICE_UDID)
2654
```

dotnet/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ $(1)_NUGET_TARGETS = \
3333
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.props \
3434
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.Versions.props \
3535
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.$(1).Sdk.targets \
36+
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.Sdk.Desktop.targets \
3637
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.Sdk.Eol.targets \
38+
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Microsoft.Sdk.Mobile.targets \
3739
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.DefaultItems.targets \
3840
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.Publish.targets \
3941
$(DOTNET_DESTDIR)/$($(1)_NUGET_SDK_NAME)/targets/Xamarin.Shared.Sdk.TargetFrameworkInference.props \
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Target
4+
Name="_PrepareRunDesktop"
5+
BeforeTargets="ComputeRunArguments"
6+
Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">
7+
8+
<PropertyGroup Condition="'$(RunWithOpen)' != 'false'">
9+
<_OpenArguments Condition="'$(XamarinDebugMode)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_MODE__=$(XamarinDebugMode)</_OpenArguments>
10+
<_OpenArguments Condition="'$(XamarinDebugPort)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_PORT__=$(XamarinDebugPort)</_OpenArguments>
11+
<_OpenArguments Condition="'$(XamarinDebugHosts)' != ''">$(_OpenArguments) --env "__XAMARIN_DEBUG_HOSTS__=$(XamarinDebugHosts)"</_OpenArguments>
12+
<_OpenArguments Condition="'$(XamarinDebugConnectTimeout)' != ''">$(_OpenArguments) --env __XAMARIN_DEBUG_CONNECT_TIMEOUT__=$(XamarinDebugConnectTimeout)</_OpenArguments>
13+
<_OpenArguments Condition="'$(StandardOutputPath)' != ''">$(_OpenArguments) --stdout "$(StandardOutputPath)"</_OpenArguments>
14+
<_OpenArguments Condition="'$(StandardErrorPath)' != ''">$(_OpenArguments) --stderr "$(StandardErrorPath)"</_OpenArguments>
15+
<_OpenArguments Condition="'$(StandardInputPath)' != ''">$(_OpenArguments) --stdin "$(StandardInputPath)"</_OpenArguments>
16+
<_OpenArgumentsPre Condition="'$(OpenNewInstance)' == 'true'">-n </_OpenArgumentsPre>
17+
<_OpenArgumentsPre Condition="'$(OpenWaitForExit)' == 'true'">$(_OpenArgumentsPre) -W </_OpenArgumentsPre>
18+
<_OpenArguments>$(_OpenArguments) $(RunEnvironment)</_OpenArguments>
19+
<RunCommand>open</RunCommand>
20+
<RunArguments>$(_OpenArgumentsPre) -a "$(TargetDir)/$(_AppBundleName).app" $(OpenArguments) $(_OpenArguments) --args</RunArguments>
21+
</PropertyGroup>
22+
23+
<PropertyGroup Condition="'$(RunWithOpen)' == 'false'">
24+
<RunCommand>$(TargetDir)/$(_AppBundleName).app/Contents/MacOS/$(_NativeExecutableName)</RunCommand>
25+
<RunArguments />
26+
</PropertyGroup>
27+
</Target>
28+
</Project>
Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<!-- Install & Run -->
5+
6+
<PropertyGroup>
7+
<!-- We used to use '_MlaunchPath' as the property name, but we've made it public, so it's MlaunchPath now, but keep setting/supporting the underscored version for a while -->
8+
<MlaunchPath Condition="'$(MlaunchPath)' == '' And '$(_MlaunchPath)' != ''">$(_MlaunchPath)</MlaunchPath>
9+
<MlaunchPath Condition="'$(MlaunchPath)' == ''">$(_XamarinSdkRootDirectory)tools\bin\mlaunch</MlaunchPath>
10+
<_MlaunchPath Condition="'$(_MlaunchPath)' == ''">$(MlaunchPath)</_MlaunchPath>
11+
<!-- this is the path to mlaunch relative to the root of the .NET installation -->
12+
<!-- We used to use '_RelativeMlaunchPath' as the property name, but we've made it public, so it's RelativeMlaunchPath now, but keep setting/supporting the underscored version for a while -->
13+
<RelativeMlaunchPath Condition="'$(RelativeMlaunchPath)' == '' And '$(_RelativeMlaunchPath)' != ''">$(_RelativeMlaunchPath)</RelativeMlaunchPath>
14+
<RelativeMlaunchPath Condition="'$(RelativeMlaunchPath)' == ''">$(XamarinRelativeSdkRootDirectory)tools\bin\mlaunch</RelativeMlaunchPath>
15+
<_RelativeMlaunchPath Condition="'$(_RelativeMlaunchPath)' == ''">$(RelativeMlaunchPath)</_RelativeMlaunchPath>
16+
17+
<!-- Try to keep _DeviceName working for a while yet -->
18+
<Device Condition="'$(Device)' == ''">$(_DeviceName)</Device>
19+
</PropertyGroup>
20+
21+
<Target
22+
Name="ShowRunHelp"
23+
DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest">
24+
<Error Condition="$([MSBuild]::IsOSPlatform('windows'))" Text="It's currently not supported to launch an app from the command line on Windows." />
25+
<Error Condition="!Exists('$(_AppBundleManifestPath)')" Text="The app must be built before showing how to launch it." />
26+
27+
<GetMlaunchArguments
28+
AppManifestPath="$(_AppBundleManifestPath)"
29+
Help="true"
30+
MlaunchPath="$(MlaunchPath)"
31+
SdkDevPath="$(_SdkDevPath)"
32+
SdkIsSimulator="$(_SdkIsSimulator)"
33+
SdkVersion="$(_SdkVersion)"
34+
SupportedOSPlatformVersion="$(SupportedOSPlatformVersion)"
35+
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
36+
>
37+
</GetMlaunchArguments>
38+
39+
<!-- If invoked from 'dotnet run', don't actually run anything -->
40+
<PropertyGroup>
41+
<RunCommand>true</RunCommand>
42+
<RunArguments />
43+
</PropertyGroup>
44+
</Target>
45+
<Target Name="_ShowRunHelpConditioned" Condition="'$(Help)' == 'true'" DependsOnTargets="ShowRunHelp" />
46+
47+
<Target Name="ComputeMlaunchInstallArguments" DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;_ShowRunHelpConditioned;_ComputeMlaunchInstallArguments" />
48+
<Target Name="_ComputeMlaunchInstallArguments" Condition="'$(_SdkIsSimulator)' == 'false' And '$(Help)' != 'true'">
49+
<!-- Launching from the command line on windows hasn't been implemented: https://github.com/dotnet/macios/issues/16609 -->
50+
<Error Condition="$([MSBuild]::IsOSPlatform('windows'))" Text="It's currently not supported to launch an app from the command line on Windows." />
51+
<Error Condition="!Exists('$(_AppBundleManifestPath)')" Text="The app must be built before the arguments to launch the app using mlaunch can be computed." />
52+
53+
<GetMlaunchArguments
54+
SessionId="$(BuildSessionId)"
55+
AppManifestPath="$(_AppBundleManifestPath)"
56+
DeviceName="$(Device)"
57+
InstallApp="$(_AppBundlePath)"
58+
MlaunchPath="$(MlaunchPath)"
59+
SdkDevPath="$(_SdkDevPath)"
60+
SdkIsSimulator="$(_SdkIsSimulator)"
61+
SdkVersion="$(_SdkVersion)"
62+
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
63+
>
64+
<Output TaskParameter="MlaunchArguments" PropertyName="MlaunchInstallArguments" />
65+
</GetMlaunchArguments>
66+
67+
<WriteLinesToFile
68+
File="$(MlaunchInstallScript)"
69+
Lines="$(MlaunchPath) $(MlaunchInstallArguments)"
70+
Overwrite="true"
71+
WriteOnlyWhenDifferent="true"
72+
Condition="'$(MlaunchInstallScript)' != ''"
73+
/>
74+
</Target>
75+
76+
<Target Name="_InstallMobile" DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;ComputeMlaunchInstallArguments" Condition="'$(_SdkIsSimulator)' == 'false'">
77+
<Exec SessionId="$(BuildSessionId)" Command="'$(MlaunchPath)' $(MlaunchInstallArguments)" />
78+
</Target>
79+
80+
<Target Name="ComputeMlaunchRunArguments" DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;_ShowRunHelpConditioned;_ComputeMlaunchRunArguments" Condition="'$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst'" />
81+
82+
<Target Name="_ComputeMlaunchRunArguments" Condition="'$(Help)' != 'true'">
83+
<!-- Launching from the command line on windows hasn't been implemented: https://github.com/dotnet/macios/issues/16609 -->
84+
<Error Condition="$([MSBuild]::IsOSPlatform('windows'))" Text="It's currently not supported to launch an app from the command line on Windows." />
85+
<Error Condition="!Exists('$(_AppBundleManifestPath)')" Text="The app must be built before the arguments to launch the app using mlaunch can be computed." />
86+
87+
<PropertyGroup>
88+
<!-- capture output by default -->
89+
<_MlaunchCaptureOutput Condition="'$(_MlaunchCaptureOutput)' == ''">true</_MlaunchCaptureOutput>
90+
<!-- wait for exit by default -->
91+
<_MlaunchWaitForExit Condition="'$(_MlaunchWaitForExit)' == ''">true</_MlaunchWaitForExit>
92+
<!-- don't set standard output/error path, mlaunch will by default write to stdout/stderr -->
93+
</PropertyGroup>
94+
<ItemGroup>
95+
<MlaunchEnvironmentVariables Include="__XAMARIN_DEBUG_MODE__=$(XamarinDebugMode)" Condition="'$(XamarinDebugMode)' != ''" />
96+
<MlaunchEnvironmentVariables Include="__XAMARIN_DEBUG_PORT__=$(XamarinDebugPort)" Condition="'$(XamarinDebugPort)' != ''" />
97+
<MlaunchEnvironmentVariables Include="__XAMARIN_DEBUG_HOSTS__=$(XamarinDebugHosts.Replace(';', '%3B'))" Condition="'$(XamarinDebugHosts)' != ''" />
98+
<MlaunchEnvironmentVariables Include="__XAMARIN_DEBUG_CONNECT_TIMEOUT__=$(XamarinDebugConnectTimeout)" Condition="'$(XamarinDebugConnectTimeout)' != ''" />
99+
<!-- It's not possible to set an item group from the command line, so add support for setting a property (with semi-colon separated items) that we'll include into the item group -->
100+
<MlaunchAdditionalArguments Include="$(MlaunchAdditionalArgumentsProperty)" Condition="'$(MlaunchAdditionalArgumentsProperty)' != ''" />
101+
</ItemGroup>
102+
<GetMlaunchArguments
103+
SessionId="$(BuildSessionId)"
104+
AdditionalArguments="@(MlaunchAdditionalArguments)"
105+
AppManifestPath="$(_AppBundleManifestPath)"
106+
CaptureOutput="$(_MlaunchCaptureOutput)"
107+
DeviceName="$(Device)"
108+
EnvironmentVariables="@(MlaunchEnvironmentVariables)"
109+
LaunchApp="$(_AppBundlePath)"
110+
MlaunchPath="$(MlaunchPath)"
111+
SdkIsSimulator="$(_SdkIsSimulator)"
112+
SdkDevPath="$(_SdkDevPath)"
113+
SdkVersion="$(_SdkVersion)"
114+
StandardErrorPath="$(_MlaunchStandardErrorPath)"
115+
StandardOutputPath="$(_MlaunchStandardOutputPath)"
116+
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
117+
WaitForExit="$(_MlaunchWaitForExit)"
118+
>
119+
<Output TaskParameter="MlaunchArguments" PropertyName="MlaunchRunArguments" />
120+
</GetMlaunchArguments>
121+
122+
<WriteLinesToFile
123+
File="$(MlaunchRunScript)"
124+
Lines="$(MlaunchPath) $(MlaunchRunArguments)"
125+
Overwrite="true"
126+
WriteOnlyWhenDifferent="true"
127+
Condition="'$(MlaunchRunScript)' != ''"
128+
/>
129+
130+
<PropertyGroup>
131+
<RunCommand>$(MlaunchPath)</RunCommand>
132+
<RunArguments>$(MlaunchRunArguments) -- </RunArguments>
133+
</PropertyGroup>
134+
</Target>
135+
136+
<!-- This is only needed for mobile platforms, RunCommand and RunArguments are defined for macOS in Microsoft.macOS.Sdk.targets. -->
137+
<Target
138+
Name="_PrepareRunMobile"
139+
BeforeTargets="ComputeRunArguments"
140+
DependsOnTargets="_InstallMobile;ComputeMlaunchRunArguments"
141+
Condition="'$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst'">
142+
</Target>
143+
144+
<!--
145+
***********************************************************************************************
146+
ComputeAvailableDevices
147+
148+
Target that queries available devices and simulators.
149+
This target is called by 'dotnet run' to support device selection.
150+
Returns @(Devices) items that always has these metadata: Description, Type, OSVersion, UDID, RuntimeIdentifier
151+
(but others might be present too, for debug purposes, depending on whether it's a simulator or a device)
152+
153+
See: https://github.com/dotnet/sdk/blob/2b9fc02a265c735f2132e4e3626e94962e48bdf5/documentation/specs/dotnet-run-for-maui.md
154+
***********************************************************************************************
155+
-->
156+
<Target Name="ComputeAvailableDevices"
157+
DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;"
158+
Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS'"
159+
Returns="@(Devices)">
160+
<PropertyGroup>
161+
<_FilterDevicesToRuntimeIdentifier Condition="'$(_XamarinUsingDefaultRuntimeIdentifier)' != 'true'">$(RuntimeIdentifier)</_FilterDevicesToRuntimeIdentifier>
162+
</PropertyGroup>
163+
<GetAvailableDevices
164+
Condition="'$(IsMacEnabled)' == 'true'"
165+
SessionId="$(BuildSessionId)"
166+
AppBundleManifestPath="$(_AppBundleManifestPath)"
167+
RuntimeIdentifier="$(_FilterDevicesToRuntimeIdentifier)"
168+
SdkDevPath="$(_SdkDevPath)"
169+
TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)"
170+
Verbose="$(Verbose)"
171+
>
172+
<Output TaskParameter="Devices" ItemName="Devices" />
173+
<Output TaskParameter="DiscardedDevices" ItemName="DiscardedDevices" />
174+
</GetAvailableDevices>
175+
</Target>
176+
177+
</Project>

dotnet/targets/Xamarin.Shared.Sdk.DefaultItems.targets

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,8 @@
5959
</PropertyGroup>
6060
</Target>
6161

62-
<PropertyGroup Condition="('$(RuntimeIdentifier)' != '' Or '$(RuntimeIdentifiers)' != '') And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS')">
63-
<_IsDotNetSimulatorBuild Condition="$(RuntimeIdentifier.Contains('simulator')) Or $(RuntimeIdentifiers.Contains('simulator'))">true</_IsDotNetSimulatorBuild>
64-
<_IsDotNetSimulatorBuild Condition="'$(_IsDotNetSimulatorBuild)' == ''">false</_IsDotNetSimulatorBuild>
65-
</PropertyGroup>
66-
6762
<PropertyGroup Condition="'$(ComputedPlatform)' == '' And ('$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS') ">
68-
<ComputedPlatform Condition="'$(_IsDotNetSimulatorBuild)' == 'true'">iPhoneSimulator</ComputedPlatform>
63+
<ComputedPlatform Condition="'$(SdkIsSimulator)' == 'true'">iPhoneSimulator</ComputedPlatform>
6964
<ComputedPlatform Condition="'$(ComputedPlatform)' == ''">iPhone</ComputedPlatform>
7065
</PropertyGroup>
7166

0 commit comments

Comments
 (0)