Apply source-build patches during tarball creation (#12133)

This commit is contained in:
Michael Simons 2021-09-28 07:39:40 -05:00 committed by GitHub
parent c760c779e4
commit e68cea7f97
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 19 additions and 34 deletions

View file

@ -175,6 +175,24 @@
<Message Text="--> Done Cloning Repo $(SourceBuildRepoName)" Importance="High" />
<!-- Apply source-build patches -->
<ItemGroup>
<SourceBuildPatchFile Include="$(RepoRoot)src/SourceBuild/tarball/patches/$(SourceBuildRepoName)/*.patch" />
</ItemGroup>
<Message
Text="--> Applying $(SourceBuildRepoName) Patches"
Importance="High"
Condition="'@(SourceBuildPatchFile)' != ''" />
<Exec
Command="git --work-tree=$(TarballRepoSourceDir) apply --ignore-whitespace --whitespace=nowarn &quot;%(SourceBuildPatchFile.FullPath)&quot;"
WorkingDirectory="$(TarballRepoSourceDir)"
Condition="'@(SourceBuildPatchFile)' != ''" />
<Message
Text="--> Done Applying $(SourceBuildRepoName) Patches"
Importance="High"
Condition="'@(SourceBuildPatchFile)' != ''" />
<!-- Override to use a temporary SourceBuild specific Version.Details.xml file in installer for Preview 6
See https://github.com/dotnet/source-build/issues/2266 -->
<Copy

View file

@ -45,7 +45,6 @@
<DotNetCliToolDir Condition="'$(DotNetCliToolDir)' == '' and '$(DOTNET_INSTALL_DIR)' != ''">$([MSBuild]::NormalizeDirectory('$(DOTNET_INSTALL_DIR)'))</DotNetCliToolDir>
<DotNetCliToolDir Condition="'$(DotNetCliToolDir)' == ''">$(ProjectDir).dotnet/</DotNetCliToolDir>
<DotnetToolCommand>$(DotNetCliToolDir)dotnet</DotnetToolCommand>
<PatchesDir>$(ProjectDir)patches/</PatchesDir>
<PackagesDir Condition="'$(NuGetPackageRoot)' != ''">$(NuGetPackageRoot)</PackagesDir>
<PackagesDir Condition="'$(PackagesDir)' == ''">$(ProjectDir)packages/restored/</PackagesDir>
<ArcadeBootstrapPackageDir>$(PackagesDir)ArcadeBootstrapPackage/</ArcadeBootstrapPackageDir>

View file

@ -70,26 +70,6 @@
<MSBuild Projects="@(_DependentProject)" Targets="Build" BuildInParallel="$(BuildInParallel)" StopOnFirstFailure="true" />
</Target>
<ItemGroup Condition="Exists('$(PatchesDir)$(RepositoryName)')" >
<PatchesToApply Include="$(PatchesDir)$(RepositoryName)/*.patch" />
</ItemGroup>
<Target Name="ApplyPatches"
Condition="'@(PatchesToApply)' != '' and '$(SkipPatches)' != 'true'"
Inputs="@(PatchesToApply)"
Outputs="$(RepoCompletedSemaphorePath)ApplyPatches.complete" >
<PropertyGroup>
<PatchCommand>git --work-tree=$(ProjectDirectory) apply --ignore-whitespace --whitespace=nowarn</PatchCommand>
</PropertyGroup>
<Exec Command="$(PatchCommand) %(PatchesToApply.Identity)"
WorkingDirectory="$(ProjectDirectory)"
Condition="'@(PatchesToApply)' != ''" />
<WriteLinesToFile File="$(RepoCompletedSemaphorePath)ApplyPatches.complete" Overwrite="true" />
</Target>
<!--
Update root repo with trailing slash until https://github.com/dotnet/arcade/pull/7498 gets figured out
in arcade an propegated to all repos

View file

@ -39,7 +39,7 @@
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="ReplaceRegexInFiles" />
<Target Name="FixAspNetCoreVersion"
AfterTargets="ApplyPatches">
BeforeTargets="RepoBuild">
<ItemGroup>
<MinifiedJavascriptFile Include="$(ProjectDirectory)**\blazor.server.js" />

View file

@ -25,7 +25,6 @@
ExtractToolPackage;
GenerateRootFs;
BuildTextOnlyPackages;
ApplyPatches;
PoisonPrebuiltPackages" />
</Target>
@ -109,17 +108,6 @@
<WriteLinesToFile File="$(CompletedSemaphorePath)BuildXPlatTasks.complete" Overwrite="true" />
</Target>
<Target Name="GetRepoProjects">
<ItemGroup>
<RepoProjects Include="$(ProjectDir)repos/*.proj" />
</ItemGroup>
</Target>
<Target Name="ApplyPatches" DependsOnTargets="GetRepoProjects">
<Message Text="Applying patches only" />
<MSBuild Projects="@(RepoProjects)" Targets="ApplyPatches" BuildInParallel="$(BuildInParallel)" />
</Target>
<Target Name="GenerateRootFs" Condition="'$(OS)' != 'Windows_NT'">
<Exec Condition="$(Platform.Contains('arm')) AND '$(Platform)' != 'armel' AND '$(BuildArchitecture)' != 'arm64'" Command="$(ArmEnvironmentVariables) $(ProjectDir)cross/build-rootfs.sh" />
<Exec Condition="'$(Platform)' == 'armel'" Command="$(ArmEnvironmentVariables) $(ProjectDir)cross/armel/tizen-build-rootfs.sh" />