|
18 | 18 | </PropertyGroup> |
19 | 19 |
|
20 | 20 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.CompileNativeCode" AssemblyFile="$(_TaskAssemblyName)" /> |
| 21 | + <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.CollectPostILTrimInformation" AssemblyFile="$(_TaskAssemblyName)" /> |
| 22 | + <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.CollectUnresolvedNativeSymbols" AssemblyFile="$(_TaskAssemblyName)" /> |
| 23 | + <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.ComputeNativeAOTSurvivingNativeSymbols" AssemblyFile="$(_TaskAssemblyName)" /> |
21 | 24 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.FindAotCompiler" AssemblyFile="$(_TaskAssemblyName)" /> |
22 | 25 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.GetFullPaths" AssemblyFile="$(_TaskAssemblyName)" /> |
23 | 26 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.InstallNameTool" AssemblyFile="$(_TaskAssemblyName)" /> |
24 | 27 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.LinkNativeCode" AssemblyFile="$(_TaskAssemblyName)" /> |
25 | 28 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.MergeAppBundles" AssemblyFile="$(_TaskAssemblyName)" /> |
26 | 29 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.MobileILStrip" AssemblyFile="$(_TaskAssemblyName)" /> |
27 | 30 | <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.MacDevMessage" AssemblyFile="$(_TaskAssemblyName)" /> |
| 31 | + <UsingTask Runtime="$(_TaskRuntime)" TaskName="Xamarin.MacDev.Tasks.PostTrimmingProcessing" AssemblyFile="$(_TaskAssemblyName)" /> |
28 | 32 |
|
29 | 33 | <!-- Project types and how do we distinguish between them |
30 | 34 |
|
|
612 | 616 | @(_BundlerEnvironmentVariables -> 'EnvironmentVariable=Overwrite=%(Overwrite)|%(Identity)=%(Value)') |
613 | 617 | @(_XamarinFrameworkAssemblies -> 'FrameworkAssembly=%(Filename)') |
614 | 618 | Interpreter=$(MtouchInterpreter) |
| 619 | + InlineDlfcnMethods=$(InlineDlfcnMethods) |
615 | 620 | IntermediateLinkDir=$(IntermediateLinkDir) |
| 621 | + IntermediateOutputPath=$(DeviceSpecificIntermediateOutputPath) |
616 | 622 | InvariantGlobalization=$(InvariantGlobalization) |
617 | 623 | HybridGlobalization=$(HybridGlobalization) |
618 | 624 | ItemsDirectory=$(_LinkerItemsDirectory) |
|
750 | 756 | <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.CoreTypeMapStep" /> |
751 | 757 | <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.ProcessExportedFields" /> |
752 | 758 | <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="Xamarin.Linker.PreserveProtocolsStep" Condition="'$(_AreAnyAssembliesTrimmed)' == 'true' And '$(_UseDynamicDependenciesForProtocolPreservation)' == 'true'" /> |
| 759 | + <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Condition="'$(InlineDlfcnMethods)' != ''" Type="Xamarin.Linker.Steps.InlineDlfcnMethodsStep" /> |
753 | 760 | <!-- The final decision to remove/keep the dynamic registrar must be done before the linking step --> |
754 | 761 | <_TrimmerCustomSteps Include="$(_AdditionalTaskAssembly)" BeforeStep="MarkStep" Type="MonoTouch.Tuner.RegistrarRemovalTrackingStep" /> |
755 | 762 | <!-- TODO: these steps should probably run after mark. --> |
|
1608 | 1615 | </ItemGroup> |
1609 | 1616 | </Target> |
1610 | 1617 |
|
| 1618 | + <Target Name="_ComputeTrimmedAssemblies" |
| 1619 | + DependsOnTargets="_LoadLinkerOutput" |
| 1620 | + > |
| 1621 | + <ItemGroup> |
| 1622 | + <_TrimmedAssembly Include="$(IntermediateLinkDir)*.dll" /> |
| 1623 | + </ItemGroup> |
| 1624 | + </Target> |
| 1625 | + |
| 1626 | + <Target Name="_ComputePostTrimmingPaths"> |
| 1627 | + <PropertyGroup> |
| 1628 | + <_ILTrimSurvivingNativeSymbolsFile>$(DeviceSpecificIntermediateOutputPath)inlined-dlfcn\iltrim-surviving-native-symbols.txt</_ILTrimSurvivingNativeSymbolsFile> |
| 1629 | + <_NativeAOTUnresolvedSymbolsFile>$(DeviceSpecificIntermediateOutputPath)nativeaot-unresolved-symbols.txt</_NativeAOTUnresolvedSymbolsFile> |
| 1630 | + <_NativeAOTSurvivingNativeSymbolsFile>$(DeviceSpecificIntermediateOutputPath)nativeaot-surviving-native-symbols.txt</_NativeAOTSurvivingNativeSymbolsFile> |
| 1631 | + </PropertyGroup> |
| 1632 | + </Target> |
| 1633 | + |
| 1634 | + <!-- See docs/code/native-symbols.md for an overview of native symbol handling. --> |
| 1635 | + <Target Name="_CollectPostILTrimInformation" |
| 1636 | + Condition="'$(InlineDlfcnMethods)' != ''" |
| 1637 | + DependsOnTargets="_ComputeTrimmedAssemblies;_ComputePostTrimmingPaths" |
| 1638 | + Inputs="@(_TrimmedAssembly)" |
| 1639 | + Outputs="$(_ILTrimSurvivingNativeSymbolsFile)" |
| 1640 | + > |
| 1641 | + <CollectPostILTrimInformation |
| 1642 | + TrimmedAssemblies="@(_TrimmedAssembly)" |
| 1643 | + SurvivingNativeSymbolsFile="$(_ILTrimSurvivingNativeSymbolsFile)" |
| 1644 | + CacheDirectory="$(DeviceSpecificIntermediateOutputPath)posttrim-info\cache" |
| 1645 | + /> |
| 1646 | + <ReadLinesFromFile File="$(_ILTrimSurvivingNativeSymbolsFile)"> |
| 1647 | + <Output TaskParameter="Lines" ItemName="_AllExecutableSymbols" /> |
| 1648 | + </ReadLinesFromFile> |
| 1649 | + <ItemGroup> |
| 1650 | + <FileWrites Include="$(_ILTrimSurvivingNativeSymbolsFile)" /> |
| 1651 | + </ItemGroup> |
| 1652 | + </Target> |
| 1653 | + |
| 1654 | + <!-- See docs/code/native-symbols.md for an overview of native symbol handling. --> |
| 1655 | + <Target Name="_PostTrimmingProcessing" |
| 1656 | + DependsOnTargets="_CollectPostILTrimInformation;_CollectPostNativeAOTTrimInformation;_ComputeTargetArchitectures;_ComputePostTrimmingPaths" |
| 1657 | + > |
| 1658 | + <ItemGroup> |
| 1659 | + <_SurvivingNativeSymbolsFile Include="$(_ILTrimSurvivingNativeSymbolsFile)" Condition="Exists('$(_ILTrimSurvivingNativeSymbolsFile)')" /> |
| 1660 | + <_SurvivingNativeSymbolsFile Include="$(_NativeAOTSurvivingNativeSymbolsFile)" Condition="Exists('$(_NativeAOTSurvivingNativeSymbolsFile)')" /> |
| 1661 | + </ItemGroup> |
| 1662 | + <PostTrimmingProcessing |
| 1663 | + Architecture="$(TargetArchitectures)" |
| 1664 | + OutputDirectory="$(DeviceSpecificIntermediateOutputPath)inlined-dlfcn" |
| 1665 | + ReferenceNativeSymbol="@(ReferenceNativeSymbol)" |
| 1666 | + SurvivingNativeSymbolsFiles="@(_SurvivingNativeSymbolsFile)" |
| 1667 | + > |
| 1668 | + <Output TaskParameter="NativeSourceFiles" ItemName="_PostTrimmingSourceFiles" /> |
| 1669 | + </PostTrimmingProcessing> |
| 1670 | + |
| 1671 | + <ItemGroup> |
| 1672 | + <FileWrites Include="@(_PostTrimmingSourceFiles)" /> |
| 1673 | + <_PostTrimmingSourceFiles> |
| 1674 | + <OutputFile>$(DeviceSpecificIntermediateOutputPath)posttrim-info-compiled/%(Filename).o</OutputFile> |
| 1675 | + </_PostTrimmingSourceFiles> |
| 1676 | + </ItemGroup> |
| 1677 | + |
| 1678 | + <CompileNativeCode |
| 1679 | + SessionId="$(BuildSessionId)" |
| 1680 | + Condition="'$(IsMacEnabled)' == 'true'" |
| 1681 | + CompileInfo="@(_PostTrimmingSourceFiles)" |
| 1682 | + DotNetRoot="$(_DotNetRoot)" |
| 1683 | + MinimumOSVersion="$(_MinimumOSVersion)" |
| 1684 | + IncludeDirectories="@(_XamarinMainIncludeDirectory)" |
| 1685 | + SdkDevPath="$(_SdkDevPath)" |
| 1686 | + SdkIsSimulator="$(_SdkIsSimulator)" |
| 1687 | + SdkRoot="$(_SdkRoot)" |
| 1688 | + TargetFrameworkMoniker="$(_ComputedTargetFrameworkMoniker)" |
| 1689 | + > |
| 1690 | + </CompileNativeCode> |
| 1691 | + |
| 1692 | + <ItemGroup> |
| 1693 | + <_CompiledPostTrimmingFiles Include="@(_PostTrimmingSourceFiles -> '%(OutputFile)')" /> |
| 1694 | + <_NativeExecutableObjectFiles Include="@(_CompiledPostTrimmingFiles)" /> |
| 1695 | + <FileWrites Include="@(_CompiledPostTrimmingFiles)" /> |
| 1696 | + </ItemGroup> |
| 1697 | + </Target> |
| 1698 | + |
1611 | 1699 | <PropertyGroup> |
1612 | 1700 | <_CompileNativeExecutableDependsOn> |
1613 | 1701 | $(_CompileNativeExecutableDependsOn); |
|
1664 | 1752 | _ReadAppManifest; |
1665 | 1753 | _WriteAppManifest; |
1666 | 1754 | _CompileNativeExecutable; |
| 1755 | + _PostTrimmingProcessing; |
1667 | 1756 | _ReidentifyDynamicLibraries; |
1668 | 1757 | _AddSwiftLinkerFlags; |
1669 | 1758 | _ComputeLinkNativeExecutableInputs; |
1670 | 1759 | _ForceLinkNativeExecutable; |
1671 | 1760 | </_LinkNativeExecutableDependsOn> |
1672 | 1761 | </PropertyGroup> |
1673 | 1762 |
|
| 1763 | + <!-- See docs/code/native-symbols.md for an overview of native symbol handling. --> |
| 1764 | + <Target Name="_CollectPostNativeAOTTrimInformation" |
| 1765 | + Condition="'$(_UseNativeAot)' == 'true'" |
| 1766 | + DependsOnTargets="_ComputePostTrimmingPaths;_CompileNativeExecutable" |
| 1767 | + Inputs="$(NativeObject)" |
| 1768 | + Outputs="$(_NativeAOTSurvivingNativeSymbolsFile)" |
| 1769 | + > |
| 1770 | + <CollectUnresolvedNativeSymbols |
| 1771 | + SessionId="$(BuildSessionId)" |
| 1772 | + StaticLibrary="$(NativeObject)" |
| 1773 | + OutputFile="$(_NativeAOTUnresolvedSymbolsFile)" |
| 1774 | + /> |
| 1775 | + <ComputeNativeAOTSurvivingNativeSymbols |
| 1776 | + SessionId="$(BuildSessionId)" |
| 1777 | + UnresolvedSymbolsFile="$(_NativeAOTUnresolvedSymbolsFile)" |
| 1778 | + SurvivingNativeSymbolsFile="$(_NativeAOTSurvivingNativeSymbolsFile)" |
| 1779 | + /> |
| 1780 | + </Target> |
| 1781 | + |
1674 | 1782 | <Target Name="_AddSwiftLinkerFlags" DependsOnTargets="_DetectSdkLocations"> |
1675 | 1783 | <PropertyGroup> |
1676 | 1784 | <!-- Runtime now requires swift https://github.com/dotnet/runtime/commit/2c70e36356e8dfb50e6b32c8b7c9ce1a8e9f1331 --> |
|
0 commit comments