diff --git a/eng/Build.props b/eng/Build.props index ff9b72504..7e501b9fc 100644 --- a/eng/Build.props +++ b/eng/Build.props @@ -3,7 +3,6 @@ - diff --git a/eng/Versions.props b/eng/Versions.props index cc5b6f750..41f5f60b3 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -204,6 +204,12 @@ 8.0.0-alpha.1.22620.1 $(MicrosoftNETWorkloadEmscriptennet7Manifest80100Version) + + + + 15.7.179 + 15.7.179 + 2.0.1-servicing-26011-01 diff --git a/src/VirtualMonoRepo/InitializeVMR.proj b/src/VirtualMonoRepo/InitializeVMR.proj index fb5070017..b534c897a 100644 --- a/src/VirtualMonoRepo/InitializeVMR.proj +++ b/src/VirtualMonoRepo/InitializeVMR.proj @@ -13,8 +13,6 @@ true - - $(TarballGitInfoDir) @@ -30,9 +28,7 @@ Instead of cloning the repositories, we pull the sources via the `darc vmr initialize` command. Most of the targets are reused from the tarball generation process (SourceBuildArcadeTarball.targets). --> - @@ -50,26 +46,24 @@ - + + + + + $([System.IO.Path]::GetFileName("$(RepoRoot.TrimEnd('/').TrimEnd('\\'))")) @(RootRepoCommitSha) - - - - - - + - diff --git a/src/VirtualMonoRepo/Tasks/GitFileManagerFactory.cs b/src/VirtualMonoRepo/Tasks/GitFileManagerFactory.cs new file mode 100644 index 000000000..2da3d540b --- /dev/null +++ b/src/VirtualMonoRepo/Tasks/GitFileManagerFactory.cs @@ -0,0 +1,52 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using Microsoft.DotNet.DarcLib; +using Microsoft.DotNet.DarcLib.Helpers; +using Microsoft.DotNet.DarcLib.VirtualMonoRepo; +using Microsoft.Extensions.Logging; + +namespace Microsoft.DotNet.VirtualMonoRepo.Tasks; + +public class GitFileManagerFactory : IGitFileManagerFactory +{ + private readonly IVmrInfo _vmrInfo; + private readonly VmrRemoteConfiguration _remoteConfiguration; + private readonly IProcessManager _processManager; + private readonly IVersionDetailsParser _versionDetailsParser; + private readonly ILoggerFactory _loggerFactory; + + public GitFileManagerFactory( + IVmrInfo vmrInfo, + VmrRemoteConfiguration remoteConfiguration, + IProcessManager processManager, + IVersionDetailsParser versionDetailsParser, + ILoggerFactory loggerFactory) + { + _vmrInfo = vmrInfo; + _remoteConfiguration = remoteConfiguration; + _processManager = processManager; + _versionDetailsParser = versionDetailsParser; + _loggerFactory = loggerFactory; + } + + public IGitFileManager Create(string repoUri) + => new GitFileManager(CreateGitRepo(repoUri), _versionDetailsParser, _loggerFactory.CreateLogger()); + + private IGitRepo CreateGitRepo(string repoUri) => GitRepoTypeParser.ParseFromUri(repoUri) switch + { + GitRepoType.AzureDevOps => throw new Exception("VMR initialization should not require Azure DevOps repositories"), + + GitRepoType.GitHub => new GitHubClient( + _processManager.GitExecutable, + _remoteConfiguration.GitHubToken, + _loggerFactory.CreateLogger(), + _vmrInfo.TmpPath, + // Caching not in use for Darc local client. + null), + + GitRepoType.Local => new LocalGitClient(_processManager.GitExecutable, _loggerFactory.CreateLogger()), + _ => throw new ArgumentException("Unknown git repository type", nameof(repoUri)), + }; +} diff --git a/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs b/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs index 6390e4b56..307ee8ecc 100644 --- a/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs +++ b/src/VirtualMonoRepo/Tasks/VirtualMonoRepo_Initialize.cs @@ -7,8 +7,6 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; using Microsoft.Build.Framework; -using Microsoft.DotNet.DarcLib; -using Microsoft.DotNet.DarcLib.Helpers; using Microsoft.DotNet.DarcLib.VirtualMonoRepo; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; @@ -61,6 +59,7 @@ public class VirtualMonoRepo_Initialize : Build.Utilities.Task, ICancelableTask private IServiceProvider CreateServiceProvider() => new ServiceCollection() .AddLogging(b => b.AddConsole().AddFilter(l => l >= LogLevel.Information)) - .AddVmrManagers("git", VmrPath, TmpPath, null, null) + .AddTransient() + .AddVmrManagers(sp => sp.GetRequiredService(), "git", VmrPath, TmpPath, null, null) .BuildServiceProvider(); } diff --git a/src/VirtualMonoRepo/source-mappings.json b/src/VirtualMonoRepo/source-mappings.json index 0f2620a51..95e8f949c 100644 --- a/src/VirtualMonoRepo/source-mappings.json +++ b/src/VirtualMonoRepo/source-mappings.json @@ -105,8 +105,8 @@ "defaultRef": "dev" }, { - "name": "razor-compiler", - "defaultRemote": "https://github.com/dotnet/razor-compiler" + "name": "razor", + "defaultRemote": "https://github.com/dotnet/razor" }, { "name": "roslyn",