Skip to content

Commit

Permalink
[dotnet][msbuild] Do not copy .pdb files inside .app for release …
Browse files Browse the repository at this point in the history
…builds (#11153)

The original goal was to remove the `.dylib` from the app bundle.
However some are required, even in release, so that will need to be
fixed first [1]

[1] #11145
  • Loading branch information
spouliot committed Apr 8, 2021
1 parent 219c697 commit 578a80c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -674,23 +674,24 @@
</PropertyGroup>

<Target Name="_ComputePublishLocation" DependsOnTargets="_GenerateBundleName;_ParseBundlerArguments">
<!-- Put .dll, .pdb, .exe and .dylib in the .app -->
<PropertyGroup>
<_AssemblyPublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'">$(MSBuildProjectDirectory)$(_AppBundlePath)\</_AssemblyPublishDir>
<_AssemblyPublishDir Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">$(MSBuildProjectDirectory)$(_AppBundlePath)\Contents\$(_CustomBundleName)\</_AssemblyPublishDir>
<_DylibPublishDir Condition="'$(_PlatformName)' == 'iOS' Or '$(_PlatformName)' == 'tvOS' Or '$(_PlatformName)' == 'watchOS'">$(MSBuildProjectDirectory)$(_AppBundlePath)\</_DylibPublishDir>
<_DylibPublishDir Condition="'$(_PlatformName)' == 'macOS' Or '$(_PlatformName)' == 'MacCatalyst'">$(MSBuildProjectDirectory)$(_AppBundlePath)\Contents\$(_CustomBundleName)\</_DylibPublishDir>
</PropertyGroup>
<ItemGroup>
<!-- include .dll, .exe and, for debugging only, .pdb files inside the .app -->
<ResolvedFileToPublish
Update="@(ResolvedFileToPublish)"
RelativePath="$([MSBuild]::MakeRelative($(MSBuildProjectDirectory)$(PublishDir),$(_AssemblyPublishDir)))%(ResolvedFileToPublish.DestinationSubDirectory)%(Filename)%(Extension)"
Condition="'%(Extension)' == '.dll' Or '%(Extension)' == '.pdb' Or '%(Extension)' == '.exe'" />
Condition="'%(Extension)' == '.dll' Or ('$(_BundlerDebug)' == 'true' And '%(Extension)' == '.pdb') Or '%(Extension)' == '.exe'" />
<!-- Copy the app.config file to the app bundle -->
<ResolvedFileToPublish
Update="@(ResolvedFileToPublish)"
RelativePath="$([MSBuild]::MakeRelative($(MSBuildProjectDirectory)$(PublishDir),$(_AssemblyPublishDir)))%(ResolvedFileToPublish.DestinationSubDirectory)%(ResolvedFileToPublish.TargetPath)"
Condition="'$(AppConfig)' != '' And '%(ResolvedFileToPublish.OriginalItemSpec)' == '$(AppConfig)' And '%(ResolvedFileToPublish.Link)' == 'app.config' And '%(ResolvedFileToPublish.TargetPath)' != ''" />
<!-- .dylib are never needed (nor allowed) for fully AOT'ed applications FIXME https://github.com/xamarin/xamarin-macios/issues/11145 -->
<ResolvedFileToPublish
Update="@(ResolvedFileToPublish)"
RelativePath="$([MSBuild]::MakeRelative($(MSBuildProjectDirectory)$(PublishDir),$(_DylibPublishDir)))%(Filename)%(Extension)"
Expand Down

3 comments on commit 578a80c

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

Packages generated

View packages

Test results

18 tests failed, 164 tests passed.

Failed tests

  • monotouch-test/Mac [dotnet]/Debug [dotnet]: Failed (Test run crashed (exit code: 134).
    No test log file was produced)
  • monotouch-test/iOS Unified 64-bits - simulator/Debug [dotnet]: LaunchFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (LinkSdk) [dotnet]: LaunchFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (static registrar) [dotnet]: LaunchFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Release (all optimizations) [dotnet]: LaunchFailure
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (all optimizations) [dotnet]: LaunchFailure
  • interdependent-binding-projects/iOS Unified 64-bits - simulator/Debug [dotnet]: LaunchFailure
  • introspection/iOS Unified 64-bits - simulator/Debug [dotnet]: LaunchFailure
  • introspection/tvOS - simulator/Debug [dotnet]: LaunchFailure
  • introspection/iOS Unified 64-bits - simulator/Debug (iOS 10.3) [dotnet]: Failed
  • introspection/tvOS - simulator/Debug (tvOS 10.2) [dotnet]: Failed
  • dont link/iOS Unified 64-bits - simulator/Debug [dotnet]: LaunchFailure
  • dont link/iOS Unified 64-bits - simulator/Release [dotnet]: LaunchFailure
  • link all/iOS Unified 64-bits - simulator/Debug [dotnet]: LaunchFailure
  • link all/iOS Unified 64-bits - simulator/Release [dotnet]: LaunchFailure
  • link sdk/iOS Unified 64-bits - simulator/Debug [dotnet]: LaunchFailure
  • link sdk/iOS Unified 64-bits - simulator/Release [dotnet]: LaunchFailure
  • DotNet tests: Failed (Execution failed with exit code 1)

Pipeline on Agent XAMBOT-1038.Catalina'

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Tests failed on VSTS: device tests tvOS ❌

Tests failed on VSTS: device tests tvOS.

Test results

1 tests failed, 156 tests' device not found, 5 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug: BuildFailure

Pipeline on Agent XAMTESTMAC14

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Tests failed on VSTS: device tests iOS32b ❌

Tests failed on VSTS: device tests iOS32b.

Test results

1 tests failed, 169 tests' device not found, 5 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug: BuildFailure

Pipeline on Agent XI-CAPTAIN-MARVEL

Please sign in to comment.