-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Labels
untriagedNeeds to be triagedNeeds to be triaged
Description
source-build-reference-packages/src/externalPackages/projects/Directory.Build.targets
Lines 15 to 47 in a2143ed
| <Target Name="PrepareInnerClone"> | |
| <ItemGroup> | |
| <RepoFileToCopy Include="$(OriginalProjectDirectory)**\*" | |
| Exclude="$(OriginalProjectDirectory)artifacts\**\*" /> | |
| </ItemGroup> | |
| <Copy SourceFiles="@(RepoFileToCopy)" DestinationFolder="$(ProjectDirectory)%(RecursiveDir)" SkipUnchangedFiles="true" /> | |
| </Target> | |
| <Target Name="ApplyPatches" | |
| Condition="'@(PatchToApply)' != '' and '$(SkipPatches)' != 'true'" | |
| DependsOnTargets="PrepareInnerClone" | |
| Inputs="@(PatchToApply)" | |
| Outputs="$(BaseIntermediateOutputPath)ApplyPatches.complete" > | |
| <PropertyGroup> | |
| <PatchCommand>git --work-tree=$(ProjectDirectory) apply --ignore-whitespace --whitespace=nowarn</PatchCommand> | |
| </PropertyGroup> | |
| <!-- in the installer tarball, we want to remove the objects directory from the .gitdir to save space. | |
| This causes a problem specifically in the combination of submodules which have redirected .gitdirs | |
| when we are applying patches in the current directory (which is required due to the way Git | |
| interprets the paths in a patch). GIT_DIR=/dev/null short-circuits the .gitdir discovery process | |
| and lets Git treat the directory like any non-Git-controlled directory instead. --> | |
| <Exec Command="$(PatchCommand) %(PatchToApply.Identity)" | |
| WorkingDirectory="$(ProjectDirectory)" | |
| Condition="'@(PatchToApply)' != ''" | |
| EnvironmentVariables="GIT_DIR=/dev/null" /> | |
| <MakeDir Directories="$(BaseIntermediateOutputPath)" /> | |
| <Touch Files="$(BaseIntermediateOutputPath)ApplyPatches.complete" AlwaysCreate="true"> | |
| <Output TaskParameter="TouchedFiles" ItemName="FileWrites" /> | |
| </Touch> | |
| </Target> |
- The
PrepareInnerClonetarget always runs but skips unchanged files. - The
ApplyPatchestarget which runs afterPrepareInnerCloneonly runs once successfully as it then creates an output marker file.
If something fails in the SBRP repo and I run the build again, the PrepareInnerClone target runs again and overwrites the patched files but the ApplyPatches target doesn't run anymore.
Metadata
Metadata
Assignees
Labels
untriagedNeeds to be triagedNeeds to be triaged
Type
Projects
Status
Done