Skip to content

Commit

Permalink
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on fi…
Browse files Browse the repository at this point in the history
…les we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to
'ResolvedFileToPublish', so that they're not copied unnecessarily (in the case
of the native executable it would also remove the code signature).

Fixes #11611.
  • Loading branch information
rolfbjarne authored Jun 3, 2021
1 parent 4e53d83 commit 863a3dd
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@
<!-- Add all the framework files to ResolvedFileToPublish -->
<ResolvedFileToPublish Include="@(_FrameworkFilesToPublish)">
<RelativePath>%(_FrameworkFilesToPublish._FrameworkPath)\%(_FrameworkFilesToPublish._FrameworkRelativePath)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
Expand All @@ -366,7 +367,9 @@
</_DynamicLibraryToPublish>

<!-- Add all the dynamic libraries to ResolvedFileToPublish -->
<ResolvedFileToPublish Include="@(_DynamicLibraryToPublish)" />
<ResolvedFileToPublish Include="@(_DynamicLibraryToPublish)">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>

Expand Down Expand Up @@ -545,6 +548,7 @@
<!-- copy the aotdata files to the .app -->
<ResolvedFileToPublish Include="%(_AssembliesToAOT.AOTData)" >
<RelativePath>$([MSBuild]::MakeRelative($(MSBuildProjectDirectory)$(PublishDir),$(_NativeExecutablePublishDir)))\%(_AssembliesToAOT.Filename).aotdata.%(_AssembliesToAOT.Arch)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>
Expand Down Expand Up @@ -714,9 +718,10 @@

<ItemGroup>
<!-- Copy the executable from the intermediate directory to the .app -->
<ResolvedFileToPublish
Include="$(_IntermediateNativeLibraryDir)$(_NativeExecutableName)"
RelativePath="$([MSBuild]::MakeRelative($(MSBuildProjectDirectory)$(PublishDir),$(_NativeExecutablePublishDir)))\$(_NativeExecutableName)"/>
<ResolvedFileToPublish Include="$(_IntermediateNativeLibraryDir)$(_NativeExecutableName)">
<RelativePath>$([MSBuild]::MakeRelative($(MSBuildProjectDirectory)$(PublishDir),$(_NativeExecutablePublishDir)))\$(_NativeExecutableName)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>
</ItemGroup>
</Target>

Expand Down

7 comments on commit 863a3dd

@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.

✅ [CI Build] Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

API Diff (from PR only) (no change)
Generator Diff (no change)

Packages generated

View packages

🎉 All 221 tests passed 🎉

Pipeline on Agent XAMBOT-1036.BigSur'
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

@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 were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

@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 were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

@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 macOS Mac Catalina (10.15) ❌

Tests failed on Mac Catalina (10.15).

Failed tests are:

  • introspection

Pipeline on Agent
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

@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 macOS Mac Mojave (10.14) ❌

Tests failed on Mac Mojave (10.14).

Failed tests are:

  • introspection

Pipeline on Agent
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

@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 macOS Mac High Sierra (10.13) ❌

Tests failed on Mac High Sierra (10.13).

Failed tests are:

  • introspection

Pipeline on Agent
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

@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 were not ran (VSTS: device tests iOS32b). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[dotnet] Make sure to set CopyToPublishDirectory=PreserveNewest on files we add to 'ResolvedFileToPublish'. Fixes #11611. (#11797)

Please sign in to comment.