Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build the "in build" crossgen2 into a pack that we can use within the VMR #110676

Merged
merged 25 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
25efc51
Add a new crossgen2 build variant for a published crossgen2 targettin…
jkoritzinsky Dec 10, 2024
4571db6
Remove the .NET-hosted in-build crossgen2 and just use the published …
jkoritzinsky Dec 10, 2024
59407a2
Extract crossgen2 sfxproj changes from #109710
jkoritzinsky Dec 12, 2024
c888d16
Extract the properties and targets that will be shared into a separat…
jkoritzinsky Dec 12, 2024
f79e23c
Add a "host crossgen2" project
jkoritzinsky Dec 12, 2024
6d7961d
Add the crossgen2 host package to Subsets.props for the correct scena…
jkoritzinsky Dec 12, 2024
080336c
Fix crossgen-corelib to work with the new in-build crossgen2
jkoritzinsky Dec 13, 2024
b1b74f7
Publish the in-build crossgen2 as single file to avoid having to adju…
jkoritzinsky Dec 13, 2024
dd2461f
AOT on Windows only
jkoritzinsky Dec 13, 2024
290eb44
Don't set Platform for the shared framework projects. It's not necess…
jkoritzinsky Dec 16, 2024
7f5205f
Forward ShortStack down so we don't build the host crossgen2 when run…
jkoritzinsky Dec 17, 2024
a219e17
Add os-only RID to portable RID graph in source-build to enable cross…
jkoritzinsky Dec 17, 2024
9970c27
Publish the host crossgen2 as a "Vertical" visibility asset.
jkoritzinsky Dec 18, 2024
120bfff
Cleanup crossgen2 infra, add comment about workaround, and adjust pub…
jkoritzinsky Dec 19, 2024
3c5cd33
Deduplicate artifacts
jkoritzinsky Dec 19, 2024
2c5f0a3
Merge commit '040cbe276907174316e2cc07b35814b3069874a6' into host-cro…
jkoritzinsky Dec 20, 2024
158fd05
Add back the Update, somehow this got lost.
jkoritzinsky Dec 20, 2024
226cd3c
Merge branch 'main' of https://github.com/dotnet/runtime into host-cr…
jkoritzinsky Dec 21, 2024
e8914da
Merge branch 'main' of https://github.com/dotnet/runtime into host-cr…
jkoritzinsky Jan 3, 2025
44264ef
Don't forward down ShortStack
jkoritzinsky Jan 3, 2025
8b0b2b1
Use new "update" functionality to specify which artifacts are vertica…
jkoritzinsky Jan 7, 2025
df4b0f9
Merge branch 'main' of https://github.com/dotnet/runtime into host-cr…
jkoritzinsky Jan 9, 2025
0af2874
Revert changes to Signing.props
jkoritzinsky Jan 9, 2025
1380fb1
Remove workaround now that the VMR has a bootstrap SDK with a new eno…
jkoritzinsky Jan 9, 2025
5380e29
Merge branch 'main' into host-crossgen2
ViktorHofer Jan 10, 2025
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
3 changes: 3 additions & 0 deletions eng/DotNetBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@

<!-- Needed until https://github.com/dotnet/runtime/issues/109329 is fixed. -->
<InnerBuildArgs Condition="'$(NetCoreAppToolCurrentVersion)' != ''">$(InnerBuildArgs) /p:NetCoreAppToolCurrentVersion=$(NetCoreAppToolCurrentVersion)</InnerBuildArgs>

<!-- Pass ShortStack to the inner build so we can skip building host-machine components for downstream repos when we're the last repo. -->
<InnerBuildArgs Condition="'$(ShortStack)' == 'true'">$(InnerBuildArgs) /p:ShortStack=true</InnerBuildArgs>
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
</Target>

Expand Down
47 changes: 31 additions & 16 deletions eng/Signing.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<EnableDefaultArtifacts Condition="'$(DotNetBuild)' != 'true'">false</EnableDefaultArtifacts>
<EnableDefaultArtifacts>false</EnableDefaultArtifacts>
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<ItemGroup>
Expand All @@ -27,10 +27,10 @@

<FileExtensionSignInfo Include=".msi" CertificateName="MicrosoftDotNet500" />

<!--
<!--
Removal is temporarily needed as we integrate support for these extensions into SignTool.
Should be cleaned up after https://github.com/dotnet/arcade/issues/14432,
https://github.com/dotnet/arcade/issues/14433, and
https://github.com/dotnet/arcade/issues/14433, and
https://github.com/dotnet/arcade/issues/14435 are completed.
-->
<FileExtensionSignInfo Remove=".deb;.rpm;.pkg" />
Expand All @@ -45,20 +45,35 @@
<FileSignInfo Update="@(FileSignInfo->WithMetadataValue('CertificateName','Microsoft400'))" CertificateName="MicrosoftDotNet500" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildOrchestrator)' == 'true'">
<VerticalVisibilityNuGetPackages Condition="'$(RuntimeFlavor)' != 'Mono' and '$(ShortStack)' != 'true' and '$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'"
Include="$(ArtifactsPackagesDir)**\Microsoft.NETCore.App.Crossgen2.$(NETCoreSdkRuntimeIdentifier).*.nupkg"
Visibility="Vertical" />
</ItemGroup>

<!-- In build signing and publishing without a join point -->
<ItemGroup Condition="'$(DotNetBuild)' == 'true'">
<Artifact Include="$(ArtifactsPackagesDir)**\*.tar.gz;
$(ArtifactsPackagesDir)**\*.zip;
$(ArtifactsPackagesDir)**\*.deb;
$(ArtifactsPackagesDir)**\*.rpm;
$(ArtifactsPackagesDir)**\*.pkg;
$(ArtifactsPackagesDir)**\*.exe;
$(ArtifactsPackagesDir)**\*.msi"
Exclude="$(ArtifactsPackagesDir)**\Symbols.runtime.tar.gz"
IsShipping="$([System.String]::Copy('%(RecursiveDir)').StartsWith('Shipping'))">
<!-- Exclude wixpack.zip files from checksum generation -->
<ChecksumPath Condition="$([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.wixpack.zip')) != 'true'">%(FullPath).sha512</ChecksumPath>
</Artifact>
<NuGetPackages Include="$(ArtifactsPackagesDir)**\*.nupkg" Exclude="@(VerticalVisibilityNuGetPackages)" />

<Archives Include="$(ArtifactsPackagesDir)**\*.tar.gz;
$(ArtifactsPackagesDir)**\*.zip"
Exclude="$(ArtifactsPackagesDir)**\Symbols.runtime.tar.gz;
$(ArtifactsPackagesDir)**\*.wixpack.zip">
<ChecksumPath>%(FullPath).sha512</ChecksumPath>
</Archives>

<WixPacks Include="$(ArtifactsPackagesDir)**\*.wixpack.zip" />

<Installers Include="$(ArtifactsPackagesDir)**\*.deb;
$(ArtifactsPackagesDir)**\*.rpm;
$(ArtifactsPackagesDir)**\*.pkg;
$(ArtifactsPackagesDir)**\*.exe;
$(ArtifactsPackagesDir)**\*.msi">
<ChecksumPath>%(FullPath).sha512</ChecksumPath>
</Installers>

<Artifact Include="@(VerticalVisibilityNuGetPackages);@(NuGetPackages);@(Archives);@(WixPacks);@(Installers)"
IsShipping="$([System.String]::Copy('%(RecursiveDir)').StartsWith('Shipping'))" />
</ItemGroup>

<!-- Only the following artifacts should be signed.
Expand All @@ -71,4 +86,4 @@
SkipPublish="true" />
</ItemGroup>

</Project>
</Project>
7 changes: 7 additions & 0 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@
<ItemGroup>
<ProjectToBuild Condition="'$(NativeAotSupported)' == 'true' and '$(RuntimeFlavor)' != 'Mono' and '$(BuildOnlyPgoInstrumentedAssets)' != 'true'" Include="$(InstallerProjectRoot)\pkg\projects\nativeaot-packages.proj" Category="packs" />
</ItemGroup>
<ItemGroup>
<!--
When we're building in the VMR, we need to provide a crossgen2 that runs on the host machine for downstream repos to use to R2R their code.
In non-VMR builds, downstream repos can use the crossgen2 built for the target host SDK from another build leg, but in the VMR we need to provide one to use.
-->
<ProjectToBuild Condition="'$(RuntimeFlavor)' != 'Mono' and '$(DotNetBuildOrchestrator)' == 'true' and '$(ShortStack)' != 'true' and '$(OutputRID)' != '$(NETCoreSdkRuntimeIdentifier)'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Crossgen2.Host.sfxproj" Category="packs" />
</ItemGroup>
<ItemGroup>
<SharedFrameworkProjectToBuild Condition="'$(BuildMonoAOTCrossCompilerOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\Microsoft.NETCore.App\Microsoft.NETCore.App.Runtime.sfxproj" />
<SharedFrameworkProjectToBuild Condition="'$(BuildNativeAOTRuntimePack)' != 'true' and '$(RuntimeFlavor)' == '$(PrimaryRuntimeFlavor)' and '$(TargetsMobile)' != 'true' and '$(DotNetBuildSourceOnly)' != 'true'" Include="$(InstallerProjectRoot)pkg\sfx\bundle\Microsoft.NETCore.App.Bundle.bundleproj" />
Expand Down
16 changes: 4 additions & 12 deletions src/coreclr/crossgen-corelib.proj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.Build.NoTargets">

<ItemGroup>
<ProjectReference Include="$(CoreClrProjectRoot)/tools/aot/crossgen2/crossgen2_inbuild.csproj" OutputItemType="Crossgen2" />
<ProjectReference Include="$(CoreClrProjectRoot)/tools/aot/crossgen2/crossgen2_inbuild.csproj" OutputItemType="Crossgen2Files" />
<ProjectReference Include="$(CoreClrProjectRoot)/tools/dotnet-pgo/dotnet-pgo.csproj" OutputItemType="DotNetPgo" Condition="'$(DotNetBuildSourceOnly)' != 'true'" />
<ProjectReference Include="$([MSBuild]::NormalizePath('$(CoreClrProjectRoot)', 'System.Private.CoreLib', 'System.Private.CoreLib.csproj'))" OutputItemType="CoreLib" />
</ItemGroup>
Expand Down Expand Up @@ -92,21 +92,13 @@
<ItemGroup>
<Crossgen2Inputs Include="@(CoreLib)" />
<Crossgen2Inputs Include="$(MergedMibcPath)" />
</ItemGroup>

<PropertyGroup>
<Crossgen2OutputPath>%(Crossgen2.RootDir)/%(Crossgen2.Directory)</Crossgen2OutputPath>
</PropertyGroup>
<ItemGroup>
<Crossgen2Files Include="$(Crossgen2OutputPath)/*.dll" />
<Crossgen2Files Include="$(Crossgen2OutputPath)/*.so" />
<Crossgen2Files Include="$(Crossgen2OutputPath)/*.dylib" />
<Crossgen2Inputs Include="@(Crossgen2Files->Metadata('OutputPath'))" />
</ItemGroup>
</Target>

<Target Name="InvokeCrossgen"
DependsOnTargets="PrepareInvokeCrossgen;CreateMergedMibcFile"
Inputs="@(Crossgen2Inputs);@(Crossgen2Files)"
Inputs="@(Crossgen2Inputs)"
Outputs="$(CoreLibOutputPath);$(CoreLibNiPdbPath);$(CoreLibPerfMapPath)"
AfterTargets="Build">

Expand All @@ -117,7 +109,7 @@
Text="Generating native image of System.Private.CoreLib for $(OSPlatformConfig). Logging to $(CrossGenCoreLibLog)" />

<PropertyGroup>
<CrossGenDllCmd>$(DotNetCli) @(Crossgen2)</CrossGenDllCmd>
<CrossGenDllCmd>@(Crossgen2Files->Metadata('OutputPath')->WithMetadataValue('Filename','crossgen2')->WithMetadataValue('Extension','$(ExeSuffix)'))</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) -o:$(CoreLibOutputPath)</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) -r:$([MSBuild]::NormalizePath('$(BinDir)', 'IL', '*.dll'))</CrossGenDllCmd>
<CrossGenDllCmd>$(CrossGenDllCmd) --targetarch:$(TargetArchitecture)</CrossGenDllCmd>
Expand Down
19 changes: 15 additions & 4 deletions src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Publish;PublishItemsOutputGroup">
<PropertyGroup>
<CrossHostArch Condition="'$(CrossBuild)' == 'true' or '$(TargetArchitecture)' != '$(BuildArchitecture)' or '$(HostOS)' != '$(TargetOS)' or '$(EnableNativeSanitizers)' != ''">$(BuildArchitecture)</CrossHostArch>
<OutputPath>$(RuntimeBinDir)/$(BuildArchitecture)/crossgen2/</OutputPath>
<TargetFramework>$(NetCoreAppToolCurrent)</TargetFramework>
<UseAppHost>false</UseAppHost>
<_IsPublishing>true</_IsPublishing>
<RuntimeIdentifier>$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>
<PublishDir>$(RuntimeBinDir)$(BuildArchitecture)/crossgen2/</PublishDir>
<SelfContained>true</SelfContained>
<PublishTrimmed>true</PublishTrimmed>
<!--
Publish with AOT on Windows as Single file doesn't work well when an app has to include DiaSymReader.Native.
Publish single-file elsewhere so we don't need to adjust our "AOT in build" logic to handle targeting the SDK RID.
-->
<PublishAot Condition="$(NETCoreSdkPortableRuntimeIdentifier.StartsWith('win-'))">true</PublishAot>
<PublishSingleFile Condition="'$(PublishAot)' != 'true'">true</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
<TrimmerSingleWarn>false</TrimmerSingleWarn>
</PropertyGroup>
<Import Project="crossgen2.props" />
</Project>
21 changes: 0 additions & 21 deletions src/installer/pkg/Directory.Build.props

This file was deleted.

19 changes: 0 additions & 19 deletions src/installer/pkg/Directory.Build.targets

This file was deleted.

13 changes: 13 additions & 0 deletions src/installer/pkg/projects/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))" />

<PropertyGroup>

<PackageIndexFile>$(MSBuildThisFileDirectory)packageIndex.json</PackageIndexFile>

<!-- this repo doesn't currently use the index so don't force it to be in sync -->
<SkipIndexCheck>true</SkipIndexCheck>
</PropertyGroup>

<ItemGroup>
<PackageIndex Include="$(PackageIndexFile)" />
</ItemGroup>

<PropertyGroup>
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
<Platform>$(TargetArchitecture)</Platform>
<PackagePlatform>AnyCPU</PackagePlatform>

<SkipPackageFileCheck>true</SkipPackageFileCheck>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Microsoft.DotNet.SharedFramework.Sdk" />

<PropertyGroup>
<CrossgenPublishProject>$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2_inbuild.csproj</CrossgenPublishProject>
<RuntimeIdentifier>$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>
<IsShipping>false</IsShipping>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)Microsoft.NETCore.App.Crossgen2.props" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<Project>
<PropertyGroup>
<!-- Crossgen is not used for Mono -->
<SkipBuild Condition="'$(RuntimeFlavor)' == 'Mono'">true</SkipBuild>
<PlatformPackageType>ToolPack</PlatformPackageType>
<SharedFrameworkName>$(SharedFrameworkName).Crossgen2</SharedFrameworkName>
<OverridePackageId>$(SharedFrameworkName).$(RuntimeIdentifier)</OverridePackageId>
<ArchiveName>dotnet-crossgen2</ArchiveName>
<SharedFrameworkHostFileNameOverride>crossgen2</SharedFrameworkHostFileNameOverride>
<GenerateInstallers>false</GenerateInstallers>
<PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion>
<!-- Publishing as single-file or NativeAOT means we can't examine the interior DLLs -->
<ShouldVerifyClosure>false</ShouldVerifyClosure>
</PropertyGroup>

<ItemGroup>
<ProjectReference
Include="$(CrossgenPublishProject)"
OutputItemType="_RawCrossgenPublishFiles"
ReferenceOutputAssembly="false" />
</ItemGroup>

<Target Name="PublishCrossgen"
BeforeTargets="GetFilesToPackage">
<ItemGroup>
<_CrossgenPublishFiles Include="@(_RawCrossgenPublishFiles->'%(OutputPath)')"
KeepMetadata="REMOVE_ALL" />
</ItemGroup>
<ItemGroup Condition="'$(NativeAotSupported)' != 'true'">
<FilesToPackage Include="@(_CrossgenPublishFiles)"
Exclude="*.pdb;*.h;*.lib"
TargetPath="tools/" />
</ItemGroup>
<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
<!-- Treat all native aot assets as native runtime assets -->
<FilesToPackage Include="@(_CrossgenPublishFiles->Distinct())"
Condition="'%(Extension)' != '.pdb'"
TargetPath="tools/" />
</ItemGroup>
</Target>

<PropertyGroup>
<TargetOSComponent>unix</TargetOSComponent>
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
<TargetOSComponent Condition="'$(TargetOS)' == 'windows'">win</TargetOSComponent>
<TargetSpec>$(TargetOSComponent)-$(TargetArchitecture)</TargetSpec>
</PropertyGroup>

<Target Name="AddCrossgen2SymbolFilesToPackage" BeforeTargets="GetFilesToPackage" DependsOnTargets="PublishCrossgen">
<ItemGroup>
<_Crossgen2SymbolFilesToPackage Include="@(_CrossgenPublishFiles)" Condition="'%(Extension)' == '.pdb'" />
<!-- Symbol files for JIT libraries are placed in a different location for Windows builds -->
<_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPdbDir)%(FileName).pdb')" Condition="'$(TargetOS)' == 'windows' and '%(FileName)' != 'crossgen2'" />
<_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPath)%(FileName)%(Extension)$(SymbolsSuffix)')" Condition="'$(TargetOS)' != 'windows' and '%(FileName)' != 'crossgen2'" />
<_Crossgen2SymbolFilesToPackage Remove="@(_Crossgen2SymbolFilesToPackage)" Condition="!Exists('%(Identity)')" />

<_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" />
</ItemGroup>
</Target>
</Project>
Original file line number Diff line number Diff line change
@@ -1,51 +1,15 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />
<Project Sdk="Microsoft.NET.Sdk">
<Sdk Name="Microsoft.DotNet.SharedFramework.Sdk" />

<PropertyGroup>
<!-- Crossgen is not used for Mono -->
<SkipBuild Condition="'$(RuntimeFlavor)' == 'Mono'">true</SkipBuild>
<PlatformPackageType>ToolPack</PlatformPackageType>
<SharedFrameworkName>$(SharedFrameworkName).Crossgen2</SharedFrameworkName>
<OverridePackageId>$(SharedFrameworkName).$(RuntimeIdentifier)</OverridePackageId>
<ArchiveName>dotnet-crossgen2</ArchiveName>
<SharedFrameworkHostFileNameOverride>crossgen2</SharedFrameworkHostFileNameOverride>
<GenerateInstallers>false</GenerateInstallers>
<HostJsonTargetPath>tools/</HostJsonTargetPath>
<PermitDllAndExeFilesLackingFileVersion>true</PermitDllAndExeFilesLackingFileVersion>
<!-- Publishing as single-file or NativeAOT means we can't examine the interior DLLs -->
<ShouldVerifyClosure>false</ShouldVerifyClosure>
<CrossgenPublishProject>$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj</CrossgenPublishProject>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Archives" Version="$(MicrosoftDotNetBuildTasksArchivesVersion)" />
</ItemGroup>

<ItemGroup>
<ProjectReference
Include="$(RepoRoot)src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj"
OutputItemType="_RawCrossgenPublishFiles"
ReferenceOutputAssembly="false" />
</ItemGroup>

<Target Name="PublishCrossgen"
BeforeTargets="GetFilesToPackage">
<ItemGroup>
<_CrossgenPublishFiles Include="@(_RawCrossgenPublishFiles->'%(OutputPath)')"
KeepMetadata="REMOVE_ALL" />
</ItemGroup>
<ItemGroup Condition="'$(NativeAotSupported)' != 'true'">
<FilesToPackage Include="@(_CrossgenPublishFiles)"
Exclude="*.pdb;*.h;*.lib"
TargetPath="tools/" />
</ItemGroup>
<ItemGroup Condition="'$(NativeAotSupported)' == 'true'">
<!-- Treat all native aot assets as native runtime assets -->
<FilesToPackage Include="@(_CrossgenPublishFiles->Distinct())"
Condition="'%(Extension)' != '.pdb'"
TargetPath="tools/" />
</ItemGroup>
</Target>
<Import Project="$(MSBuildThisFileDirectory)Microsoft.NETCore.App.Crossgen2.props" />

<Target Name="RunPublishedCrossgen" AfterTargets="PublishCrossgen"
Condition="'$(TargetOS)' == '$(HostOS)' and '$(TargetArchitecture)' == '$(BuildArchitecture)' and '$(CrossBuild)' != 'true'">
Expand All @@ -54,41 +18,4 @@
<Output TaskParameter="ExitCode" PropertyName="CrossgenExitCode" />
</Exec>
</Target>

<PropertyGroup>
<TargetOSComponent>unix</TargetOSComponent>
<TargetOSComponent Condition="'$(TargetOS)' == 'windows'">win</TargetOSComponent>
<TargetSpec>$(TargetOSComponent)-$(TargetArchitecture)</TargetSpec>
</PropertyGroup>

<Target Name="AddCrossgen2SymbolFilesToPackage" BeforeTargets="GetFilesToPackage" DependsOnTargets="PublishCrossgen">
<ItemGroup>
<_Crossgen2SymbolFilesToPackage Include="@(_CrossgenPublishFiles)" Condition="'%(Extension)' == '.pdb'" />
<!-- Symbol files for JIT libraries are placed in a different location for Windows builds -->
<_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPdbDir)%(FileName).pdb')" Condition="'$(TargetOS)' == 'windows' and '%(FileName)' != 'crossgen2'" />
<_Crossgen2SymbolFilesToPackage Include="@(NativeRuntimeAsset->'$(CoreCLRArtifactsPath)%(FileName)%(Extension)$(SymbolsSuffix)')" Condition="'$(TargetOS)' != 'windows' and '%(FileName)' != 'crossgen2'" />
<_Crossgen2SymbolFilesToPackage Remove="@(_Crossgen2SymbolFilesToPackage)" Condition="!Exists('%(Identity)')" />

<_SymbolFilesToPackage Include="@(_Crossgen2SymbolFilesToPackage)" TargetPath="tools/" />
</ItemGroup>
</Target>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.SharedFramework.Sdk" />

<Target Name="GetFilesToPublish">
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="_GetAllSharedFrameworkFiles"
RemoveProperties="OutputPath;SymbolsOutputPath">
<Output TaskParameter="TargetOutputs" ItemName="_FilesToPackage" />
</MSBuild>
<ItemGroup>
<_PackagedFilesToPublish Include="@(_FilesToPackage)" Condition="'%(_FilesToPackage.PackOnly)' != 'true'" />
</ItemGroup>
<ItemGroup>
<FilesToPublish Include="@(_PackagedFilesToPublish)"
TargetPath="" />
</ItemGroup>
</Target>

</Project>
Loading