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
12 changes: 9 additions & 3 deletions dotnet/targets/Microsoft.Sdk.Mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@

<Target
Name="ShowRunHelp"
DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest">
DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;ComputeAvailableDevices">
<Error Condition="$([MSBuild]::IsOSPlatform('windows'))" Text="It's currently not supported to launch an app from the command line on Windows." />
<Error Condition="!Exists('$(_AppBundleManifestPath)')" Text="The app must be built before showing how to launch it." />

<GetMlaunchArguments
AppManifestPath="$(_AppBundleManifestPath)"
DiscardedDevices="@(DiscardedDevices)"
Devices="@(Devices)"
Help="true"
MlaunchPath="$(MlaunchPath)"
SdkDevPath="$(_SdkDevPath)"
Expand All @@ -44,7 +46,7 @@
</Target>
<Target Name="_ShowRunHelpConditioned" Condition="'$(Help)' == 'true'" DependsOnTargets="ShowRunHelp" />

<Target Name="ComputeMlaunchInstallArguments" DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;_ShowRunHelpConditioned;_ComputeMlaunchInstallArguments" />
<Target Name="ComputeMlaunchInstallArguments" DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;ComputeAvailableDevices;_ShowRunHelpConditioned;_ComputeMlaunchInstallArguments" />
<Target Name="_ComputeMlaunchInstallArguments" Condition="'$(_SdkIsSimulator)' == 'false' And '$(Help)' != 'true'">
<!-- Launching from the command line on windows hasn't been implemented: https://github.com/dotnet/macios/issues/16609 -->
<Error Condition="$([MSBuild]::IsOSPlatform('windows'))" Text="It's currently not supported to launch an app from the command line on Windows." />
Expand All @@ -53,6 +55,8 @@
<GetMlaunchArguments
SessionId="$(BuildSessionId)"
AppManifestPath="$(_AppBundleManifestPath)"
DiscardedDevices="@(DiscardedDevices)"
Devices="@(Devices)"
DeviceName="$(Device)"
InstallApp="$(_AppBundlePath)"
MlaunchPath="$(MlaunchPath)"
Expand All @@ -77,7 +81,7 @@
<Exec SessionId="$(BuildSessionId)" Command="'$(MlaunchPath)' $(MlaunchInstallArguments)" />
</Target>

<Target Name="ComputeMlaunchRunArguments" DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;_ShowRunHelpConditioned;_ComputeMlaunchRunArguments" Condition="'$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst'" />
<Target Name="ComputeMlaunchRunArguments" DependsOnTargets="_DetectSdkLocations;_GenerateBundleName;_DetectAppManifest;ComputeAvailableDevices;_ShowRunHelpConditioned;_ComputeMlaunchRunArguments" Condition="'$(_PlatformName)' != 'macOS' And '$(_PlatformName)' != 'MacCatalyst'" />

<Target Name="_ComputeMlaunchRunArguments" Condition="'$(Help)' != 'true'">
<!-- Launching from the command line on windows hasn't been implemented: https://github.com/dotnet/macios/issues/16609 -->
Expand Down Expand Up @@ -105,6 +109,8 @@
AdditionalArguments="@(MlaunchAdditionalArguments)"
AppManifestPath="$(_AppBundleManifestPath)"
CaptureOutput="$(_MlaunchCaptureOutput)"
DiscardedDevices="@(DiscardedDevices)"
Devices="@(Devices)"
DeviceName="$(Device)"
EnvironmentVariables="@(MlaunchEnvironmentVariables)"
LaunchApp="$(_AppBundlePath)"
Expand Down
Loading
Loading