зеркало из https://github.com/dotnet/aspnetcore.git
Ensure build output is still present when crossgen is disabled
* Split targets for copying outputs and preparing the crossgen tool * Fix version override check by only looking at the 'pinned' section
This commit is contained in:
Родитель
a5d88b0ca2
Коммит
0ba800841b
|
@ -22,6 +22,7 @@
|
||||||
<_RestoreGraphProjectInput>@(ProjectToBuild)</_RestoreGraphProjectInput>
|
<_RestoreGraphProjectInput>@(ProjectToBuild)</_RestoreGraphProjectInput>
|
||||||
<SharedFxBuildProperties>
|
<SharedFxBuildProperties>
|
||||||
$(SolutionProperties);
|
$(SolutionProperties);
|
||||||
|
SharedFxRid=$(SharedFxRid);
|
||||||
DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath);
|
DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath);
|
||||||
DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath)
|
DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath)
|
||||||
</SharedFxBuildProperties>
|
</SharedFxBuildProperties>
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace RepoTasks
|
||||||
var versionOverrides = ProjectRootElement.Open(DotNetPackageVersionPropsPath);
|
var versionOverrides = ProjectRootElement.Open(DotNetPackageVersionPropsPath);
|
||||||
var dependencies = ProjectRootElement.Open(DependenciesFile);
|
var dependencies = ProjectRootElement.Open(DependenciesFile);
|
||||||
var pinnedVersions = dependencies.PropertyGroups
|
var pinnedVersions = dependencies.PropertyGroups
|
||||||
.Where(p => !string.Equals("Package Versions: Auto", p.Label))
|
.Where(p => string.Equals("Package Versions: Pinned", p.Label))
|
||||||
.SelectMany(p => p.Properties)
|
.SelectMany(p => p.Properties)
|
||||||
.ToDictionary(p => p.Name, p => p.Value, StringComparer.OrdinalIgnoreCase);
|
.ToDictionary(p => p.Name, p => p.Value, StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
|
|
@ -20,20 +20,21 @@ This targets file should only be imported by .shfxproj files.
|
||||||
GeneratePublishDependencyFile;
|
GeneratePublishDependencyFile;
|
||||||
GenerateSharedFxDependencyFile;
|
GenerateSharedFxDependencyFile;
|
||||||
GeneratePublishRuntimeConfigurationFile;
|
GeneratePublishRuntimeConfigurationFile;
|
||||||
OptimizeOutput;
|
CopySharedFxToOutput;
|
||||||
|
CollectSharedFxOutput;
|
||||||
PostBuildEvent;
|
PostBuildEvent;
|
||||||
GetTargetPath;
|
GetTargetPath;
|
||||||
</CoreBuildDependsOn>
|
</CoreBuildDependsOn>
|
||||||
|
|
||||||
<OptimizeOutputDependsOn Condition=" '$(CrossGenOutput)' != 'false' ">
|
<CollectOutputSharedFxDependsOn Condition=" '$(CrossGenOutput)' != 'false' ">
|
||||||
PrepareForCrossGen;
|
PrepareForCrossGen;
|
||||||
CrossGenAssemblies;
|
CrossGenAssemblies;
|
||||||
</OptimizeOutputDependsOn>
|
</CollectOutputSharedFxDependsOn>
|
||||||
|
|
||||||
<OptimizeOutputDependsOn Condition=" '$(CrossgenSymbolsOutput)' != 'false' ">
|
<CollectOutputSharedFxDependsOn Condition=" '$(CrossgenSymbolsOutput)' != 'false' ">
|
||||||
$(OptimizeOutputDependsOn);
|
$(CollectOutputSharedFxDependsOn);
|
||||||
CrossGenSymbols;
|
CrossGenSymbols;
|
||||||
</OptimizeOutputDependsOn>
|
</CollectOutputSharedFxDependsOn>
|
||||||
|
|
||||||
<PrepareForBuildDependsOn>
|
<PrepareForBuildDependsOn>
|
||||||
PrepareOutputPaths;
|
PrepareOutputPaths;
|
||||||
|
@ -71,9 +72,8 @@ This targets file should only be imported by .shfxproj files.
|
||||||
|
|
||||||
<IntermediateOutputPath>$(IntermediateOutputPath)$(SharedFxRid)\</IntermediateOutputPath>
|
<IntermediateOutputPath>$(IntermediateOutputPath)$(SharedFxRid)\</IntermediateOutputPath>
|
||||||
|
|
||||||
<!-- Override the SDK Default for this location based on whether crossgen happens or not. -->
|
<!-- Override the SDK Default for this location for copying published output. -->
|
||||||
<PublishDir Condition=" '$(CrossGenOutput)' != 'true' ">$(OutputPath)</PublishDir>
|
<PublishDir>$(IntermediateOutputPath)u\</PublishDir>
|
||||||
<PublishDir Condition=" '$(CrossGenOutput)' == 'true' ">$(IntermediateOutputPath)u\</PublishDir>
|
|
||||||
|
|
||||||
<!-- If symbols generation is disabled, there is no use in producing a symbols.nupkg files. -->
|
<!-- If symbols generation is disabled, there is no use in producing a symbols.nupkg files. -->
|
||||||
<IncludeSymbols Condition="'$(CrossgenSymbolsOutput)' == 'false'">false</IncludeSymbols>
|
<IncludeSymbols Condition="'$(CrossgenSymbolsOutput)' == 'false'">false</IncludeSymbols>
|
||||||
|
@ -195,14 +195,30 @@ This targets file should only be imported by .shfxproj files.
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- Optimizes shared framework output -->
|
<!-- Optimizes shared framework output -->
|
||||||
<Target Name="OptimizeOutput" DependsOnTargets="$(OptimizeOutputDependsOn)">
|
<Target Name="CollectSharedFxOutput" DependsOnTargets="$(CollectOutputSharedFxDependsOn)">
|
||||||
<Message Importance="High" Text="$(SharedFxName) (fx: $(SharedFxRid)) -> $(OutputPath)" />
|
<Message Importance="High" Text="$(SharedFxName) (fx: $(SharedFxRid)) -> $(OutputPath)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- Prepare the project to run crossgen. -->
|
<!-- Prepare the project to run crossgen. -->
|
||||||
<Target Name="PrepareForCrossGen" DependsOnTargets="RunResolvePackageDependencies;RunResolvePublishAssemblies">
|
<Target Name="CopySharedFxToOutput" DependsOnTargets="RunResolvePackageDependencies;RunResolvePublishAssemblies">
|
||||||
|
<ItemGroup>
|
||||||
|
<NativeAssetsToPublish Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'native' " />
|
||||||
|
<ResourceAssetsToPublish Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'resources'" />
|
||||||
|
<RuntimeAssetsToPublish Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'runtime'" />
|
||||||
|
<OtherAssemblies Include="@(ResolvedAssembliesToPublish)" Exclude="@(NativeAssetsToPublish);@(ResourceAssetsToPublish);@(RuntimeAssetsToPublish)" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Error Text="Unaccounted shared framework assemblies found: @(OtherAssemblies). These files have an unknown asset type." Condition="'@(OtherAssemblies)' != ''" />
|
||||||
|
|
||||||
|
<Copy Condition=" '$(CrossGenOutput)' != 'true' "
|
||||||
|
SourceFiles="@(RuntimeAssetsToPublish)" DestinationFiles="@(RuntimeAssetsToPublish->'$(RuntimeAssetsOutputPath)%(DestinationSubPath)')" />
|
||||||
|
<Copy SourceFiles="@(NativeAssetsToPublish)" DestinationFiles="@(NativeAssetsToPublish->'$(NativeAssetsOutputPath)%(DestinationSubPath)')" />
|
||||||
|
<Copy SourceFiles="@(ResourceAssetsToPublish)" DestinationFiles="@(ResourceAssetsToPublish->'$(RuntimeAssetsOutputPath)%(DestinationSubPath)')" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="PrepareForCrossGen" DependsOnTargets="RunResolvePackageDependencies;RunResolvePublishAssemblies">
|
||||||
<MakeDir Directories="$(CrossGenToolDir)" />
|
<MakeDir Directories="$(CrossGenToolDir)" />
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<RuntimePackageName>Microsoft.NETCore.App</RuntimePackageName>
|
<RuntimePackageName>Microsoft.NETCore.App</RuntimePackageName>
|
||||||
<CrossGenTool>crossgen</CrossGenTool>
|
<CrossGenTool>crossgen</CrossGenTool>
|
||||||
|
@ -231,15 +247,6 @@ This targets file should only be imported by .shfxproj files.
|
||||||
<Error Text="Could not find crossgen in %(RuntimePackage.ResolvedPath)" Condition="@(CrossGenToolFile->Count()) == 0" />
|
<Error Text="Could not find crossgen in %(RuntimePackage.ResolvedPath)" Condition="@(CrossGenToolFile->Count()) == 0" />
|
||||||
<Error Text="Expected to resolve a single clr jit assembly but instead resolved @(ClrJitAssembly->Count()) with identities %(ClrJitAssembly.Identity)" Condition="'@(ClrJitAssembly->Count())' != 1" />
|
<Error Text="Expected to resolve a single clr jit assembly but instead resolved @(ClrJitAssembly->Count()) with identities %(ClrJitAssembly.Identity)" Condition="'@(ClrJitAssembly->Count())' != 1" />
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<NativeAssetsToPublish Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'native' " />
|
|
||||||
<ResourceAssetsToPublish Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'resources'" />
|
|
||||||
<RuntimeAssetsToPublish Include="@(ResolvedAssembliesToPublish)" Condition="'%(AssetType)' == 'runtime'" />
|
|
||||||
<OtherAssemblies Include="@(ResolvedAssembliesToPublish)" Exclude="@(NativeAssetsToPublish);@(ResourceAssetsToPublish);@(RuntimeAssetsToPublish)" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<Error Text="Unaccounted shared framework assemblies found: @(OtherAssemblies). These files have an unknown asset type." Condition="'@(OtherAssemblies)' != ''" />
|
|
||||||
|
|
||||||
<!-- Resolve list of assemblies to crossgen -->
|
<!-- Resolve list of assemblies to crossgen -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AssembliesToCrossgen Include="@(RuntimeAssetsToPublish)">
|
<AssembliesToCrossgen Include="@(RuntimeAssetsToPublish)">
|
||||||
|
@ -251,9 +258,6 @@ This targets file should only be imported by .shfxproj files.
|
||||||
<Symbols>$(SymbolsOutputPath)%(RecursiveDir)</Symbols>
|
<Symbols>$(SymbolsOutputPath)%(RecursiveDir)</Symbols>
|
||||||
</AssembliesToCrossgen>
|
</AssembliesToCrossgen>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Copy SourceFiles="@(NativeAssetsToPublish)" DestinationFiles="@(NativeAssetsToPublish->'$(NativeAssetsOutputPath)%(DestinationSubPath)')" />
|
|
||||||
<Copy SourceFiles="@(ResourceAssetsToPublish)" DestinationFiles="@(ResourceAssetsToPublish->'$(RuntimeAssetsOutputPath)%(DestinationSubPath)')" />
|
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -261,7 +265,7 @@ This targets file should only be imported by .shfxproj files.
|
||||||
This uses .rsp files to get around OS limitations in the maximum number of characters that can be passed in on command-line.
|
This uses .rsp files to get around OS limitations in the maximum number of characters that can be passed in on command-line.
|
||||||
-->
|
-->
|
||||||
<Target Name="CrossGenAssemblies"
|
<Target Name="CrossGenAssemblies"
|
||||||
DependsOnTargets="PrepareForCrossGen;ResolveReferences"
|
DependsOnTargets="CopySharedFxToOutput;ResolveReferences"
|
||||||
Inputs="@(AssembliesToCrossgen)"
|
Inputs="@(AssembliesToCrossgen)"
|
||||||
Outputs="%(AssembliesToCrossgen.Destination)">
|
Outputs="%(AssembliesToCrossgen.Destination)">
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче