Use submodules for source dependencies

As a part of making builds more reproducible, we want to start committing the exact sha of source dependencies used to build aspnetcore. This implements that using git submodules, and removes targets that were previously used to clone source on demand.
This commit is contained in:
Nate McMaster 2017-10-11 09:56:59 -07:00
parent 509210bcac
commit c8068b7d1c
51 changed files with 294 additions and 231 deletions

1
.gitignore vendored
View File

@ -18,7 +18,6 @@ node_modules
*.snk
.build
.nuget
.r
.w
.deps
global.json

168
.gitmodules vendored Normal file
View File

@ -0,0 +1,168 @@
[submodule "modules/Antiforgery"]
path = modules/Antiforgery
url = https://github.com/aspnet/Antiforgery.git
branch = rel/2.0.1
[submodule "modules/AzureIntegration"]
path = modules/AzureIntegration
url = https://github.com/aspnet/AzureIntegration.git
branch = rel/2.0.1
[submodule "modules/BasicMiddleware"]
path = modules/BasicMiddleware
url = https://github.com/aspnet/BasicMiddleware.git
branch = rel/2.0.1
[submodule "modules/BrowserLink"]
path = modules/BrowserLink
url = https://github.com/aspnet/BrowserLink.git
branch = rel/2.0.1
[submodule "modules/CORS"]
path = modules/CORS
url = https://github.com/aspnet/CORS.git
branch = rel/2.0.1
[submodule "modules/DataProtection"]
path = modules/DataProtection
url = https://github.com/aspnet/DataProtection.git
branch = rel/2.0.1
[submodule "modules/Diagnostics"]
path = modules/Diagnostics
url = https://github.com/aspnet/Diagnostics.git
branch = rel/2.0.1
[submodule "modules/EntityFrameworkCore"]
path = modules/EntityFrameworkCore
url = https://github.com/aspnet/EntityFrameworkCore.git
branch = rel/2.0.1
[submodule "modules/Hosting"]
path = modules/Hosting
url = https://github.com/aspnet/Hosting.git
branch = rel/2.0.1
[submodule "modules/HttpAbstractions"]
path = modules/HttpAbstractions
url = https://github.com/aspnet/HttpAbstractions.git
branch = rel/2.0.1
[submodule "modules/HttpSysServer"]
path = modules/HttpSysServer
url = https://github.com/aspnet/HttpSysServer.git
branch = rel/2.0.1
[submodule "modules/Identity"]
path = modules/Identity
url = https://github.com/aspnet/Identity.git
branch = rel/2.0.1
[submodule "modules/IISIntegration"]
path = modules/IISIntegration
url = https://github.com/aspnet/IISIntegration.git
branch = rel/2.0.1
[submodule "modules/JavaScriptServices"]
path = modules/JavaScriptServices
url = https://github.com/aspnet/JavaScriptServices.git
branch = rel/2.0.1
[submodule "modules/KestrelHttpServer"]
path = modules/KestrelHttpServer
url = https://github.com/aspnet/KestrelHttpServer.git
branch = rel/2.0.1
[submodule "modules/Localization"]
path = modules/Localization
url = https://github.com/aspnet/Localization.git
branch = rel/2.0.1
[submodule "modules/MetaPackages"]
path = modules/MetaPackages
url = https://github.com/aspnet/MetaPackages.git
branch = rel/2.0.1
[submodule "modules/Mvc"]
path = modules/Mvc
url = https://github.com/aspnet/Mvc.git
branch = rel/2.0.1
[submodule "modules/MvcPrecompilation"]
path = modules/MvcPrecompilation
url = https://github.com/aspnet/MvcPrecompilation.git
branch = rel/2.0.1
[submodule "modules/Proxy"]
path = modules/Proxy
url = https://github.com/aspnet/Proxy.git
branch = rel/2.0.1
[submodule "modules/Razor"]
path = modules/Razor
url = https://github.com/aspnet/Razor.git
branch = rel/2.0.1
[submodule "modules/ResponseCaching"]
path = modules/ResponseCaching
url = https://github.com/aspnet/ResponseCaching.git
branch = rel/2.0.1
[submodule "modules/Routing"]
path = modules/Routing
url = https://github.com/aspnet/Routing.git
branch = rel/2.0.1
[submodule "modules/Scaffolding"]
path = modules/Scaffolding
url = https://github.com/aspnet/Scaffolding.git
branch = rel/2.0.1
[submodule "modules/Security"]
path = modules/Security
url = https://github.com/aspnet/Security.git
branch = rel/2.0.1
[submodule "modules/ServerTests"]
path = modules/ServerTests
url = https://github.com/aspnet/ServerTests.git
branch = rel/2.0.1
[submodule "modules/Session"]
path = modules/Session
url = https://github.com/aspnet/Session.git
branch = rel/2.0.1
[submodule "modules/StaticFiles"]
path = modules/StaticFiles
url = https://github.com/aspnet/StaticFiles.git
branch = rel/2.0.1
[submodule "modules/WebSockets"]
path = modules/WebSockets
url = https://github.com/aspnet/WebSockets.git
branch = rel/2.0.1
[submodule "modules/Caching"]
path = modules/Caching
url = https://github.com/aspnet/Caching.git
branch = patch/2.0.1
[submodule "modules/Common"]
path = modules/Common
url = https://github.com/aspnet/Common.git
branch = patch/2.0.1
[submodule "modules/Configuration"]
path = modules/Configuration
url = https://github.com/aspnet/Configuration.git
branch = patch/2.0.1
[submodule "modules/DependencyInjection"]
path = modules/DependencyInjection
url = https://github.com/aspnet/DependencyInjection.git
branch = patch/2.0.1
[submodule "modules/DotNetTools"]
path = modules/DotNetTools
url = https://github.com/aspnet/DotNetTools.git
branch = patch/2.0.1
[submodule "modules/EventNotification"]
path = modules/EventNotification
url = https://github.com/aspnet/EventNotification.git
branch = patch/2.0.1
[submodule "modules/FileSystem"]
path = modules/FileSystem
url = https://github.com/aspnet/FileSystem.git
branch = patch/2.0.1
[submodule "modules/HtmlAbstractions"]
path = modules/HtmlAbstractions
url = https://github.com/aspnet/HtmlAbstractions.git
branch = patch/2.0.1
[submodule "modules/JsonPatch"]
path = modules/JsonPatch
url = https://github.com/aspnet/JsonPatch.git
branch = patch/2.0.1
[submodule "modules/Logging"]
path = modules/Logging
url = https://github.com/aspnet/Logging.git
branch = patch/2.0.1
[submodule "modules/Microsoft.Data.Sqlite"]
path = modules/Microsoft.Data.Sqlite
url = https://github.com/aspnet/Microsoft.Data.Sqlite.git
branch = patch/2.0.1
[submodule "modules/Options"]
path = modules/Options
url = https://github.com/aspnet/Options.git
branch = patch/2.0.1
[submodule "modules/Testing"]
path = modules/Testing
url = https://github.com/aspnet/Testing.git
branch = patch/2.0.1

View File

@ -1,51 +1,16 @@
Universe
=========
========
This repo is to build the whole ASP.NET Core stack.
Build infrastructure used to produce the whole ASP.NET Core stack.
## Getting started
git clone git@github.com:aspnet/Universe.git
cd Universe
build
The default build will clone all known repos as subfolders. The clone will be the dev branch.
If the build is run subsequently it will `git pull` the dev branch rather than clone. Note! This will cause a
merge if you have local changes. We may tweak how this is done if it causes problems.
After folders are up to date, `build.cmd compile` is executed in each of the enlisted subfolders.
If there are errors the build will continue with the next repo.
The last output is a list of which repos succeeded or failed.
## build targets
`build pull` will only clone or pull all repos.
`build compile` this is the default target, described above.
`build install` works like build compile, but will run `build.cmd install` in each subfolder. This means
any nupkg produced by the repo are copied into the local `.nuget` folder to be picked up by subsequent
repositories. The subfolders are built in dependency order.
## Verifying cross repo changes
You can use the Universe repo to preemptively verify and prepare follow ups for your breaking changes:
- Clone the Universe repo https://github.com/aspnet/Universe
- Add a branch attribute to the `build\Repositories.props` file to point to your branch in the repo youre trying to verify. For instance,
`<Repository Include="HtmlAbstractions" Commit="" />`
becomes
`<Repository Include="HtmlAbstractions" Commit="" Branch="prkrishn/breaking-changes" />`
**Note**: This branch should have been pushed to the server already.
- Run from the root of Universe
`build.cmd /p:CompileOnly=true /p:ShallowClone=true /p:BuildGraphOf=HtmlAbstractions`
This should clone and compile all the repos against your breaking changes branch. If youd like to additionally run tests in all your dependencies (this will take a while and also you could hit some flaky tests), remove the first parameter:
`build.cmd /p:ShallowClone=true /p:BuildGraphOf=HtmlAbstractions`
The ShallowClone property speeds up git clone and is optional in both cases.
```
git clone --recursive https://github.com/aspnet/Universe.git
cd Universe
./build.cmd
```
## More info
This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.

View File

@ -1,53 +0,0 @@
<Project>
<ItemGroup>
<!-- Repos being patched -->
<Repository Include="Antiforgery" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="AzureIntegration" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="BasicMiddleware" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="BrowserLink" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="CORS" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="DataProtection" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Diagnostics" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="EntityFrameworkCore" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Hosting" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="HttpAbstractions" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="HttpSysServer" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Identity" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="IISIntegration" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="JavaScriptServices" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="KestrelHttpServer" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Localization" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="MetaPackages" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Mvc" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="MvcPrecompilation" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Proxy" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Razor" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="ResponseCaching" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Routing" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Scaffolding" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Security" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="ServerTests" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="Session" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="StaticFiles" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<Repository Include="WebSockets" Branch="rel/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<!--
Repos not building this patch.
Build tools will *verify* that these repos will be unaffected
by the patch update and do not need updating.
-->
<ShippedRepository Include="Caching" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="Common" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="Configuration" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="DependencyInjection" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="DotNetTools" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="EventNotification" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="FileSystem" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="HtmlAbstractions" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="JsonPatch" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="Logging" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="Microsoft.Data.Sqlite" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="Options" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
<ShippedRepository Include="Testing" Branch="patch/2.0.1" Commit="" CloneUrl="git@github.com:aspnet/%(Identity)" />
</ItemGroup>
</Project>

View File

@ -6,8 +6,7 @@
<Repository>%(RepositoryBuildOrder.Identity)</Repository>
<AdditionalProperties>
RepositoryToBuild=%(RepositoryBuildOrder.Identity);
BuildRepositoryRoot=%(RepositoryBuildOrder.RepositoryPath)\;
CommitHash=%(RepositoryBuildOrder.Commit)
BuildRepositoryRoot=$([MSBuild]::NormalizeDirectory(%(RepositoryBuildOrder.RootPath)))
</AdditionalProperties>
</BatchedRepository>
</ItemGroup>
@ -24,7 +23,7 @@
<!-- If we are building a sub-graph, we need to re-examine the list of artifacts that will actual build. -->
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="GetArtifactInfo"
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(RepositoryBuildOrder.Identity)\;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
Properties="RepositoryRoot=$(SubmoduleRoot)%(RepositoryBuildOrder.Identity)\;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
Condition="'$(BuildGraphOf)' != ''">
<Output TaskParameter="TargetOutputs" ItemName="PinnedArtifactInfo" />
</MSBuild>
@ -44,7 +43,7 @@
<!-- If there are duplicate properties, the properties which are defined later in the order would override the earlier ones -->
<RepositoryBuildArguments>$(RepositoryBuildArguments) /p:DotNetRestoreSourcePropsPath=$(GeneratedRestoreSourcesPropsPath)</RepositoryBuildArguments>
<RepositoryBuildArguments>$(RepositoryBuildArguments) /p:DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath)</RepositoryBuildArguments>
<RepositoryBuildArguments>$(RepositoryBuildArguments) /p:BuildNumber=$(BuildNumber) /p:Configuration=$(Configuration) /p:CommitHash=$(CommitHash)</RepositoryBuildArguments>
<RepositoryBuildArguments>$(RepositoryBuildArguments) /p:BuildNumber=$(BuildNumber) /p:Configuration=$(Configuration)</RepositoryBuildArguments>
<RepositoryBuildArguments>$(RepositoryBuildArguments) /noconsolelogger '/l:RepoTasks.FlowLogger,$(MSBuildThisFileDirectory)tasks\bin\publish\RepoTasks.dll;Summary;FlowId=$(RepositoryToBuild)'</RepositoryBuildArguments>
<BuildArguments>$(_RepositoryBuildTargets) $(RepositoryBuildArguments)</BuildArguments>

View File

@ -5,4 +5,5 @@
</PropertyGroup>
<Import Project="artifacts.props" />
<Import Project="submodules.props" />
</Project>

View File

@ -4,17 +4,10 @@
<Import Project="push.targets" />
<PropertyGroup>
<_CloneRepositoryRoot>$(RepositoryRoot).r\</_CloneRepositoryRoot>
<ClearRepositoryCloneRoot Condition="'$(SkipClone)' == 'true'">false</ClearRepositoryCloneRoot>
<SubmoduleRoot>$(RepositoryRoot)modules\</SubmoduleRoot>
<_DependencyBuildDirectory>$(RepositoryRoot).deps\build\</_DependencyBuildDirectory>
<_DependencyPackagesDirectory>$(_DependencyBuildDirectory)</_DependencyPackagesDirectory>
<_RepositoryListFileName>Repositories.props</_RepositoryListFileName>
<_DefaultRepositoryList>$(MSBuildThisFileDirectory)$(_RepositoryListFileName)</_DefaultRepositoryList>
<_DependencyRepositoryList>$(_DependencyBuildDirectory)$(_RepositoryListFileName)</_DependencyRepositoryList>
<_RepositoryListToImport Condition="Exists('$(_DependencyRepositoryList)')">$(_DependencyRepositoryList)</_RepositoryListToImport>
<_RepositoryListToImport Condition="!Exists('$(_DependencyRepositoryList)')">$(_DefaultRepositoryList)</_RepositoryListToImport>
<_RepositoryBuildTargets Condition="'$(_RepositoryBuildTargets)'=='' AND '$(CompileOnly)'=='true'">/t:Package /t:VerifyPackages</_RepositoryBuildTargets>
<_RepositoryBuildTargets Condition="'$(_RepositoryBuildTargets)'==''">/t:Verify</_RepositoryBuildTargets>
<!-- For external packages that come from feeds will mirrored to aspnetcore feeds. -->
@ -23,16 +16,18 @@
<IntermediateExternalPackageDir>$(IntermediateDir)ext\</IntermediateExternalPackageDir>
<GeneratedPackageVersionPropsPath>$(IntermediateDir)dependencies.props</GeneratedPackageVersionPropsPath>
<GeneratedRestoreSourcesPropsPath>$(IntermediateDir)sources.props</GeneratedRestoreSourcesPropsPath>
<TcVcsIdPrefix>Patch20_</TcVcsIdPrefix>
<PrepareDependsOn>$(PrepareDependsOn);PrepareOutputPath</PrepareDependsOn>
<CleanDependsOn>$(CleanDependsOn);CleanArtifacts;CleanUniverseArtifacts</CleanDependsOn>
<RestoreDependsOn>$(RestoreDependsOn);RestoreExternalDependencies</RestoreDependsOn>
<CompileDependsOn>$(CompileDependsOn);CloneRepositories;BuildRepositories</CompileDependsOn>
<CompileDependsOn>$(CompileDependsOn);BuildRepositories</CompileDependsOn>
<PackageDependsOn>$(PackageDependsOn);BuildAllMetapackage;SplitPackages</PackageDependsOn>
<VerifyDependsOn>$(VerifyDependsOn);VerifyCoherentVersions</VerifyDependsOn>
</PropertyGroup>
<Import Project="$(_RepositoryListToImport)" />
<Target Name="PrepareOutputPath">
<MakeDir Directories="$(ArtifactsDir);$(BuildDir)" />
</Target>
<Target Name="RestoreExternalDependencies">
<RepoTasks.DownloadNuGetPackages
@ -67,7 +62,6 @@
</Target>
<Target Name="CleanUniverseArtifacts">
<RemoveDir Directories="$(_CloneRepositoryRoot)" Condition="Exists('$(_CloneRepositoryRoot)') AND '$(ClearRepositoryCloneRoot)' != 'false'" />
<RemoveDir Directories="$(RepositoryRoot)obj" Condition="Exists('$(RepositoryRoot)obj')" />
</Target>
@ -88,82 +82,29 @@
Condition="'$(KOREBUILD_REPOSITORY_INCLUDE)' != '' AND '$(KOREBUILD_REPOSITORY_EXCLUDE)' != ''" />
<ItemGroup>
<Repository Update="%(Identity)" RepositoryPath="$(_CloneRepositoryRoot)%(Identity)" />
<Repository Update="%(Identity)" RootPath="$(SubmoduleRoot)%(Identity)\" />
<ShippedRepository Update="%(Identity)" RootPath="$(SubmoduleRoot)%(Identity)\" />
</ItemGroup>
</Target>
<Target Name="CloneRepositories" DependsOnTargets="_PrepareRepositories" Condition="'$(SkipClone)' != 'true'">
<ItemGroup>
<_CloneRepositories Include="@(Repository)" />
<_CloneRepositories Remove="%(Repository.Identity)" Condition="$([System.Environment]::GetEnvironmentVariable('BUILD_VCS_NUMBER_$(TcVcsIdPrefix)%(Repository.Identity)')) != ''" />
<_CloneRepositories Include="@(ShippedRepository)" />
<_CloneRepository Include="$(MSBuildProjectFullPath)">
<AdditionalProperties>
CloneRepository=%(_CloneRepositories.Identity);
CloneUrl=%(_CloneRepositories.CloneUrl);
CloneBranch=%(_CloneRepositories.Branch);
CloneRepositoryCommit=%(_CloneRepositories.Commit);
UseGateBranch=$(UseGateBranch)
</AdditionalProperties>
</_CloneRepository>
</ItemGroup>
<Message Text="Using the repository list information from '$(_RepositoryListToImport)' to clone ..." Importance="High" />
<MakeDir Directories="$(_CloneRepositoryRoot)" />
<MSBuild Projects="@(_CloneRepository)"
Targets="_CloneRepository"
BuildInParallel="$(BuildInParallel)" />
</Target>
<Target Name="_CloneRepository">
<PropertyGroup>
<ShallowClone Condition="'$(ShallowClone)'=='' OR '$(CloneRepositoryCommit)'!=''">false</ShallowClone>
<_CloneArguments>git clone --quiet $(CloneUrl) $(CloneRepository)</_CloneArguments>
<_CloneArguments Condition="'$(ShallowClone)'=='true'">$(_CloneArguments) --depth 1</_CloneArguments>
</PropertyGroup>
<Message Text="Cloning $(CloneRepository) ..." Importance="High" />
<Exec
Command="$(_CloneArguments) --branch $(CloneBranch)-gate"
Condition="'$(UseGateBranch)'=='true'"
IgnoreExitCode="true"
IgnoreStandardErrorWarningFormat="true"
WorkingDirectory="$(_CloneRepositoryRoot)">
<Output TaskParameter="ExitCode" PropertyName="GateBranchExitCode" />
</Exec>
<Warning Text="Using $(CloneBranch)-gate for $(CloneRepository)"
Condition="'$(GateBranchExitCode)'=='0'" />
<Exec
Command="$(_CloneArguments) --branch $(CloneBranch)"
Condition="'$(GateBranchExitCode)'!='0'"
WorkingDirectory="$(_CloneRepositoryRoot)" />
<Message Text="Resetting $(CloneRepository) commit to $(CloneRepositoryCommit) ..." Importance="High" Condition="'$(CloneRepositoryCommit)'!=''"/>
<Exec
Command="git reset --quiet --hard $(CloneRepositoryCommit)"
WorkingDirectory="$(_CloneRepositoryRoot)$(CloneRepository)"
Condition="'$(CloneRepositoryCommit)'!=''" />
</Target>
<Target Name="BuildRepositories"
DependsOnTargets="_PrepareRepositories;_CreateRepositoriesListWithCommits;GeneratePropsFiles;ComputeGraph;_BuildRepositories" />
DependsOnTargets="_PrepareRepositories;GeneratePropsFiles;ComputeGraph;_BuildRepositories" />
<Target Name="ResolveRepoInfo" DependsOnTargets="_PrepareRepositories">
<Error Text="%(Repository.RootPath) does not exist. Did you forget to clone the submodules? Run `git submodules update`." Condition="!Exists(%(Repository.RootPath))" />
<Error Text="%(ShippedRepository.RootPath) does not exist. Did you forget to clone the submodules? Run `git submodules update`." Condition="!Exists(%(ShippedRepository.RootPath))" />
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="GetArtifactInfo"
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(Repository.Identity)\;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
Properties="RepositoryRoot=%(Repository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
ContinueOnError="WarnAndContinue">
<Output TaskParameter="TargetOutputs" ItemName="ArtifactInfo" />
</MSBuild>
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="ResolveSolutions"
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(Repository.Identity)\;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
Properties="RepositoryRoot=%(Repository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
ContinueOnError="WarnAndContinue">
<Output TaskParameter="TargetOutputs" ItemName="Solution" />
</MSBuild>
@ -174,13 +115,13 @@
-->
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="GetArtifactInfo"
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(ShippedRepository.Identity)\;Configuration=$(Configuration);BuildNumber=$(BuildNumber);IsFinalBuild=true"
Properties="RepositoryRoot=%(ShippedRepository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber);IsFinalBuild=true"
ContinueOnError="WarnAndContinue">
<Output TaskParameter="TargetOutputs" ItemName="ShippedArtifactInfo" />
</MSBuild>
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="ResolveSolutions"
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(ShippedRepository.Identity)\;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
Properties="RepositoryRoot=%(ShippedRepository.RootPath);Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
ContinueOnError="WarnAndContinue">
<Output TaskParameter="TargetOutputs" ItemName="_NoBuildSolution" />
</MSBuild>
@ -191,7 +132,7 @@
<Solution Include="@(_NoBuildSolution)" />
</ItemGroup>
<Error Text="No solutions were found in '$(_CloneRepositoryRoot)'" Condition="@(Solution->Count()) == 0" />
<Error Text="No solutions were found in '$(SubmoduleRoot)'" Condition="@(Solution->Count()) == 0" />
</Target>
<Target Name="ComputeGraph" DependsOnTargets="ResolveRepoInfo;GeneratePropsFiles">
@ -230,56 +171,4 @@
ExternalDependencies="@(ExternalDependency);@(ShippedExternalDependency)" />
</Target>
<Target Name="_CreateRepositoriesListWithCommits" DependsOnTargets="_GetRepositoryCommits">
<PropertyGroup>
<RepositoryFileWithCommit>$(BuildDir)$(_RepositoryListFileName)</RepositoryFileWithCommit>
</PropertyGroup>
<Copy
SourceFiles="$(_DefaultRepositoryList)"
DestinationFiles="$(RepositoryFileWithCommit)" />
<XmlPoke
XmlInputPath="$(RepositoryFileWithCommit)"
Query="//Repository[@Include='%(Repository.Identity)']/@Commit"
Value="%(Repository.Commit)" />
<XmlPoke
XmlInputPath="$(RepositoryFileWithCommit)"
Query="//Repository[@Include='%(Repository.Identity)']/@CloneUrl"
Value="%(Repository.CloneUrl)" />
</Target>
<!-- Based on the solution here: http://stackoverflow.com/a/11331566 -->
<Target Name="_GetRepositoryCommits" Outputs="%(Repository.Identity)">
<PropertyGroup>
<!--
Attempt to read environment variables set up by the CI's VCS Root if available.
* BUILD_VCS_URL_<RepositoryName> gives us the clone URL for a repository
* BUILD_VCS_NUMBER_<RepositoryName> gives us the commit hash for a repository.
-->
<_RepositoryName>$([System.String]::new('%(Repository.Identity)').Replace('.', '_'))</_RepositoryName>
<_CloneUrl>$([System.Environment]::GetEnvironmentVariable("BUILD_VCS_URL_$(TcVcsIdPrefix)$(_RepositoryName)"))</_CloneUrl>
<_CommitHash>$([System.Environment]::GetEnvironmentVariable("BUILD_VCS_NUMBER_$(TcVcsIdPrefix)$(_RepositoryName)"))</_CommitHash>
</PropertyGroup>
<Warning Text="%(Repository.Identity) has not been cloned."
Condition="!Exists('%(Repository.RepositoryPath)')" />
<GetGitCommitInfo
WorkingDirectory="%(Repository.RepositoryPath)"
Condition="'$(_CommitHash)'=='' AND Exists('%(Repository.RepositoryPath)')">
<Output TaskParameter="CommitHash" PropertyName="_CommitHash" />
</GetGitCommitInfo>
<ItemGroup>
<Repository Update="%(Identity)" Commit="$(_CommitHash)" />
<Repository Update="%(Identity)" CloneUrl="$(_CloneUrl)" Condition="'$(_CloneUrl)'!=''" />
</ItemGroup>
<PropertyGroup>
<_CommitHash></_CommitHash>
<_CloneUrl></_CloneUrl>
</PropertyGroup>
</Target>
</Project>

53
build/submodules.props Normal file
View File

@ -0,0 +1,53 @@
<Project>
<ItemGroup>
<!-- Repos being patched -->
<Repository Include="Antiforgery" />
<Repository Include="AzureIntegration" />
<Repository Include="BasicMiddleware" />
<Repository Include="BrowserLink" />
<Repository Include="CORS" />
<Repository Include="DataProtection" />
<Repository Include="Diagnostics" />
<Repository Include="EntityFrameworkCore" />
<Repository Include="Hosting" />
<Repository Include="HttpAbstractions" />
<Repository Include="HttpSysServer" />
<Repository Include="Identity" />
<Repository Include="IISIntegration" />
<Repository Include="JavaScriptServices" />
<Repository Include="KestrelHttpServer" />
<Repository Include="Localization" />
<Repository Include="MetaPackages" />
<Repository Include="Mvc" />
<Repository Include="MvcPrecompilation" />
<Repository Include="Proxy" />
<Repository Include="Razor" />
<Repository Include="ResponseCaching" />
<Repository Include="Routing" />
<Repository Include="Scaffolding" />
<Repository Include="Security" />
<Repository Include="ServerTests" />
<Repository Include="Session" />
<Repository Include="StaticFiles" />
<Repository Include="WebSockets" />
<!--
Repos not building this patch.
Build tools will *verify* that these repos will be unaffected
by the patch update and do not need updating.
-->
<ShippedRepository Include="Caching" />
<ShippedRepository Include="Common" />
<ShippedRepository Include="Configuration" />
<ShippedRepository Include="DependencyInjection" />
<ShippedRepository Include="DotNetTools" />
<ShippedRepository Include="EventNotification" />
<ShippedRepository Include="FileSystem" />
<ShippedRepository Include="HtmlAbstractions" />
<ShippedRepository Include="JsonPatch" />
<ShippedRepository Include="Logging" />
<ShippedRepository Include="Microsoft.Data.Sqlite" />
<ShippedRepository Include="Options" />
<ShippedRepository Include="Testing" />
</ItemGroup>
</Project>

View File

@ -225,7 +225,7 @@ namespace RepoTasks
var order = TopologicalSort.GetOrder(graphNodeRepository);
var repositoryTaskItem = new TaskItem(repository.Name);
repositoryTaskItem.SetMetadata("Order", order.ToString());
repositoryTaskItem.SetMetadata("RepositoryPath", repository.RootDir);
repositoryTaskItem.SetMetadata("RootPath", repository.RootDir);
repositoriesWithOrder.Add((repositoryTaskItem, order));
}

1
modules/Antiforgery Submodule

@ -0,0 +1 @@
Subproject commit a45c919344bd40ee719e41b205d7418728a3c7fa

@ -0,0 +1 @@
Subproject commit 7f86cd58fd91ff8bb8c4286eda5444188d002002

@ -0,0 +1 @@
Subproject commit 47e4b458528c2d05c8b0004de1718b5134687211

1
modules/BrowserLink Submodule

@ -0,0 +1 @@
Subproject commit 0c496c3652faf6f8091394f31ffc03e8f3199ffa

1
modules/CORS Submodule

@ -0,0 +1 @@
Subproject commit a95ab767fda039777a81fc712f6986cde15bff8d

1
modules/Caching Submodule

@ -0,0 +1 @@
Subproject commit 19dc192591c77f998c0856213ab7ae088997d043

1
modules/Common Submodule

@ -0,0 +1 @@
Subproject commit 7309bc455b15eb9cf5634fd281a227b744d29b68

1
modules/Configuration Submodule

@ -0,0 +1 @@
Subproject commit ebc12e335e194893f9e1818ac32078f02ebc6b4a

@ -0,0 +1 @@
Subproject commit f5004b5ad8c8d802d584d9a186cd96e362e66857

@ -0,0 +1 @@
Subproject commit b5e7f41cd9a2ac2650f3168d09de491fa10f2336

1
modules/Diagnostics Submodule

@ -0,0 +1 @@
Subproject commit 0372c762cf5df2084e9b9cd2ac299a63d707afc6

1
modules/DotNetTools Submodule

@ -0,0 +1 @@
Subproject commit 72add92b43df8327d14f38b25013ad035d8b71a1

@ -0,0 +1 @@
Subproject commit 196400e9ca7ebaac92e6e1e7d638fc1c82446385

@ -0,0 +1 @@
Subproject commit bd62d775466ff5f7286ba847681451f3ecaa3b0a

1
modules/FileSystem Submodule

@ -0,0 +1 @@
Subproject commit befc6c1a86f36bcc66ed4ab6562b9904b56a4802

1
modules/Hosting Submodule

@ -0,0 +1 @@
Subproject commit befe353db8a376c1a2c6b58c62f08d315d90e0b2

@ -0,0 +1 @@
Subproject commit dc04ba8ee7137289afe4c64d8b1b7177ceb2e780

@ -0,0 +1 @@
Subproject commit 4afe4480b4909141160ded50487b575cc8fd4cd8

1
modules/HttpSysServer Submodule

@ -0,0 +1 @@
Subproject commit 7ea2905820aac58488466ad4671d9397566c3173

@ -0,0 +1 @@
Subproject commit f8a04f2d4e7a0d401e7fed445262d57fcc64b81e

1
modules/Identity Submodule

@ -0,0 +1 @@
Subproject commit 8a880adf7299777d4ef025fa78c23be072fb8a08

@ -0,0 +1 @@
Subproject commit 86e94d7812d0c8790ebcb32a6ae6935b85648d9c

1
modules/JsonPatch Submodule

@ -0,0 +1 @@
Subproject commit bfd5a994cb68dd090694d38b5695958665bcc876

@ -0,0 +1 @@
Subproject commit 39b56770a97cdc4943cb2d652329b3ca9afc84a5

1
modules/Localization Submodule

@ -0,0 +1 @@
Subproject commit 6be6b8fe1d44cbc04e85d06ae69e4eef94091f28

1
modules/Logging Submodule

@ -0,0 +1 @@
Subproject commit 527a2809bf4739a3502fdc87626411fd04f483a8

1
modules/MetaPackages Submodule

@ -0,0 +1 @@
Subproject commit 3d5b69063fa85a4c504f7d9208e260b8c33bd683

@ -0,0 +1 @@
Subproject commit e911180feacb80daddeb374e28169fb5d85e62aa

1
modules/Mvc Submodule

@ -0,0 +1 @@
Subproject commit 3bfb023679e73b19b0a513002ccffd42d820eecb

@ -0,0 +1 @@
Subproject commit 9d07f205f2bda99f7b62c0d65ad70043b22e7a22

1
modules/Options Submodule

@ -0,0 +1 @@
Subproject commit 35c1a7a57b1d71ab3feb40db353b4505c4d53793

1
modules/Proxy Submodule

@ -0,0 +1 @@
Subproject commit 2875d8e4a14f9375d409ee42cd5d9a2d49363295

1
modules/Razor Submodule

@ -0,0 +1 @@
Subproject commit e45618eb1b0d5b37091dc38f169c24b4f546cdaf

@ -0,0 +1 @@
Subproject commit bf08e66ceeabd7a8ef8eef9fe3d8492b1b6c23ba

1
modules/Routing Submodule

@ -0,0 +1 @@
Subproject commit d104dd8f5fc9658214a49a3ceb2a7b1ad448ef54

1
modules/Scaffolding Submodule

@ -0,0 +1 @@
Subproject commit 2f754921f5b58450fe901a179cc9b313ce083a1b

1
modules/Security Submodule

@ -0,0 +1 @@
Subproject commit 30b629edfdc20cdc2d11df01657b94f1e0b9772c

1
modules/ServerTests Submodule

@ -0,0 +1 @@
Subproject commit 369b64b1b6f2a816669e4f9929211b0780485ac3

1
modules/Session Submodule

@ -0,0 +1 @@
Subproject commit c2b35d75a3c0358e7773697252552ab396b0120b

1
modules/StaticFiles Submodule

@ -0,0 +1 @@
Subproject commit 3368112e15f76f688555968ea16bf4f766dc3ed8

1
modules/Testing Submodule

@ -0,0 +1 @@
Subproject commit abd5da6ccf89ff70f52df7060d7f8dbb39dc5779

1
modules/WebSockets Submodule

@ -0,0 +1 @@
Subproject commit b956ad3143ef4d7144f4f55a9d783679fe60a044