-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependencies on non-live illink (#91468)
Removes remaining dependencies on non-live ILLink. The live ILLink logic is consolidated into liveILLink.targets, which gets imported from source projects that depend on ILLink. This removes the dependency on UsingToolMicrosoftNetILLinkTasks, and turns off ILLink dependency flow. * Don't require illink analyzers for source generator projects Microsoft.Extensions.Options.SourceGeneration was enabling the single-file analyzer, but did not import illink.targets because it is not a source project. We could fix this by importing liveILLink.targets instead, but this introduces more problems with circular dependencies (generator projects depending on illink depending on generator projects). * Only enable single-file analyzer for source projects This more closely matches the condition on the import of illink.targets. When EnableSingleFileAnalyzer is true, we should also import liveILLink.targets so that we get the live analyzer bits. * Remove import from tests.mobile.targets Mobile trimmingtests should already use the live illink with the logic in project.csproj.template. The import of illink.targets shouldn't be required, unless tests.mobile.targets are required for other test scenarios. This import was resulting in a double-import, and wasn't working because liveILLink needs ToolsILLinkDir to be set, but it's not set during the trimming test build. --------- Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
- Loading branch information
1 parent
f555492
commit 1ef38a8
Showing
17 changed files
with
66 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<Project> | ||
|
||
<!-- NOTE: these targets should be a no-op, unless _RequiresLiveILLink, computed below, is true. --> | ||
|
||
<PropertyGroup> | ||
<!-- Keep these conditions in sync with _RequiresILLinkPack in | ||
https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets --> | ||
<_RequiresLiveILLink Condition="'$(_RequiresLiveILLink)' == '' And ( | ||
'$(PublishAot)' == 'true' Or | ||
'$(IsAotCompatible)' == 'true' Or '$(EnableAotAnalyzer)' == 'true' Or | ||
'$(PublishTrimmed)' == 'true' Or | ||
'$(IsTrimmable)' == 'true' Or '$(EnableTrimAnalyzer)' == 'true' Or | ||
'$(EnableSingleFileAnalyzer)' == 'true')">true</_RequiresLiveILLink> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(_RequiresLiveILLink)' == 'true'"> | ||
<_ILLinkTasksSourceDir>$(ToolsProjectRoot)illink\src\ILLink.Tasks\</_ILLinkTasksSourceDir> | ||
<ILLinkAnalyzersPropsPath>$(ToolsProjectRoot)illink\src\ILLink.RoslynAnalyzer\build\Microsoft.NET.ILLink.Analyzers.props</ILLinkAnalyzersPropsPath> | ||
</PropertyGroup> | ||
|
||
<Import Project="$(_ILLinkTasksSourceDir)build\Microsoft.NET.ILLink.Tasks.props" Condition="'$(_RequiresLiveILLink)' == 'true'" /> | ||
|
||
<PropertyGroup Condition="'$(_RequiresLiveILLink)' == 'true'"> | ||
<!-- Don't use SDK's trimming functionality. --> | ||
<_RequiresILLinkPack>false</_RequiresILLinkPack> | ||
<!-- Keep in sync with SetTargetFramework metadata on the ProjectReference below. --> | ||
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' == 'Core'">$(ToolsILLinkDir)$(NetCoreAppToolCurrent)\ILLink.Tasks.dll</ILLinkTasksAssembly> | ||
<ILLinkTasksAssembly Condition="'$(MSBuildRuntimeType)' != 'Core'">$(ToolsILLinkDir)$(NetFrameworkToolCurrent)\ILLink.Tasks.dll</ILLinkTasksAssembly> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(_RequiresLiveILLink)' == 'true'"> | ||
<!-- The assembly shouldn't be referenced, nor promoted to a package dependency, nor copied to the output directory. --> | ||
<ProjectReference Include="$(_ILLinkTasksSourceDir)ILLink.Tasks.csproj" | ||
ReferenceOutputAssembly="false" | ||
PrivateAssets="all" | ||
Private="false" | ||
SetConfiguration="Configuration=$(ToolsConfiguration)"> | ||
<!-- Keep TFMs in sync with ILLink.Tasks.csproj --> | ||
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">TargetFramework=$(NetCoreAppToolCurrent)</SetTargetFramework> | ||
<SetTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">TargetFramework=$(NetFrameworkToolCurrent)</SetTargetFramework> | ||
</ProjectReference> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters