Skip to content

Commit

Permalink
Fix NativeAOT not using the XAML compilation output (#14966)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrJul authored Mar 15, 2024
1 parent eca012e commit 0aba3ed
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/Avalonia/AvaloniaBuildTasks.targets
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,21 @@
<_DebugSymbolsIntermediatePath Include="@(_AvaloniaXamlCompiledSymbols)"/>
</ItemGroup>
</Target>

<!-- For some reason the IL Compiler hardcodes $(IntermediateOutputPath)$(TargetName)$(TargetExt) instead of using @(IntermediateAssembly), change that to our assembly. -->
<Target Name="InjectIlcAvaloniaXamlOutput"
DependsOnTargets="InjectAvaloniaXamlOutput"
AfterTargets="ComputeIlcCompileInputs"
BeforeTargets="PrepareForILLink"
Condition="'@(AvaloniaResource)@(AvaloniaXaml)' != '' AND $(EnableAvaloniaXamlCompilation) != false">
<ItemGroup>
<ManagedBinary Remove="$(IntermediateOutputPath)$(TargetName)$(TargetExt)" />
<ManagedBinary Include="@(_AvaloniaXamlCompiledAssembly)" />

<IlcCompileInput Remove="$(IntermediateOutputPath)$(TargetName)$(TargetExt)" />
<IlcCompileInput Include="@(_AvaloniaXamlCompiledAssembly)" />
</ItemGroup>
</Target>

<Target Name="Avalonia_CollectUpToDateCheckOutputDesignTime" Condition="'@(AvaloniaResource)@(AvaloniaXaml)' != '' AND $(EnableAvaloniaXamlCompilation) != false"
BeforeTargets="CollectUpToDateCheckOutputDesignTime" DependsOnTargets="PrepareToCompileAvaloniaXaml">
Expand Down

0 comments on commit 0aba3ed

Please sign in to comment.