Skip to content

Commit

Permalink
[msbuild] Use the fully resolved path when computing the relative pat…
Browse files Browse the repository at this point in the history
…h for the LogicalName property. Fixes #20330. (#20364)

This fixes an issue where we'd compute a LogicalName property that was outside
of the app bundle, resulting in broken resources in the app bundle (in
particular the app icon would be missing).

So instead of something like this:

    LogicalName: ../../../../../../../../../tmp/testapp/obj/Debug/net8.0-ios/iossimulator-arm64/actool/bundle/Assets.car

we'll now get:

    LogicalName: Assets.car

and the icons will be correctly embedded in the app bundle.

Fixes #20330.
  • Loading branch information
rolfbjarne committed Mar 25, 2024
1 parent 0c2cfaf commit f8626d7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions msbuild/Xamarin.MacDev.Tasks/Tasks/ACTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,12 @@ IEnumerable<ITaskItem> GetCompiledBundleResources (PDictionary output, string in
if (path.EndsWith ("partial-info.plist", StringComparison.Ordinal))
continue;

var vpath = PathUtils.AbsoluteToRelative (pwd, PathUtils.ResolveSymbolicLinks (path));
var resolvedPath = PathUtils.ResolveSymbolicLinks (path);
var vpath = PathUtils.AbsoluteToRelative (pwd, resolvedPath);
var item = new TaskItem (vpath);

// Note: the intermediate bundle dir functions as a top-level bundle dir
var logicalName = PathUtils.AbsoluteToRelative (intermediateBundleDir, path);
var logicalName = PathUtils.AbsoluteToRelative (intermediateBundleDir, resolvedPath);

if (logicalName.StartsWith ("../OnDemandResources/", StringComparison.Ordinal)) {
logicalName = logicalName.Substring (3);
Expand Down

8 comments on commit f8626d7

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.