Skip to content
Open
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
13 changes: 10 additions & 3 deletions msbuild/Xamarin.Shared/Xamarin.Shared.targets
Original file line number Diff line number Diff line change
Expand Up @@ -466,9 +466,16 @@ Copyright (C) 2018 Microsoft. All rights reserved.
<Output TaskParameter="BundleResourcesWithLogicalNames" ItemName="_BundleResourceWithLogicalName" />
</CollectBundleResources>

<!-- Write out the list of assets we've processed, so that an inner build in a multi-rid build can skip processing them -->
<WriteItemsToFile Items="@(BundleResource)" Condition="'$(_SaveProcessedItems)' == 'true'" ItemName="BundleResource" File="$(_ProcessedBundleResourcesPath)" Overwrite="true" IncludeMetadata="false" />
<WriteItemsToFile Items="@(Content)" Condition="'$(_SaveProcessedItems)' == 'true'" ItemName="Content" File="$(_ProcessedContentPath)" Overwrite="true" IncludeMetadata="false" />
<!-- Write out the list of assets we've processed, so that an inner build in a multi-rid build can skip processing them.
Items with a PublishFolderType are not actually processed by CollectBundleResources (they go to ResolvedFileToPublish instead),
so don't include them in the list of processed items - inner builds need to see them to add them to ResolvedFileToPublish.
Ref: https://github.com/dotnet/macios/issues/25053 -->
<ItemGroup Condition="'$(_SaveProcessedItems)' == 'true'">
<_BundleResourceToSave Include="@(BundleResource)" Condition="'%(BundleResource.PublishFolderType)' == ''" />
<_ContentToSave Include="@(Content)" Condition="'%(Content.PublishFolderType)' == ''" />
</ItemGroup>
<WriteItemsToFile Items="@(_BundleResourceToSave)" Condition="'$(_SaveProcessedItems)' == 'true'" ItemName="BundleResource" File="$(_ProcessedBundleResourcesPath)" Overwrite="true" IncludeMetadata="false" />
<WriteItemsToFile Items="@(_ContentToSave)" Condition="'$(_SaveProcessedItems)' == 'true'" ItemName="Content" File="$(_ProcessedContentPath)" Overwrite="true" IncludeMetadata="false" />
<ItemGroup>
<FileWrites Include="$(_ProcessedBundleResourcesPath)" />
<FileWrites Include="$(_ProcessedContentPath)" />
Expand Down
1 change: 1 addition & 0 deletions tests/dotnet/BundleStructure/BundleResourceJ.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BundleResourceJ
1 change: 1 addition & 0 deletions tests/dotnet/BundleStructure/ContentJ.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ContentJ
8 changes: 8 additions & 0 deletions tests/dotnet/BundleStructure/shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,10 @@
<Content Include="../ContentH.txt">
<PublishFolderType>None</PublishFolderType>
</Content>
<!-- Content with PublishFolderType=Resource: bundled (https://github.com/dotnet/macios/issues/25053) -->
<Content Include="../ContentJ.txt">
<PublishFolderType>Resource</PublishFolderType>
</Content>

<!-- EmbeddedResource items -->

Expand Down Expand Up @@ -288,6 +292,10 @@
<BundleResource Include="../BundleResourceH.txt">
<PublishFolderType>None</PublishFolderType>
</BundleResource>
<!-- BundleResource with PublishFolderType=Resource: bundled (https://github.com/dotnet/macios/issues/25053) -->
<BundleResource Include="../BundleResourceJ.txt">
<PublishFolderType>Resource</PublishFolderType>
</BundleResource>

<None Remove="@(Content)" />
<None Remove="@(EmbeddedResource)" />
Expand Down
2 changes: 2 additions & 0 deletions tests/dotnet/UnitTests/BundleStructureTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable
expectedFiles.Add (Path.Combine (resourcesDirectory, "ContentD.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "ContentE.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "ContentI.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "ContentJ.txt"));

// expectedFiles.Add (Path.Combine (resourcesDirectory, "EmbeddedResourceA.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "EmbeddedResourceB.txt"));
Expand All @@ -270,6 +271,7 @@ internal static void CheckAppBundleContents (ApplePlatform platform, IEnumerable
expectedFiles.Add (Path.Combine (resourcesDirectory, "BundleResourceD.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "BundleResourceE.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "BundleResourceI.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "BundleResourceJ.txt"));

expectedFiles.Add (Path.Combine (resourcesDirectory, "AutoIncluded.txt"));
expectedFiles.Add (Path.Combine (resourcesDirectory, "SubDirectory"));
Expand Down
Loading