Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
</Target>

<!-- Locate the runtime package according to the current target runtime -->
<Target Name="ImportRuntimeIlcPackageTarget" Condition="'$(BuildingFrameworkLibrary)' != 'true' and '$(PublishAot)' == 'true'" DependsOnTargets="$(ImportRuntimeIlcPackageTargetDependsOn)" BeforeTargets="Publish">
<Target Name="ImportRuntimeIlcPackageTarget" Condition="'$(BuildingFrameworkLibrary)' != 'true' and '$(PublishAot)' == 'true'" DependsOnTargets="$(ImportRuntimeIlcPackageTargetDependsOn)">
<Error Condition="'@(ResolvedILCompilerPack)' == ''" Text="The ResolvedILCompilerPack ItemGroup is required for target ImportRuntimeIlcPackageTarget" />
Comment thread
sbomer marked this conversation as resolved.

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,20 @@
</Target>

<!--
This target hooks into the dotnet CLI publish pipeline. That pipeline has
a target called ComputeFilesToPublish which produces the ItemGroup
ResolvedFileToPublish. We modify this item group to control what gets
published after NativeAOT optimizes the application.
============================================================
NativeCompile

Redefine the SDK's empty NativeCompile placeholder target to perform the full
NativeAOT compilation pipeline: ILC compilation, native linking, and updating
ResolvedFileToPublish to replace managed assemblies with the native binary.

The SDK sequences this target in the publish pipeline as:
ComputeResolvedFilesToPublishList -> ILLink -> NativeCompile -> ...

This gives us a clean, explicit position after ILLink (trim configuration).
Comment thread
sbomer marked this conversation as resolved.
Outdated
============================================================
-->
<Target Name="ComputeLinkedFilesToPublish"
AfterTargets="ComputeResolvedFilesToPublishList"
<Target Name="NativeCompile"
DependsOnTargets="_ComputeAssembliesToCompileToNative;LinkNative">

<ItemGroup>
Expand Down Expand Up @@ -60,6 +67,10 @@
</ItemGroup>
</Target>

<!-- Back-compat: keep ComputeLinkedFilesToPublish as an empty target for anything that
references it via BeforeTargets/AfterTargets. The work moved to NativeCompile. -->
<Target Name="ComputeLinkedFilesToPublish" />
Comment thread
sbomer marked this conversation as resolved.
Outdated

<!--
Classify ResolvedFileToPublish for NativeAOT, then replace CoreCLR runtime pack
files with DefaultFrameworkAssemblies (tagged PostprocessAssembly=true) so that
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ The .NET Foundation licenses this file to you under the MIT license.
</ItemDefinitionGroup>

<!-- The properties below need to be defined only after we've found the correct runtime package reference -->
<Target Name="SetupProperties" DependsOnTargets="$(IlcSetupPropertiesDependsOn)" BeforeTargets="Publish">
<Target Name="SetupProperties" DependsOnTargets="$(IlcSetupPropertiesDependsOn)">
Comment thread
sbomer marked this conversation as resolved.
<ItemGroup>
<_NETCoreAppFrameworkReference Include="@(ResolvedFrameworkReference)" Condition="'%(ResolvedFrameworkReference.RuntimePackName)' == 'Microsoft.NETCore.App.Runtime.NativeAOT.$(RuntimeIdentifier)'" />
</ItemGroup>
Expand Down Expand Up @@ -156,7 +156,7 @@ The .NET Foundation licenses this file to you under the MIT license.
</ItemGroup>
</Target>

<Target Name="ComputeIlcCompileInputs" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)" BeforeTargets="Publish">
<Target Name="ComputeIlcCompileInputs" DependsOnTargets="$(IlcDynamicBuildPropertyDependencies)">
Comment thread
sbomer marked this conversation as resolved.
<ItemGroup>
<ManagedBinary Condition="$(BuildingFrameworkLibrary) != 'true'" Include="@(IntermediateAssembly)" />
<IlcCompileInput Include="@(ManagedBinary)" />
Expand Down
Loading