Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@
'$(IsTestSupportProject)' != 'true' and
'$(UsingMicrosoftDotNetSharedFrameworkSdk)' != 'true' and
'$(MSBuildProjectExtension)' != '.pkgproj' and
'$(MSBuildProjectExtension)' != '.proj' and
'$(UsingMicrosoftNoTargetsSdk)' != 'true' and
'$(UsingMicrosoftTraversalSdk)' != 'true'">true</IsSourceProject>
</PropertyGroup>
Expand Down
21 changes: 13 additions & 8 deletions eng/illink.targets
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<Project>

<PropertyGroup>
<_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink/src/ILLink.Tasks/</_ILLinkTasksSourceDir>
<ILLinkAnalyzersPropsPath>$(ToolsProjectRoot)illink/src/ILLink.RoslynAnalyzer/build/Microsoft.NET.ILLink.Analyzers.props</ILLinkAnalyzersPropsPath>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(_ILLinkTasksSourceDir)ILLink.Tasks.csproj"
ReferenceOutputAssembly="false" />
</ItemGroup>

<Import Project="$(_ILLinkTasksSourceDir)build/Microsoft.NET.ILLink.Tasks.props" />

<PropertyGroup>
<IsTrimmable Condition="'$(IsTrimmable)' == ''">true</IsTrimmable>
<!-- Don't use SDK's trimming functionality.
Expand All @@ -10,6 +22,7 @@
we might be able to use built-in functionality instead of a packagereference.
-->
<_RequiresILLinkPack>false</_RequiresILLinkPack>
<ILLinkTasksAssembly>$(ToolsILLinkDir)$(NetCoreAppToolCurrent)/ILLink.Tasks.dll</ILLinkTasksAssembly>
<PrepareResourcesDependsOn>_EmbedILLinkXmls;$(PrepareResourcesDependsOn)</PrepareResourcesDependsOn>
<TargetsTriggeredByCompilation Condition="'$(DesignTimeBuild)' != 'true'">$(TargetsTriggeredByCompilation);ILLinkTrimAssembly</TargetsTriggeredByCompilation>

Expand Down Expand Up @@ -43,14 +56,6 @@
<GenerateResourcesSubstitutions Condition="'$(GenerateResourcesSubstitutions)' == '' and '$(StringResourcesPath)' != ''">true</GenerateResourcesSubstitutions>
</PropertyGroup>

<!-- Use ILLink.Tasks version matching the SDK used to build. See comment about _RequiresILLinkPack. -->
<PropertyGroup>
<SuppressILLinkExplicitPackageReferenceWarning>true</SuppressILLinkExplicitPackageReferenceWarning>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.ILLink.Tasks" Version="$(BundledNETCoreAppPackageVersion)" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ILLinkSuppressionsXmls Include="$(ILLinkSuppressionsXmlFile)"
Condition="Exists('$(ILLinkSuppressionsXmlFile)')" />
Expand Down
17 changes: 11 additions & 6 deletions src/libraries/oob.proj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="Microsoft.Build.NoTargets">
<Project>

<Import Project="Sdk.props" Sdk="Microsoft.Build.NoTargets" />

<PropertyGroup>
<TargetFramework>$(NetCoreAppCurrent)-$(TargetOS)</TargetFramework>
Expand All @@ -25,11 +27,6 @@
<ProjectReference Include="oob-ref.proj" />
</ItemGroup>

<ImportGroup Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<!-- Import the illink file which contains some of the logic required to illink the out-of-band assemblies. -->
<Import Project="$(RepositoryEngineeringDir)illink.targets" />
</ImportGroup>

<Target Name="GetTrimOOBAssembliesInputs"
DependsOnTargets="ResolveProjectReferences">
<PropertyGroup>
Expand Down Expand Up @@ -81,4 +78,12 @@
<Message Condition="Exists('$(ArtifactsDir)packages')" Importance="High" Text="##vso[task.setvariable variable=_librariesBuildProducedPackages]true" />
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.Build.NoTargets" />

<!-- Must be imported AFTER liveBuilds.targets (imported by Directory.Build.targets) which defines the ToolsILLinkDir. -->
<ImportGroup Condition="'$(BuildTargetFramework)' == '$(NetCoreAppCurrent)' or '$(BuildTargetFramework)' == ''">
<!-- Import the illink file which contains some of the logic required to illink the out-of-band assemblies. -->
<Import Project="$(RepositoryEngineeringDir)illink.targets" />
</ImportGroup>

</Project>
13 changes: 9 additions & 4 deletions src/libraries/sfx.proj
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project Sdk="Microsoft.Build.NoTargets">
<Project>

<Import Project="Sdk.props" Sdk="Microsoft.Build.NoTargets" />

<Sdk Name="Microsoft.DotNet.SharedFramework.Sdk" />

Expand Down Expand Up @@ -71,9 +73,6 @@
UseHardlinksIfPossible="true" />
</Target>

<!-- Import the illink file which contains some of the logic required to illink the shared framework assemblies. -->
<Import Project="$(RepositoryEngineeringDir)illink.targets" />

<Target Name="GetTrimSharedFrameworkAssembliesInputs"
DependsOnTargets="ResolveProjectReferences">
<PropertyGroup>
Expand Down Expand Up @@ -119,4 +118,10 @@
AlwaysCreate="true" />
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.Build.NoTargets" />

<!-- Import the illink file which contains some of the logic required to illink the shared framework assemblies. -->
<!-- Must be imported AFTER liveBuilds.targets (imported by Directory.Build.targets) which defines the ToolsILLinkDir. -->
<Import Project="$(RepositoryEngineeringDir)illink.targets" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ Copyright (c) .NET Foundation. All rights reserved.
<PropertyGroup>
<!-- N.B. The ILLinkTargetsPath is used as a sentinel to indicate a version of this file has already been imported. It will also be the path
used to import the targets later in the SDK. -->
<ILLinkTargetsPath>$(MSBuildThisFileDirectory)Microsoft.NET.ILLink.targets</ILLinkTargetsPath>
<ILLinkTargetsPath Condition="'$(ILLinkTargetsPath)' == ''">$(MSBuildThisFileDirectory)Microsoft.NET.ILLink.targets</ILLinkTargetsPath>
<!-- Older SDKs used this property as a sentinel instead, to control the import of this file
(but not the targets, which were included with the SDK). -->
<UsingILLinkTasksSdk>true</UsingILLinkTasksSdk>
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(MSBuildThisFileDirectory)..\tools\net8.0\ILLink.Tasks.dll</ILLinkTasksAssembly>
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(MSBuildThisFileDirectory)..\tools\net472\ILLink.Tasks.dll</ILLinkTasksAssembly>

<ILLinkAnalyzersPropsPath Condition="'$(ILLinkAnalyzersPropsPath)' == ''">$(MSBuildThisFileDirectory)Microsoft.NET.ILLink.Analyzers.props</ILLinkAnalyzersPropsPath>
</PropertyGroup>

<Import Project="Microsoft.NET.ILLink.Analyzers.props" />
<Import Project="$(ILLinkAnalyzersPropsPath)" />

</Project>