-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Make GeneratePublishDependencyFile incremental #32305
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
Changes from all commits
2c7a0cd
5b540f2
9e519ad
01a16b2
ef75097
490d428
9cb55bc
fe61265
7c36074
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -919,11 +919,37 @@ Copyright (c) .NET Foundation. All rights reserved. | |
| </PropertyGroup> | ||
| </Target> | ||
|
|
||
| <Target Name="_GenerateSingleFileBundleInputCache"> | ||
| <ItemGroup> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishedSingleFilePath)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(TraceSingleFileBundler)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeSymbolsInSingleFile)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeAllContentForSelfExtract)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(IncludeNativeLibrariesForSelfExtract)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(EnableCompressionInSingleFile)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishedSingleFileName)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(PublishDir)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="$(_TargetFrameworkVersionWithoutV)" /> | ||
| <_GenerateSingleFileBundlePropertyInputsCacheToHash Include="@(FilesToBundle)" /> | ||
| </ItemGroup> | ||
|
|
||
| <Hash ItemsToHash="@(_GenerateSingleFileBundlePropertyInputsCacheToHash)"> | ||
| <Output TaskParameter="HashResult" PropertyName="_GenerateSingleFileBundlePropertyInputsCacheHash" /> | ||
| </Hash> | ||
|
|
||
| <WriteLinesToFile | ||
| Lines="$(_GenerateSingleFileBundlePropertyInputsCacheHash)" | ||
| File="$(_GenerateSingleFileBundlePropertyInputsCache)" | ||
| Overwrite="true" | ||
| WriteOnlyWhenDifferent="true" /> | ||
| </Target> | ||
|
|
||
| <UsingTask TaskName="GenerateBundle" AssemblyFile="$(MicrosoftNETBuildTasksAssembly)" /> | ||
| <Target Name="GenerateSingleFileBundle" | ||
| Condition="'$(PublishSingleFile)' == 'true'" | ||
| DependsOnTargets="_ComputeFilesToBundle;PrepareForBundle" | ||
| Inputs="@(FilesToBundle)" | ||
| DependsOnTargets="_ComputeFilesToBundle;PrepareForBundle;_GenerateSingleFileBundleInputCache" | ||
| Inputs="@(FilesToBundle);$(_GenerateSingleFileBundlePropertyInputsCache)" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It may be better to include
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added this to the hash, but I think it also needs to be a normal input - that way it'll rebuild if the list of filenames changes, or if the file timestamps changes. |
||
| Outputs="$(PublishedSingleFilePath)"> | ||
|
|
||
| <PropertyGroup> | ||
|
|
@@ -957,6 +983,50 @@ Copyright (c) .NET Foundation. All rights reserved. | |
|
|
||
| </Target> | ||
|
|
||
| <Target Name="_ComputeIntermediateDepsFilePath"> | ||
| <PropertyGroup> | ||
| <!-- IntermediateDepsFilePath is the location where the deps.json file is originally created --> | ||
| <IntermediateDepsFilePath Condition=" '$(PublishDepsFilePath)' != ''">$(PublishDepsFilePath)</IntermediateDepsFilePath > | ||
| <IntermediateDepsFilePath Condition=" '$(PublishDepsFilePath)' == ''">$(IntermediateOutputPath)$(ProjectDepsFileName)</IntermediateDepsFilePath > | ||
| </PropertyGroup> | ||
| </Target> | ||
|
|
||
| <Target Name="_GeneratePublishDependencyFileInputCache" | ||
| DependsOnTargets="_ComputeIntermediateDepsFilePath"> | ||
| <ItemGroup> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(PublishDepsFilePath)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(PublishSingleFile)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(MSBuildProjectFullPath)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(ProjectAssetsFile)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IntermediateDepsFilePath)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(TargetFramework)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(AssemblyName)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(TargetExt)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(Version)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeMainProjectInDepsFile)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(RuntimeIdentifier)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(MicrosoftNETPlatformLibrary)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(SelfContained)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeFileVersionsInDependencyFile)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(BundledRuntimeIdentifierGraphFile)" /> | ||
| <_GeneratePublishDependencyFilePropertyInputsCacheToHash Include="$(IncludeProjectsNotInAssetsFileInDepsFile)" /> | ||
| </ItemGroup> | ||
|
|
||
| <Hash ItemsToHash="@(_GeneratePublishDependencyFilePropertyInputsCacheToHash)"> | ||
| <Output TaskParameter="HashResult" PropertyName="_GeneratePublishDependencyFilePropertyInputsCacheHash" /> | ||
| </Hash> | ||
|
|
||
| <WriteLinesToFile | ||
| Lines="$(_GeneratePublishDependencyFilePropertyInputsCacheHash)" | ||
| File="$(_GeneratePublishDependencyFilePropertyInputsCache)" | ||
| Overwrite="True" | ||
| WriteOnlyWhenDifferent="True" /> | ||
|
|
||
| <ItemGroup> | ||
| <FileWrites Include="$(_GeneratePublishDependencyFilePropertyInputsCache)" /> | ||
| </ItemGroup> | ||
| </Target> | ||
|
|
||
| <!-- | ||
| ============================================================ | ||
| _GeneratePublishDependencyFile | ||
|
|
@@ -965,25 +1035,27 @@ Copyright (c) .NET Foundation. All rights reserved. | |
| --> | ||
| <Target Name="GeneratePublishDependencyFile" | ||
| DependsOnTargets="_ComputeUseBuildDependencyFile; | ||
| _ComputeIntermediateDepsFilePath; | ||
| _DefaultMicrosoftNETPlatformLibrary; | ||
| _HandlePackageFileConflicts; | ||
| _HandlePackageFileConflictsForPublish; | ||
| _ComputeReferenceAssemblies; | ||
| _ComputeUserRuntimeAssemblies; | ||
| ResolveRuntimePackAssets; | ||
| _ComputePackageReferencePublish" | ||
| Condition="'$(GenerateDependencyFile)' == 'true' and '$(_UseBuildDependencyFile)' != 'true' and '$(PublishAot)' != 'true'"> | ||
| _ComputePackageReferencePublish; | ||
| _GeneratePublishDependencyFileInputCache" | ||
| Condition="'$(GenerateDependencyFile)' == 'true' and '$(_UseBuildDependencyFile)' != 'true' and '$(PublishAot)' != 'true'" | ||
| Inputs="$(ProjectAssetsFile);$(ProjectAssetsCacheFile);$(MSBuildAllProjects);$(_GeneratePublishDependencyFilePropertyInputsCache)" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of the item inputs aren't declared here or included in the hash. Is this because
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't include the items in Inputs or the hash because they weren't included in the incremental inputs for I did try to include all relevant properties in the input hash, except for |
||
| Outputs="$(IntermediateDepsFilePath)"> | ||
|
|
||
| <PropertyGroup> | ||
| <!-- IntermediateDepsFilePath is the location where the deps.json file is originally created | ||
| PublishDepsFilePath is the location where the deps.json resides when published | ||
| PublishDepsFilePath is empty (by default) for PublishSingleFile, since the deps.json file is embedde within the single-file bundle --> | ||
| <IntermediateDepsFilePath Condition=" '$(PublishDepsFilePath)' != ''">$(PublishDepsFilePath)</IntermediateDepsFilePath > | ||
| <IntermediateDepsFilePath Condition=" '$(PublishDepsFilePath)' == ''">$(IntermediateOutputPath)$(ProjectDepsFileName)</IntermediateDepsFilePath > | ||
| <!-- PublishDepsFilePath is the location where the deps.json resides when published | ||
| PublishDepsFilePath is empty (by default) for PublishSingleFile, since the deps.json file is embedded within the single-file bundle --> | ||
| <PublishDepsFilePath Condition=" '$(PublishDepsFilePath)' == '' And '$(PublishSingleFile)' != 'true'">$(PublishDir)$(ProjectDepsFileName)</PublishDepsFilePath> | ||
| <_IsSingleFilePublish Condition="'$(PublishSingleFile)' == ''">false</_IsSingleFilePublish> | ||
| <_IsSingleFilePublish Condition="'$(PublishSingleFile)' != ''">$(PublishSingleFile)</_IsSingleFilePublish> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ResolvedCompileFileDefinitions Remove="@(_PublishConflictPackageFiles)" Condition="'%(_PublishConflictPackageFiles.ConflictItemType)' == 'Reference'" /> | ||
| <RuntimeTargetsCopyLocalItems Remove="@(_PublishConflictPackageFiles)" Condition="'%(_PublishConflictPackageFiles.ConflictItemType)' != 'Reference'" /> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.