Skip to content

Commit e83fa35

Browse files
committed
fix(reg): Adjust for XAML Trimming cross-runtime libraries build before Uno 4.6
1 parent afc81e0 commit e83fa35

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

src/SourceGenerators/Uno.UI.Tasks/LinkerHintsGenerator/LinkerHintGeneratorTask.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private const MessageImportance DefaultLogMessageLevel
6262

6363
public override bool Execute()
6464
{
65-
// Debugger.Launch();
65+
Debugger.Launch();
6666

6767
BuildReferences();
6868
OutputPath = AlignPath(OutputPath);
@@ -383,11 +383,29 @@ string RewriteReferencePath(string referencePath, string unoUIPackageBasePath, s
383383
? "net7.0"
384384
: "netstandard2.0";
385385

386-
return
387-
(unoRuntimeIdentifier == "skia" || unoRuntimeIdentifier == "webassembly") &&
388-
referencePath.StartsWith(unoUIPackageBasePath, StringComparison.Ordinal) ?
389-
referencePath.Replace($"lib{separator}{runtimeTargetFramework}", $"uno-runtime{separator}{runtimeTargetFramework}{separator}{unoRuntimeIdentifier}") :
390-
referencePath;
386+
var isUnoRuntimeEnabled = (unoRuntimeIdentifier == "skia" || unoRuntimeIdentifier == "webassembly") &&
387+
referencePath.StartsWith(unoUIPackageBasePath, StringComparison.Ordinal);
388+
389+
if (isUnoRuntimeEnabled)
390+
{
391+
var originalFolderPath = $"lib{separator}{runtimeTargetFramework}";
392+
var preUno46FolderPart = $"uno-runtime{separator}{unoRuntimeIdentifier}";
393+
var postUno46FolderPathPart = $"uno-runtime{separator}{runtimeTargetFramework}{separator}{unoRuntimeIdentifier}";
394+
395+
var post46Path = referencePath.Replace(originalFolderPath, postUno46FolderPathPart);
396+
var pre46Path = referencePath.Replace(originalFolderPath, preUno46FolderPart);
397+
398+
if (File.Exists(post46Path))
399+
{
400+
return post46Path;
401+
}
402+
else if (File.Exists(pre46Path))
403+
{
404+
return pre46Path;
405+
}
406+
}
407+
408+
return referencePath;
391409
}
392410
}
393411

0 commit comments

Comments
 (0)