Use submodules for source dependencies (#621)
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. Initial submodule status: Antiforgery =>e1884586AzureIntegration =>c998d74eBasicMiddleware =>9f3ed006BrowserLink => 7e2ff85a Caching => c6a9cbbe Common => 062ad3e7 CORS =>8fd36866DataProtection =>49b2e22aDependencyInjection => 88297e3c Diagnostics =>7ac0e06aDotNet=>ols =>1836201bEntityFrameworkCore => e70d7dae EventNotification => 3f881f18 FileSystem => 51e14a62 Hosting =>82ccf4f0HtmlAbstractions =>d687617aHttpAbstractions =>c0f93723HttpSysServer =>02331040Identity =>52dfb021JavaScriptServices =>e583a17eJsonPatch =>e453fafaKestrelHttpServer =>0c34523eLogging => e8e3e707 MetaPackages =>d63542caMvc =>2e4bc548Razor =>6c7551d9Routing =>bb413c6aSecurity =>88cb3df0SignalR =>2419867d[auto-updated: submodules]
This commit is contained in:
parent
3cc35da562
commit
cccfe3dd57
|
|
@ -16,7 +16,6 @@ StyleCop.Cache
|
|||
node_modules
|
||||
*.snk
|
||||
.nuget
|
||||
.r
|
||||
.deps
|
||||
global.json
|
||||
*.binlog
|
||||
|
|
|
|||
|
|
@ -0,0 +1,180 @@
|
|||
[submodule "modules/Antiforgery"]
|
||||
path = modules/Antiforgery
|
||||
url = https://github.com/aspnet/Antiforgery.git
|
||||
branch = dev
|
||||
[submodule "modules/AzureIntegration"]
|
||||
path = modules/AzureIntegration
|
||||
url = https://github.com/aspnet/AzureIntegration.git
|
||||
branch = dev
|
||||
[submodule "modules/BasicMiddleware"]
|
||||
path = modules/BasicMiddleware
|
||||
url = https://github.com/aspnet/BasicMiddleware.git
|
||||
branch = dev
|
||||
[submodule "modules/BrowserLink"]
|
||||
path = modules/BrowserLink
|
||||
url = https://github.com/aspnet/BrowserLink.git
|
||||
branch = dev
|
||||
[submodule "modules/Caching"]
|
||||
path = modules/Caching
|
||||
url = https://github.com/aspnet/Caching.git
|
||||
branch = dev
|
||||
[submodule "modules/Common"]
|
||||
path = modules/Common
|
||||
url = https://github.com/aspnet/Common.git
|
||||
branch = dev
|
||||
[submodule "modules/Configuration"]
|
||||
path = modules/Configuration
|
||||
url = https://github.com/aspnet/Configuration.git
|
||||
branch = dev
|
||||
[submodule "modules/CORS"]
|
||||
path = modules/CORS
|
||||
url = https://github.com/aspnet/CORS.git
|
||||
branch = dev
|
||||
[submodule "modules/DataProtection"]
|
||||
path = modules/DataProtection
|
||||
url = https://github.com/aspnet/DataProtection.git
|
||||
branch = dev
|
||||
[submodule "modules/DependencyInjection"]
|
||||
path = modules/DependencyInjection
|
||||
url = https://github.com/aspnet/DependencyInjection.git
|
||||
branch = dev
|
||||
[submodule "modules/Diagnostics"]
|
||||
path = modules/Diagnostics
|
||||
url = https://github.com/aspnet/Diagnostics.git
|
||||
branch = dev
|
||||
[submodule "modules/DotNetTools"]
|
||||
path = modules/DotNetTools
|
||||
url = https://github.com/aspnet/DotNetTools.git
|
||||
branch = dev
|
||||
[submodule "modules/EntityFrameworkCore"]
|
||||
path = modules/EntityFrameworkCore
|
||||
url = https://github.com/aspnet/EntityFrameworkCore.git
|
||||
branch = dev
|
||||
[submodule "modules/EventNotification"]
|
||||
path = modules/EventNotification
|
||||
url = https://github.com/aspnet/EventNotification.git
|
||||
branch = dev
|
||||
[submodule "modules/FileSystem"]
|
||||
path = modules/FileSystem
|
||||
url = https://github.com/aspnet/FileSystem.git
|
||||
branch = dev
|
||||
[submodule "modules/Hosting"]
|
||||
path = modules/Hosting
|
||||
url = https://github.com/aspnet/Hosting.git
|
||||
branch = dev
|
||||
[submodule "modules/HtmlAbstractions"]
|
||||
path = modules/HtmlAbstractions
|
||||
url = https://github.com/aspnet/HtmlAbstractions.git
|
||||
branch = dev
|
||||
[submodule "modules/HttpAbstractions"]
|
||||
path = modules/HttpAbstractions
|
||||
url = https://github.com/aspnet/HttpAbstractions.git
|
||||
branch = dev
|
||||
[submodule "modules/HttpClientFactory"]
|
||||
path = modules/HttpClientFactory
|
||||
url = https://github.com/aspnet/HttpClientFactory.git
|
||||
branch = dev
|
||||
[submodule "modules/HttpSysServer"]
|
||||
path = modules/HttpSysServer
|
||||
url = https://github.com/aspnet/HttpSysServer.git
|
||||
branch = dev
|
||||
[submodule "modules/Identity"]
|
||||
path = modules/Identity
|
||||
url = https://github.com/aspnet/Identity.git
|
||||
branch = dev
|
||||
[submodule "modules/IISIntegration"]
|
||||
path = modules/IISIntegration
|
||||
url = https://github.com/aspnet/IISIntegration.git
|
||||
branch = dev
|
||||
[submodule "modules/JavaScriptServices"]
|
||||
path = modules/JavaScriptServices
|
||||
url = https://github.com/aspnet/JavaScriptServices.git
|
||||
branch = dev
|
||||
[submodule "modules/JsonPatch"]
|
||||
path = modules/JsonPatch
|
||||
url = https://github.com/aspnet/JsonPatch.git
|
||||
branch = dev
|
||||
[submodule "modules/KestrelHttpServer"]
|
||||
path = modules/KestrelHttpServer
|
||||
url = https://github.com/aspnet/KestrelHttpServer.git
|
||||
branch = dev
|
||||
[submodule "modules/Localization"]
|
||||
path = modules/Localization
|
||||
url = https://github.com/aspnet/Localization.git
|
||||
branch = dev
|
||||
[submodule "modules/Logging"]
|
||||
path = modules/Logging
|
||||
url = https://github.com/aspnet/Logging.git
|
||||
branch = dev
|
||||
[submodule "modules/MetaPackages"]
|
||||
path = modules/MetaPackages
|
||||
url = https://github.com/aspnet/MetaPackages.git
|
||||
branch = dev
|
||||
[submodule "modules/Microsoft.Data.Sqlite"]
|
||||
path = modules/Microsoft.Data.Sqlite
|
||||
url = https://github.com/aspnet/Microsoft.Data.Sqlite.git
|
||||
branch = dev
|
||||
[submodule "modules/MusicStore"]
|
||||
path = modules/MusicStore
|
||||
url = https://github.com/aspnet/MusicStore.git
|
||||
branch = dev
|
||||
[submodule "modules/Mvc"]
|
||||
path = modules/Mvc
|
||||
url = https://github.com/aspnet/Mvc.git
|
||||
branch = dev
|
||||
[submodule "modules/MvcPrecompilation"]
|
||||
path = modules/MvcPrecompilation
|
||||
url = https://github.com/aspnet/MvcPrecompilation.git
|
||||
branch = dev
|
||||
[submodule "modules/Options"]
|
||||
path = modules/Options
|
||||
url = https://github.com/aspnet/Options.git
|
||||
branch = dev
|
||||
[submodule "modules/Proxy"]
|
||||
path = modules/Proxy
|
||||
url = https://github.com/aspnet/Proxy.git
|
||||
branch = dev
|
||||
[submodule "modules/Razor"]
|
||||
path = modules/Razor
|
||||
url = https://github.com/aspnet/Razor.git
|
||||
branch = dev
|
||||
[submodule "modules/ResponseCaching"]
|
||||
path = modules/ResponseCaching
|
||||
url = https://github.com/aspnet/ResponseCaching.git
|
||||
branch = dev
|
||||
[submodule "modules/Routing"]
|
||||
path = modules/Routing
|
||||
url = https://github.com/aspnet/Routing.git
|
||||
branch = dev
|
||||
[submodule "modules/Scaffolding"]
|
||||
path = modules/Scaffolding
|
||||
url = https://github.com/aspnet/Scaffolding.git
|
||||
branch = dev
|
||||
[submodule "modules/Security"]
|
||||
path = modules/Security
|
||||
url = https://github.com/aspnet/Security.git
|
||||
branch = dev
|
||||
[submodule "modules/ServerTests"]
|
||||
path = modules/ServerTests
|
||||
url = https://github.com/aspnet/ServerTests.git
|
||||
branch = dev
|
||||
[submodule "modules/Session"]
|
||||
path = modules/Session
|
||||
url = https://github.com/aspnet/Session.git
|
||||
branch = dev
|
||||
[submodule "modules/SignalR"]
|
||||
path = modules/SignalR
|
||||
url = https://github.com/aspnet/SignalR.git
|
||||
branch = dev
|
||||
[submodule "modules/StaticFiles"]
|
||||
path = modules/StaticFiles
|
||||
url = https://github.com/aspnet/StaticFiles.git
|
||||
branch = dev
|
||||
[submodule "modules/Testing"]
|
||||
path = modules/Testing
|
||||
url = https://github.com/aspnet/Testing.git
|
||||
branch = dev
|
||||
[submodule "modules/WebSockets"]
|
||||
path = modules/WebSockets
|
||||
url = https://github.com/aspnet/WebSockets.git
|
||||
branch = dev
|
||||
53
README.md
53
README.md
|
|
@ -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
|
||||
```
|
||||
git clone --recursive https://github.com/aspnet/Universe.git
|
||||
cd Universe
|
||||
./build.cmd
|
||||
```
|
||||
|
||||
The default build will clone all known repos as subfolders. The clone will be the dev branch.
|
||||
## More info
|
||||
|
||||
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 you’re 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 you’d 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.
|
||||
|
||||
|
||||
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.
|
||||
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.
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
<Project>
|
||||
<ItemDefinitionGroup>
|
||||
<Repository>
|
||||
<Branch>dev</Branch>
|
||||
<Build>true</Build>
|
||||
</Repository>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Repository Include="Antiforgery" Commit="" CloneUrl="" />
|
||||
<Repository Include="AzureIntegration" Commit="" CloneUrl="" />
|
||||
<Repository Include="BasicMiddleware" Commit="" CloneUrl="" />
|
||||
<Repository Include="BrowserLink" Commit="" CloneUrl="" />
|
||||
<Repository Include="Caching" Commit="" CloneUrl="" />
|
||||
<Repository Include="Common" Commit="" CloneUrl="" />
|
||||
<Repository Include="Configuration" Commit="" CloneUrl="" />
|
||||
<Repository Include="CORS" Commit="" CloneUrl="" />
|
||||
<Repository Include="DataProtection" Commit="" CloneUrl="" />
|
||||
<Repository Include="DependencyInjection" Commit="" CloneUrl="" />
|
||||
<Repository Include="Diagnostics" Commit="" CloneUrl="" />
|
||||
<Repository Include="DotNetTools" Commit="" CloneUrl="" />
|
||||
<Repository Include="EntityFramework" Commit="" CloneUrl="" />
|
||||
<Repository Include="EventNotification" Commit="" CloneUrl="" />
|
||||
<Repository Include="FileSystem" Commit="" CloneUrl="" />
|
||||
<Repository Include="Hosting" Commit="" CloneUrl="" />
|
||||
<Repository Include="HtmlAbstractions" Commit="" CloneUrl="" />
|
||||
<Repository Include="HttpAbstractions" Commit="" CloneUrl="" />
|
||||
<Repository Include="HttpClientFactory" Commit="" CloneUrl="" />
|
||||
<Repository Include="HttpSysServer" Commit="" CloneUrl="" />
|
||||
<Repository Include="Identity" Commit="" CloneUrl="" />
|
||||
<Repository Include="IISIntegration" Commit="" CloneUrl="" />
|
||||
<Repository Include="JavaScriptServices" Commit="" CloneUrl="" />
|
||||
<Repository Include="JsonPatch" Commit="" CloneUrl="" />
|
||||
<Repository Include="KestrelHttpServer" Commit="" CloneUrl="" />
|
||||
<Repository Include="Localization" Commit="" CloneUrl="" />
|
||||
<Repository Include="Logging" Commit="" CloneUrl="" />
|
||||
<Repository Include="MetaPackages" Commit="" CloneUrl="" />
|
||||
<Repository Include="Microsoft.Data.Sqlite" Commit="" CloneUrl="" />
|
||||
<Repository Include="MusicStore" Commit="" CloneUrl="" />
|
||||
<Repository Include="Mvc" Commit="" CloneUrl="" />
|
||||
<Repository Include="MvcPrecompilation" Commit="" CloneUrl="" />
|
||||
<Repository Include="Options" Commit="" CloneUrl="" />
|
||||
<Repository Include="Proxy" Commit="" CloneUrl="" />
|
||||
<Repository Include="Razor" Commit="" CloneUrl="" />
|
||||
<Repository Include="ResponseCaching" Commit="" CloneUrl="" />
|
||||
<Repository Include="Routing" Commit="" CloneUrl="" />
|
||||
<Repository Include="Scaffolding" Commit="" CloneUrl="" />
|
||||
<Repository Include="Security" Commit="" CloneUrl="" />
|
||||
<Repository Include="ServerTests" Commit="" CloneUrl="" />
|
||||
<Repository Include="Session" Commit="" CloneUrl="" />
|
||||
<Repository Include="SignalR" Commit="" CloneUrl="" />
|
||||
<Repository Include="StaticFiles" Commit="" CloneUrl="" />
|
||||
<Repository Include="Testing" Commit="" CloneUrl="" />
|
||||
<Repository Include="WebSockets" Commit="" CloneUrl="" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -6,8 +6,7 @@
|
|||
<Repository>%(RepositoryToBuildInOrder.Identity)</Repository>
|
||||
<AdditionalProperties>
|
||||
RepositoryToBuild=%(RepositoryToBuildInOrder.Identity);
|
||||
BuildRepositoryRoot=%(RepositoryToBuildInOrder.RepositoryPath)\;
|
||||
CommitHash=%(RepositoryToBuildInOrder.Commit)
|
||||
BuildRepositoryRoot=$([MSBuild]::NormalizeDirectory(%(RepositoryToBuildInOrder.RootPath)))
|
||||
</AdditionalProperties>
|
||||
</BatchedRepository>
|
||||
</ItemGroup>
|
||||
|
|
@ -35,7 +34,7 @@
|
|||
<RepositoryBuildArguments>$(RepositoryBuildArguments) '/p:DotNetPackageVersionPropsPath=$(GeneratedPackageVersionPropsPath)'</RepositoryBuildArguments>
|
||||
<RepositoryBuildArguments>$(RepositoryBuildArguments) '/p:CustomBeforeKoreBuildProps=$(MSBuildThisFileDirectory)repobuild\BeforeKoreBuild.props'</RepositoryBuildArguments>
|
||||
<RepositoryBuildArguments>$(RepositoryBuildArguments) '/p:CustomAfterKoreBuildTargets=$(MSBuildThisFileDirectory)repobuild\AfterKoreBuild.targets'</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>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<Project>
|
||||
<Import Project="artifacts.props" />
|
||||
<Import Project="dependencies.props" />
|
||||
<Import Project="submodules.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- This repo does not have solutions to build -->
|
||||
|
|
|
|||
|
|
@ -3,20 +3,13 @@
|
|||
<Import Project="push.targets" />
|
||||
|
||||
<PropertyGroup>
|
||||
<SubmoduleRoot>$(RepositoryRoot)modules\</SubmoduleRoot>
|
||||
<LineupBuildDir>$(ArtifactsDir)lineups\</LineupBuildDir>
|
||||
<ClearRepositoryCloneRoot Condition="'$(SkipClone)' == 'true'">false</ClearRepositoryCloneRoot>
|
||||
<_CloneRepositoryRoot>$(RepositoryRoot).r\</_CloneRepositoryRoot>
|
||||
<_DependencyBuildDirectory>$(RepositoryRoot).deps\build\</_DependencyBuildDirectory>
|
||||
<_DependencyLineupDir>$(RepositoryRoot).deps\lineups\</_DependencyLineupDir>
|
||||
<_DependencyPackagesDirectory>$(_DependencyBuildDirectory)</_DependencyPackagesDirectory>
|
||||
<_RestoreGraphSpecsDirectory>$(IntermediateDir)package-specs\</_RestoreGraphSpecsDirectory>
|
||||
|
||||
<_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:Build</_RepositoryBuildTargets>
|
||||
|
||||
|
|
@ -26,20 +19,16 @@
|
|||
<IntermediateExternalPackageDir>$(IntermediateDir)ext\</IntermediateExternalPackageDir>
|
||||
<GeneratedPackageVersionPropsPath>$(IntermediateDir)dependencies.props</GeneratedPackageVersionPropsPath>
|
||||
|
||||
<PrepareDependsOn>$(PrepareDependsOn);VerifyPackageArtifactConfig;CleanArtifacts;CleanUniverseArtifacts</PrepareDependsOn>
|
||||
<PrepareDependsOn>$(PrepareDependsOn);VerifyPackageArtifactConfig;CleanArtifacts;PrepareOutputPaths</PrepareDependsOn>
|
||||
<RestoreDependsOn>$(RestoreDependsOn);RestoreExternalDependencies</RestoreDependsOn>
|
||||
<CleanDependsOn>$(CleanDependsOn);CleanArtifacts;CleanUniverseArtifacts</CleanDependsOn>
|
||||
<CompileDependsOn>$(CompileDependsOn);CloneRepositories;BuildRepositories</CompileDependsOn>
|
||||
<CleanDependsOn>$(CleanDependsOn);CleanArtifacts</CleanDependsOn>
|
||||
<CompileDependsOn>$(CompileDependsOn);BuildRepositories</CompileDependsOn>
|
||||
<PackageDependsOn Condition="'$(TestOnly)' != 'true'">$(PackageDependsOn);CopyPackagesByCategory</PackageDependsOn>
|
||||
<VerifyDependsOn Condition="'$(TestOnly)' != 'true'">$(VerifyDependsOn);VerifyCoherentVersions</VerifyDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Import Project="$(_RepositoryListToImport)" />
|
||||
|
||||
<Target Name="CleanUniverseArtifacts">
|
||||
<RemoveDir Directories="$(_CloneRepositoryRoot)" Condition="Exists('$(_CloneRepositoryRoot)') AND '$(ClearRepositoryCloneRoot)' != 'false'" />
|
||||
<RemoveDir Directories="$(LineupBuildDir)" />
|
||||
<MakeDir Directories="$(LineupBuildDir)" />
|
||||
<Target Name="PrepareOutputPaths">
|
||||
<MakeDir Directories="$(ArtifactsDir);$(BuildDir);$(LineupBuildDir)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestoreExternalDependencies">
|
||||
|
|
@ -49,21 +38,24 @@
|
|||
</Target>
|
||||
|
||||
<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))" />
|
||||
|
||||
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
||||
Targets="GetArtifactInfo"
|
||||
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(Repository.Identity)\;KoreBuildRestoreTargetsImported=true;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
||||
Properties="RepositoryRoot=%(Repository.RootPath);KoreBuildRestoreTargetsImported=true;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
||||
ContinueOnError="WarnAndContinue">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="ArtifactInfo" />
|
||||
</MSBuild>
|
||||
|
||||
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
||||
Targets="ResolveSolutions"
|
||||
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(Repository.Identity)\;KoreBuildRestoreTargetsImported=true;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
||||
Properties="RepositoryRoot=%(Repository.RootPath);KoreBuildRestoreTargetsImported=true;Configuration=$(Configuration);BuildNumber=$(BuildNumber)"
|
||||
ContinueOnError="WarnAndContinue">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="Solution" />
|
||||
</MSBuild>
|
||||
|
||||
<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="GenerateLineup" DependsOnTargets="ResolveRepoInfo">
|
||||
|
|
@ -113,104 +105,24 @@
|
|||
<Error Text="KOREBUILD_REPOSITORY_EXCLUDE AND KOREBUILD_REPOSITORY_INCLUDE are specified."
|
||||
Condition="'$(KOREBUILD_REPOSITORY_INCLUDE)' != '' AND '$(KOREBUILD_REPOSITORY_EXCLUDE)' != ''" />
|
||||
|
||||
<!--
|
||||
Determine the protocol to clone individual repositories over. Clone repositories over https,
|
||||
if Universe was cloned over https
|
||||
-->
|
||||
<Exec
|
||||
Command="git config --get remote.origin.url"
|
||||
ConsoleToMSBuild="true"
|
||||
WorkingDirectory="$(RepositoryRoot)"
|
||||
IgnoreStandardErrorWarningFormat="true"
|
||||
StandardOutputImportance="low"
|
||||
IgnoreExitCode="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="UniverseCloneUrl" />
|
||||
</Exec>
|
||||
|
||||
<PropertyGroup>
|
||||
<_CloneOverHttps>true</_CloneOverHttps>
|
||||
<_CloneOverHttps Condition="'$(UniverseCloneUrl)' != '' AND !$(UniverseCloneUrl.StartsWith('https'))">false</_CloneOverHttps>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Repository Update="%(Identity)" RepositoryPath="$(_CloneRepositoryRoot)%(Identity)" />
|
||||
<Repository Update="%(Identity)" CloneUrl="git@github.com:aspnet/%(Identity)" Condition="'$(_CloneOverHttps)'!='true'" />
|
||||
<Repository Update="%(Identity)" CloneUrl="https://github.com/aspnet/%(Identity)" Condition="'$(_CloneOverHttps)'=='true'" />
|
||||
<Repository Update="%(Identity)" RootPath="$(SubmoduleRoot)%(Identity)\" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="CloneRepositories" DependsOnTargets="_PrepareRepositories" Condition="'$(SkipClone)' != 'true'">
|
||||
<ItemGroup>
|
||||
<_CloneRepository Include="$(MSBuildProjectFullPath)">
|
||||
<AdditionalProperties>
|
||||
CloneRepository=%(Repository.Identity);
|
||||
CloneUrl=%(Repository.CloneUrl);
|
||||
CloneBranch=%(Repository.Branch);
|
||||
CloneRepositoryCommit=%(Repository.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)"
|
||||
EnvironmentVariables="GIT_TERMINAL_PROMPT=0"
|
||||
IgnoreStandardErrorWarningFormat="true"
|
||||
Timeout="180000" />
|
||||
|
||||
<Message Text="Resetting $(CloneRepository) commit to $(CloneRepositoryCommit) ..." Importance="High" Condition="'$(CloneRepositoryCommit)'!=''"/>
|
||||
<Exec
|
||||
Command="git reset --quiet --hard $(CloneRepositoryCommit)"
|
||||
WorkingDirectory="$(_CloneRepositoryRoot)$(CloneRepository)"
|
||||
IgnoreStandardErrorWarningFormat="true"
|
||||
Condition="'$(CloneRepositoryCommit)'!=''" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildRepositories"
|
||||
DependsOnTargets="_PrepareRepositories;_CreateRepositoriesListWithCommits;_UpdateNuGetConfig;_GenerateBuildGraph;_BuildRepositories" />
|
||||
DependsOnTargets="_PrepareRepositories;_UpdateNuGetConfig;_GenerateBuildGraph;_BuildRepositories" />
|
||||
|
||||
<Target Name="_PrepareRestoreGraphSpecs" DependsOnTargets="_PrepareRepositories">
|
||||
<MSBuild Projects="$(MSBuildProjectFullPath)"
|
||||
Targets="ResolveSolutions"
|
||||
Properties="RepositoryRoot=$(_CloneRepositoryRoot)%(Repository.Identity)\"
|
||||
Properties="RepositoryRoot=%(Repository.RootPath)"
|
||||
ContinueOnError="WarnAndContinue"
|
||||
Condition="%(Repository.Build)">
|
||||
<Output TaskParameter="TargetOutputs" ItemName="Solution" />
|
||||
</MSBuild>
|
||||
|
||||
<Error Text="No solutions were found in '$(_CloneRepositoryRoot)'" Condition="@(Solution->Count()) == 0" />
|
||||
<Error Text="No solutions were found. Did you remember to checkout the git submodules? Run `git submodules update`." Condition="@(Solution->Count()) == 0" />
|
||||
|
||||
<ItemGroup>
|
||||
<Solution>
|
||||
|
|
@ -219,8 +131,8 @@
|
|||
|
||||
<GraphSpecInputs Include="
|
||||
@(Solution);
|
||||
$(_CloneRepositoryRoot)**\*.csproj;
|
||||
$(_CloneRepositoryRoot)**\dependencies.props" />
|
||||
$(SubmoduleRoot)**\*.csproj;
|
||||
$(SubmoduleRoot)**\dependencies.props" />
|
||||
<GraphSpecOutputs Include="$(_RestoreGraphSpecsDirectory)%(Solution.Repository)\%(Solution.FileName)%(Solution.Extension).json" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
|
@ -246,7 +158,7 @@
|
|||
|
||||
<Target Name="_UpdateNuGetConfig">
|
||||
<UpdatePackageSource
|
||||
NuGetConfigPath="$(_CloneRepositoryRoot)%(Repository.Identity)\NuGet.config"
|
||||
NuGetConfigPath="%(Repository.RootPath)NuGet.config"
|
||||
SourceName="Dependencies"
|
||||
SourceUri="$(_DependencyPackagesDirectory)"
|
||||
Condition="Exists('$(_DependencyPackagesDirectory)') AND %(Repository.Build)" />
|
||||
|
|
@ -254,7 +166,7 @@
|
|||
<MakeDir Directories="$(BuildDir)" Condition="!Exists('$(BuildDir)')" />
|
||||
|
||||
<UpdatePackageSource
|
||||
NuGetConfigPath="$(_CloneRepositoryRoot)%(Repository.Identity)\NuGet.config"
|
||||
NuGetConfigPath="%(Repository.RootPath)NuGet.config"
|
||||
SourceName="Artifacts"
|
||||
Condition="%(Repository.Build)"
|
||||
SourceUri="$(BuildDir)" />
|
||||
|
|
@ -289,57 +201,4 @@
|
|||
ExternalDependencies="@(ExternalDependency)" />
|
||||
</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_$(_RepositoryName)"))</_CloneUrl>
|
||||
<_CommitHash>$([System.Environment]::GetEnvironmentVariable("BUILD_VCS_NUMBER_$(_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>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
<Project>
|
||||
<ItemDefinitionGroup>
|
||||
<Repository>
|
||||
<Build>true</Build>
|
||||
</Repository>
|
||||
</ItemDefinitionGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Repository Include="Antiforgery" />
|
||||
<Repository Include="AzureIntegration" />
|
||||
<Repository Include="BasicMiddleware" />
|
||||
<Repository Include="BrowserLink" />
|
||||
<Repository Include="Caching" />
|
||||
<Repository Include="Common" />
|
||||
<Repository Include="Configuration" />
|
||||
<Repository Include="CORS" />
|
||||
<Repository Include="DataProtection" />
|
||||
<Repository Include="DependencyInjection" />
|
||||
<Repository Include="Diagnostics" />
|
||||
<Repository Include="DotNetTools" />
|
||||
<Repository Include="EntityFrameworkCore" />
|
||||
<Repository Include="EventNotification" />
|
||||
<Repository Include="FileSystem" />
|
||||
<Repository Include="Hosting" />
|
||||
<Repository Include="HtmlAbstractions" />
|
||||
<Repository Include="HttpAbstractions" />
|
||||
<Repository Include="HttpClientFactory" />
|
||||
<Repository Include="HttpSysServer" />
|
||||
<Repository Include="Identity" />
|
||||
<Repository Include="IISIntegration" />
|
||||
<Repository Include="JavaScriptServices" />
|
||||
<Repository Include="JsonPatch" />
|
||||
<Repository Include="KestrelHttpServer" />
|
||||
<Repository Include="Localization" />
|
||||
<Repository Include="Logging" />
|
||||
<Repository Include="MetaPackages" />
|
||||
<Repository Include="Microsoft.Data.Sqlite" />
|
||||
<Repository Include="MusicStore" />
|
||||
<Repository Include="Mvc" />
|
||||
<Repository Include="MvcPrecompilation" />
|
||||
<Repository Include="Options" />
|
||||
<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="SignalR" />
|
||||
<Repository Include="StaticFiles" />
|
||||
<Repository Include="Testing" />
|
||||
<Repository Include="WebSockets" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -35,7 +35,7 @@ namespace RepoTools.BuildGraph
|
|||
Parallel.For(0, repositoryPaths.Count, new ParallelOptions { MaxDegreeOfParallelism = 6 }, i =>
|
||||
{
|
||||
var repositoryPath = repositoryPaths[i];
|
||||
var repositoryName = Path.GetFileName(repositoryPath);
|
||||
var repositoryName = Path.GetFileName(repositoryPath.TrimEnd(new [] { '\\', '/' }));
|
||||
var repository = Read(provider, repositoryName, repositoryPath);
|
||||
repositories[i] = repository;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ namespace RepoTasks
|
|||
{
|
||||
var graphSpecProvider = new DependencyGraphSpecProvider(PackageSpecsDirectory.Trim());
|
||||
|
||||
var repositoryPaths = Repositories.Select(r => r.GetMetadata("RepositoryPath")).ToList();
|
||||
var repositoryPaths = Repositories.Select(r => r.GetMetadata("RootPath")).ToList();
|
||||
var repositories = Repository.ReadAllRepositories(repositoryPaths, graphSpecProvider);
|
||||
|
||||
var graph = GraphBuilder.Generate(repositories, StartGraphAt, Log);
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e1884586775c85e27f1b5f2dcad80ba1d84b2f21
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit c998d74e1de26897dddaf3c2df7165341a4c0dbd
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 9f3ed006a12fdaddf2f5134cdc647433a0548946
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 7e2ff85a7622e20d697ed64936f8e4affb0865f7
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 8fd36866f9427b8a09cecdd6520ba54b064424c6
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit c6a9cbbe4566d1d757b27d74a1aad5da8d12aed1
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 062ad3e7ca8fb86a471333864b6202926ea20aa5
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 94a5f9e3d122cf1b01c3621130f70739efec1fb2
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 49b2e22ab30239ed63d3f3b9478e7563e9a93ed9
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 88297e3c1116f952aa22013172ef2f9396f716e0
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 7ac0e06abf822738437dba3bfc5b3b01325045f7
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 1836201beecf81c3e2b4a50cc1666f5aa51f5786
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e70d7daef78b7ef76f989277c0b63bc6a666acf6
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 3f881f18d811b65046c1df798d4d97c98aa39086
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 51e14a624c5f32bd2df62adf06dbe558574b4b11
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 82ccf4f06e749d2044f3adb88e870b431341274f
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit d687617a356b9a875ea5b09163ef9d443b4256bb
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit c0f937239a0a099b73c67c96ab9e1c875952f67f
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 8a643346089ce2356ac4bcc07f217f256004a00d
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 02331040a127954eadaa859777379af77f419183
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 94c895a1bd1b9bba48ce496200fd386322fb6a74
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 52dfb0217597ae18efd5958e380fe8e56cde3163
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e583a17ef8381a15ae9f59635dae7e0cfbdd2aac
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e453fafad52649daff689c24fa2374a143f43654
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0c34523e8b36be0236106aa174ede6aab9acce85
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 98484b828334f3914c3c2f723b4c98c7acb8f627
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e8e3e707f5131e22d7d27fce6bfcefdda1dbb817
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit d63542ca31614cff8a69c788d6fb1ebc8b0870f9
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 791993269cfbf97ec3fbdb5139d860ba61ef7396
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 1c0aeb08bb1ebd846726232226279bbe001782e1
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 2e4bc548f5921d2f4250314373473e453f3ca95b
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 00dd638c4ff35f53198ead9de7ccd40c26ec13c9
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 7e46634d3fc19df60edadc00386034ccde8f54c9
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 0d1e2319472707ceaae2dab5a044764f7686b28e
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 6c7551d9c7fc7a9e60d29ae6a39d46924960e6e6
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 85bd16418984058a4292f8071118d2794b8d8e07
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit bb413c6ac33fbc5bd5459033cb29afb3b002cdf2
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit d8f8670c7b9fe467f9b20456549b19bee26f0e7d
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 88cb3df0ebdd524a8c56e74b740296941947fdff
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit f1e0205b9fedb29f0ea4901caf41acda56bdc597
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit a29e7cf687fef67e403f9909632e61fce4a7dbaa
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 2419867dfcda3b11a83a30de6559f1c44b3da38c
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 5248d6057c759e5944eb3d0a9088457081abb090
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 94569378d4e4fafa054560bfdc5a86b20d41553b
|
||||
|
|
@ -0,0 +1 @@
|
|||
Subproject commit f17facd32960ff7e0a64eac863cf444b98ea16d9
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env powershell
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env powershell
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
|
@ -38,7 +38,7 @@ try {
|
|||
Invoke-Block { & git submodule update --init }
|
||||
|
||||
$update_errors = @()
|
||||
$submodules = Get-Submodules $ModuleDirectory
|
||||
$submodules = Get-Submodules $RepoRoot
|
||||
$updated_submodules = @()
|
||||
foreach($submodule in $submodules)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env powershell
|
||||
#!/usr/bin/env pwsh
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
|
@ -36,65 +36,71 @@ function Get-GitChanges([string]$Path) {
|
|||
return $LastExitCode -ne 0
|
||||
}
|
||||
|
||||
Push-Location $RepoRoot | Out-Null
|
||||
try {
|
||||
Assert-Git
|
||||
|
||||
Write-Host "Checking that submodules are in a clean state first..."
|
||||
if (Get-GitChanges $ModuleDirectory) {
|
||||
Write-Error "$RepoRoot/modules is in an unclean state. Reset submodules first by running ``git submodule update``"
|
||||
exit 1
|
||||
}
|
||||
|
||||
$submodules = Get-Submodules $ModuleDirectory
|
||||
$submodules = Get-Submodules $RepoRoot -Verbose:$VerbosePreference
|
||||
|
||||
$changes = $submodules `
|
||||
| % {
|
||||
Push-Location $_.path
|
||||
try {
|
||||
$vcs_name = "BUILD_VCS_NUMBER_" + $_.module
|
||||
$newCommit = [environment]::GetEnvironmentVariable($vcs_name)
|
||||
foreach ($submodule in $submodules) {
|
||||
$submodulePath = $submodule.path
|
||||
Write-Host "Updating $submodulePath"
|
||||
|
||||
if($newCommit -eq $null)
|
||||
{
|
||||
Write-Warning "TeamCity env variable '$vcs_name' not found."
|
||||
Write-Warning "git submodule update --remote"
|
||||
Invoke-Block { & git submodule update --remote }
|
||||
$vcs_name = "BUILD_VCS_NUMBER_" + $submodule.module
|
||||
$newCommit = [environment]::GetEnvironmentVariable($vcs_name)
|
||||
|
||||
if (-not $newCommit) {
|
||||
Write-Warning "TeamCity env variable '$vcs_name' not found. Pulling the latest submodule branch instead"
|
||||
Invoke-Block { & git submodule update --remote $submodulePath }
|
||||
Push-Location $submodulePath | Out-Null
|
||||
try {
|
||||
$newCommit = $(git rev-parse HEAD)
|
||||
}
|
||||
else
|
||||
{
|
||||
finally {
|
||||
Pop-Location | Out-Null
|
||||
}
|
||||
}
|
||||
else {
|
||||
Push-Location $submodulePath | Out-Null
|
||||
try {
|
||||
Invoke-Block { & git checkout $newCommit }
|
||||
}
|
||||
|
||||
$_.newCommit = $newCommit
|
||||
if ($newCommit -ne $_.commit) {
|
||||
$_.changed = $true
|
||||
Write-Verbose "$($_.module) updated to $($_.newCommit)"
|
||||
finally {
|
||||
Pop-Location | Out-Null
|
||||
}
|
||||
else {
|
||||
Write-Verbose "$($_.module) did not change"
|
||||
}
|
||||
return $_
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
}
|
||||
} `
|
||||
| ? { $_.changed } `
|
||||
| % { "$($_.module) to $($_.newCommit.Substring(0, 8))" }
|
||||
|
||||
$submodules `
|
||||
$submodule.newCommit = $newCommit
|
||||
if ($newCommit -ne $submodule.commit) {
|
||||
$submodule.changed = $true
|
||||
Write-Host -ForegroundColor Cyan "`t=> $($submodule.module) updated to $($submodule.newCommit)"
|
||||
}
|
||||
else {
|
||||
Write-Host -ForegroundColor Magenta "`t$($submodule.module) did not change"
|
||||
}
|
||||
}
|
||||
|
||||
$changes = $submodules `
|
||||
| ? { $_.changed } `
|
||||
| % {
|
||||
Invoke-Block { & git add $_.path }
|
||||
"$($_.module) => $($_.newCommit)"
|
||||
}
|
||||
|
||||
if ($changes) {
|
||||
$shortMessage = "Updating submodule(s) $( $changes -join ' ,' )"
|
||||
$shortMessage = "Updating submodule(s) `n`n$( $changes -join "`n" )"
|
||||
# add this to the commit message to make it possible to filter commit triggers based on message
|
||||
$message = "$shortMessage`n`n[auto-updated: submodules]"
|
||||
if (-not $NoCommit -and ($Force -or ($PSCmdlet.ShouldContinue($shortMessage, 'Create a new commit with these changes?')))) {
|
||||
Invoke-Block { & git commit -m $message @GitCommitArgs }
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
# If composing this script with others, return the message that would have been used
|
||||
return @{
|
||||
message = $message
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ function Assert-Git {
|
|||
}
|
||||
|
||||
function Invoke-Block([scriptblock]$cmd) {
|
||||
$cmd | Out-String | Write-Verbose
|
||||
& $cmd
|
||||
|
||||
# Need to check both of these cases for errors as they represent different items
|
||||
|
|
@ -16,15 +17,20 @@ function Invoke-Block([scriptblock]$cmd) {
|
|||
}
|
||||
}
|
||||
|
||||
function Get-Submodules([string]$ModuleDirectory)
|
||||
{
|
||||
Invoke-Block { & git submodule update --init }
|
||||
function Get-Submodules {
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$RepoRoot
|
||||
)
|
||||
|
||||
$gitModules = Join-Path $RepoRoot ".gitmodules"
|
||||
Invoke-Block { & git submodule update --init } | Out-Null
|
||||
|
||||
$moduleConfigFile = Join-Path $RepoRoot ".gitmodules"
|
||||
$submodules = @()
|
||||
|
||||
Get-ChildItem "$ModuleDirectory/*" -Directory | % {
|
||||
Push-Location $_
|
||||
Get-ChildItem "$RepoRoot/modules/*" -Directory | % {
|
||||
Push-Location $_ | Out-Null
|
||||
Write-Verbose "Attempting to get submodule info for $_"
|
||||
try {
|
||||
$data = @{
|
||||
path = $_
|
||||
|
|
@ -32,13 +38,13 @@ function Get-Submodules([string]$ModuleDirectory)
|
|||
commit = $(git rev-parse HEAD)
|
||||
newCommit = $null
|
||||
changed = $false
|
||||
branch = $(git config -f $gitModules --get submodule.modules/$($_.Name).branch )
|
||||
branch = $(git config -f $moduleConfigFile --get submodule.modules/$($_.Name).branch )
|
||||
}
|
||||
|
||||
$submodules += $data
|
||||
}
|
||||
finally {
|
||||
Pop-Location
|
||||
Pop-Location | Out-Null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue