Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
fb5beeb
Add source-mappings.json with a defaults section
premun Aug 9, 2022
3e040ce
Add empty InitializeVMR targets, VMR tasks
premun Aug 12, 2022
f1bd6fb
Copy initial VMR content and commit it
premun Aug 12, 2022
bda9a9d
Add steps to generate installer.props
premun Aug 12, 2022
6da9799
Add a target for recursive repo initialization
premun Aug 12, 2022
61bae2d
Build SourceBuild tasks too
premun Aug 12, 2022
6be1810
Implement the "initialize VMR" task
premun Aug 12, 2022
356c022
Add console logging
premun Aug 12, 2022
f4e99fd
Use newest DarcLib
premun Aug 15, 2022
2ac3f67
Make the task cancellable
premun Aug 15, 2022
fad42c7
Set InitializeVMR to true always, improve dependency print, remove pa…
premun Aug 17, 2022
e72fa32
Improve logging in SB task
premun Aug 17, 2022
122434a
Do not log dependencies when there are none
premun Aug 17, 2022
7bfbbea
Merge remote-tracking branch 'origin/main' into vmr
premun Aug 17, 2022
d730b59
Add rest of the missing tarball steps
premun Aug 18, 2022
61da10a
Add a TODO issue link
premun Aug 18, 2022
f2109ad
Use WorkingDirectory instead of -C
premun Aug 18, 2022
f37f3ef
Make VmrDir a required parameter
premun Aug 18, 2022
51e53d0
Do not use Tarball properties
premun Aug 18, 2022
71a2283
Move tasks under Tasks/
premun Aug 18, 2022
6ff48ea
Use .NET 7.0 TFM
premun Aug 18, 2022
0d78123
Remove obsolete exclusions
premun Aug 18, 2022
e73d666
Move RemoteFactory to Tasks/
premun Aug 18, 2022
3557371
Extract Microsoft.DotNet.DarcLib version into Version.props
premun Aug 19, 2022
623eacf
Bump SB tasks to net7.0
premun Aug 19, 2022
4c3c2c1
Fix XML tag
premun Aug 19, 2022
566403a
Update net7.0 task references
premun Aug 19, 2022
c100611
Simplify .csproj
premun Aug 19, 2022
f555b3c
Address PR feedback
premun Aug 22, 2022
585cdd4
Add the DarcLib dependency into Version.Details
premun Aug 22, 2022
557cb47
Merge remote-tracking branch 'origin/main' into vmr
premun Aug 22, 2022
ef1063a
Run `darc update-dependencies`
premun Aug 22, 2022
7054873
Add subscription for `Microsoft.Extensions.Logging.Console`
premun Aug 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 28 additions & 10 deletions eng/Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
<Project>
<ItemGroup Condition=" '$(ArcadeBuildTarball)' != 'true' ">
<ProjectToBuild Include="$(RepoRoot)Microsoft.DotNet.Cli.sln" />
<ProjectToBuild Condition="'$(OS)' == 'Windows_NT' And ('$(Architecture)' == 'x86' Or '$(Architecture)' == 'x64' Or '$(Architecture)' == 'arm64')"
Include="$(RepoRoot)eng\version.csproj;
$(RepoRoot)eng\native.proj" />
</ItemGroup>
<ItemGroup Condition=" '$(ArcadeBuildTarball)' == 'true' " >
<ProjectToBuild Include="$(RepoRoot)src/SourceBuild/Arcade/src/SourceBuild.Tasks.csproj" BuildInParallel="false" />
<ProjectToBuild Include="$(RepoRoot)src/SourceBuild/tarball/BuildSourceBuildTarball.proj" BuildInParallel="false" />
</ItemGroup>
<Choose>
<When Condition=" '$(ArcadeBuildTarball)' == 'true' ">
<!-- Source build / tarball generation -->
<ItemGroup>
<ProjectToBuild Include="$(RepoRoot)src/SourceBuild/Arcade/src/SourceBuild.Tasks.csproj" BuildInParallel="false" />
<ProjectToBuild Include="$(RepoRoot)src/SourceBuild/tarball/BuildSourceBuildTarball.proj" BuildInParallel="false" />
</ItemGroup>
</When>

<When Condition=" '$(InitializeVMR)' == 'true' ">
<!-- VMR bootstrap -->
<ItemGroup>
<ProjectToBuild Include="$(RepoRoot)src/SourceBuild/Arcade/src/SourceBuild.Tasks.csproj" BuildInParallel="false" />
<ProjectToBuild Include="$(RepoRoot)src/VirtualMonoRepo/Tasks/VirtualMonoRepo.Tasks.csproj" BuildInParallel="false" />
<ProjectToBuild Include="$(RepoRoot)src/VirtualMonoRepo/InitializeVMR.proj" BuildInParallel="false" />
</ItemGroup>
</When>

<Otherwise>
<!-- Regular build -->
<ItemGroup>
<ProjectToBuild Include="$(RepoRoot)Microsoft.DotNet.Cli.sln" />
<ProjectToBuild Condition="'$(OS)' == 'Windows_NT' And ('$(Architecture)' == 'x86' Or '$(Architecture)' == 'x64' Or '$(Architecture)' == 'arm64')"
Include="$(RepoRoot)eng\version.csproj;
$(RepoRoot)eng\native.proj" />
</ItemGroup>
</Otherwise>
</Choose>
</Project>
8 changes: 8 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,14 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>34dff939b4a91e4693f78a856e0e055c1a3f3fba</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.DarcLib" Version="1.1.0-beta.22422.1">
<Uri>https://github.com/dotnet/arcade-services</Uri>
<Sha>a27d5e56acf479b4a0944a0cf4511acb22d4a75b</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Console" Version="7.0.0-preview.7.22375.6">
<Uri>https://github.com/dotnet/runtime</Uri>
<Sha>eecb02807867cad56cd05badddef65e432248b75</Sha>
</Dependency>
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="7.0.0-alpha.1.22416.1">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>c1bc837421e41a673cb30bf670c0cdd83ac09b75</Sha>
Expand Down
5 changes: 5 additions & 0 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<!-- Dependency from https://github.com/dotnet/arcade -->
<MicrosoftDotNetBuildTasksInstallersPackageVersion>7.0.0-beta.22419.1</MicrosoftDotNetBuildTasksInstallersPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependency from https://github.com/dotnet/arcade-services -->
<MicrosoftDotNetDarcLibVersion>1.1.0-beta.22422.1</MicrosoftDotNetDarcLibVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependency from https://github.com/dotnet/winforms -->
<MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>7.0.0-rc.1.22377.2</MicrosoftDotnetWinFormsProjectTemplatesPackageVersion>
Expand Down Expand Up @@ -171,6 +175,7 @@
<VersionToolsVersion>2.2.0-beta.19072.10</VersionToolsVersion>
<DotnetDebToolVersion>2.0.0</DotnetDebToolVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220813-01</MicrosoftNETTestSdkVersion>
<MicrosoftExtensionsLoggingConsoleVersion>7.0.0-preview.7.22375.6</MicrosoftExtensionsLoggingConsoleVersion>
</PropertyGroup>
<!-- dependencies for source-build tarball -->
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/SourceBuild/Arcade/src/SourceBuild.Tasks.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<RunAnalyzers>false</RunAnalyzers>
<Nullable>disable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion src/SourceBuild/Arcade/tools/BuildTasks.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<PropertyGroup>
<SourceBuildTasksAssembly>$(RepoRoot)\artifacts\bin\SourceBuild.Tasks\$(Configuration)\net5.0\SourceBuild.Tasks.dll</SourceBuildTasksAssembly>
<SourceBuildTasksAssembly>$(RepoRoot)\artifacts\bin\SourceBuild.Tasks\$(Configuration)\net7.0\SourceBuild.Tasks.dll</SourceBuildTasksAssembly>
</PropertyGroup>
</Project>
11 changes: 5 additions & 6 deletions src/SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<PropertyGroup>
<ArtifactsDir>$(RepoRoot)artifacts/</ArtifactsDir>
<TarballDir>$(ArtifactsDir)tarball/</TarballDir>
<TarballDir Condition=" '$(TarballDir)' == '' ">$(ArtifactsDir)tarball/</TarballDir>
<TarballRootDir>$([MSBuild]::EnsureTrailingSlash('$(TarballDir)'))</TarballRootDir>
<TarballSourceDir>$(TarballRootDir)src/</TarballSourceDir>
<TarballGitInfoDir>$(TarballRootDir)git-info/</TarballGitInfoDir>
Expand Down Expand Up @@ -234,8 +234,8 @@
SourceBuildMetadataDir="$(TarballGitInfoDir)"
Dependencies="@(SourceBuildRepos)" />

<Message Text="--> Dependencies for $(TarballVersionDetailsFile):" Importance="High" />
<Message Text="--> [@(SourceBuildRepos)]" Importance="High" />
<Message Text="--> Dependencies for $(TarballVersionDetailsFile):" Importance="High" Condition=" '@(SourceBuildRepos)' != '' " />
<Message Text="--> %(SourceBuildRepos.SourceBuildRepoName) / %(SourceBuildRepos.Sha)" Importance="High" Condition=" '@(SourceBuildRepos)' != '' " />
Comment thread
oleksandr-didyk marked this conversation as resolved.
<MSBuild Projects="$(MSBuildProjectFile)"
Condition=" '@(SourceBuildRepos)' != '' "
Targets="CloneRepoAndDependentsRecursive"
Expand Down Expand Up @@ -285,7 +285,7 @@

<Message Text="Restoring text only packages..." Importance="High" />

<MSBuild Projects="../Arcade/tools/TextOnlyPackages.csproj"
<MSBuild Projects="$(RepoRoot)src/SourceBuild/Arcade/tools/TextOnlyPackages.csproj"
Properties="TargetPackagesPath=$(TextOnlyPackageRestoreDir)"
Targets="Restore" />
</Target>
Expand All @@ -296,7 +296,7 @@
<EngCommonContent Include="$(RepoRoot)eng/common/**/*" />
</ItemGroup>

<Copy
<Copy Condition=" '$(InitializeVMR)' != 'true' "
SourceFiles="$(TarballGitInfoDir)runtime.props"
DestinationFiles="$(TarballGitInfoDir)runtime-portable.props" />

Expand Down Expand Up @@ -428,4 +428,3 @@
</Target>

</Project>

140 changes: 140 additions & 0 deletions src/SourceBuild/tarball/content/src/source-mappings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
{
"defaults": {
"defaultRef": "main",
"exclude": [
"**/*.dll",
"**/*.Dll",
"**/*.exe",
"**/*.pdb",
"**/*.mdb",
"**/*.zip",
"**/*.nupkg"
]
},
"mappings": [
{
"name": "arcade",
Comment thread
premun marked this conversation as resolved.
"defaultRemote": "https://github.com/dotnet/arcade",
"include": [
"*.*",
".*",
"eng/**/*",
"src/**/*",
"scripts/**/*"
],
"exclude": [
"**/tests/**/*",
"**/*.Tests/**/*"
]
},
{
"name": "aspnetcore",
"defaultRemote": "https://github.com/dotnet/aspnetcore"
Comment thread
premun marked this conversation as resolved.
},
{
"name": "clicommandlineparser",
"defaultRemote": "https://github.com/dotnet/clicommandlineparser"
},
{
"name": "command-line-api",
"defaultRemote": "https://github.com/dotnet/command-line-api"
},
{
"name": "deployment-tools",
"defaultRemote": "https://github.com/dotnet/deployment-tools"
},
{
"name": "diagnostics",
"defaultRemote": "https://github.com/dotnet/diagnostics"
},
{
"name": "format",
"defaultRemote": "https://github.com/dotnet/format"
},
{
"name": "fsharp",
"defaultRemote": "https://github.com/dotnet/fsharp"
},
{
"name": "installer",
"defaultRemote": "https://github.com/dotnet/installer",
"defaultRef": "vmr"
},
{
"name": "linker",
"defaultRemote": "https://github.com/dotnet/linker"
},
{
"name": "msbuild",
"defaultRemote": "https://github.com/dotnet/msbuild"
},
{
"name": "nuget-client",
"defaultRemote": "https://github.com/NuGet/NuGet.Client",
"defaultRef": "dev"
},
{
"name": "razor-compiler",
"defaultRemote": "https://github.com/dotnet/razor-compiler"
},
{
"name": "roslyn",
"defaultRemote": "https://github.com/dotnet/roslyn"
},
{
"name": "roslyn-analyzers",
"defaultRemote": "https://github.com/dotnet/roslyn-analyzers"
},
{
"name": "runtime",
"defaultRemote": "https://github.com/dotnet/runtime"
},
{
"name": "sdk",
"defaultRemote": "https://github.com/dotnet/sdk"
},
{
"name": "source-build",
"defaultRemote": "https://github.com/dotnet/source-build"
},
{
"name": "source-build-externals",
"defaultRemote": "https://github.com/dotnet/source-build-externals",
"exclude": [
"**/humanizer/samples/**/*.js"
]
},
{
"name": "source-build-reference-packages",
"defaultRemote": "https://github.com/dotnet/source-build-reference-packages"
},
{
"name": "sourcelink",
"defaultRemote": "https://github.com/dotnet/sourcelink"
},
{
"name": "symreader",
"defaultRemote": "https://github.com/dotnet/symreader"
},
{
"name": "templating",
"defaultRemote": "https://github.com/dotnet/templating"
},
{
"name": "test-templates",
"defaultRemote": "https://github.com/dotnet/test-templates"
},
{
"name": "vstest",
"defaultRemote": "https://github.com/microsoft/vstest"
},
{
"name": "xdt",
"defaultRemote": "https://github.com/dotnet/xdt"
},
{
"name": "xliff-tasks",
"defaultRemote": "https://github.com/dotnet/xliff-tasks"
}
]
}
121 changes: 121 additions & 0 deletions src/VirtualMonoRepo/InitializeVMR.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. -->
<Project>
<PropertyGroup>
<ArtifactsDir>$(RepoRoot)artifacts/</ArtifactsDir>
<VirtualMonoRepoTasksAssembly>$(ArtifactsDir)bin/VirtualMonoRepo.Tasks/$(Configuration)/net7.0/VirtualMonoRepo.Tasks.dll</VirtualMonoRepoTasksAssembly>

<VmrDir Condition=" '$(VmrDir)' != '' ">$([MSBuild]::EnsureTrailingSlash('$(VmrDir)'))</VmrDir>
<TmpDir Condition=" '$(TmpDir)' == '' ">$(ArtifactsDir)tmp/</TmpDir>
<VmrDefaultBranch Condition=" '$(VmrDefaultBranch)' == '' ">main</VmrDefaultBranch>
Comment thread
mmitche marked this conversation as resolved.

<!-- We set this for the source build targets to work well -->
<TarballDir>$(VmrDir)</TarballDir>
<InitializeVMR>true</InitializeVMR>
</PropertyGroup>

<Import Project="../SourceBuild/Arcade/tools/SourceBuildArcadeTarball.targets" />

<!-- Pull back in some properties from the tarball defaults -->
<PropertyGroup>
<VmrGitInfoDir>$(TarballGitInfoDir)</VmrGitInfoDir>
<VmrSourceDir>$(TarballSourceDir)</VmrSourceDir>
</PropertyGroup>

<UsingTask TaskName="Microsoft.DotNet.VirtualMonoRepo.Tasks.VirtualMonoRepo_Initialize" AssemblyFile="$(VirtualMonoRepoTasksAssembly)" />

<Target Name="Build" DependsOnTargets="InitializeVMR" />

<!--
This target initializes a fresh VMR from scratch by assembling it similarly to the tarball.
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).
-->
<Target Name="InitializeVMR" DependsOnTargets="GenerateFullNuGetVersion;
GenerateVersionFile;
InitializeCleanVmr;
CopyTarballContent;
CommitInitialContent;
SetupSelfGithubInfo;
InitializeRepoAndDependentsRecursive;
CommitGitInfoFiles;
CopyTextOnlyPackages;
CommitTextOnlyPackages">
<Message Text="VMR was successfully initialized in '$(VmrDir)'" Importance="High" />
</Target>

<Target Name="InitializeCleanVmr">
<RemoveDir Directories='$(VmrDir)' Condition=" EXISTS('$(VmrDir)') " />
<MakeDir Directories="$(VmrDir)" />
<MakeDir Directories="$(VmrGitInfoDir)" Condition=" '$(VmrGitInfoDir)' != '' " />
<MakeDir Directories="$(TmpDir)" Condition=" !EXISTS('$(TmpDir)') " />

<Exec Command="git init -b $(VmrDefaultBranch)" WorkingDirectory="$(VmrDir)" />
</Target>

<Target Name="CommitInitialContent">
<Exec Command="git add -A" WorkingDirectory="$(VmrDir)" />
<Exec Command="git commit -m 'VMR initialized'" WorkingDirectory="$(VmrDir)" />
</Target>

<Target Name="InitializeRepoAndDependentsRecursive"
DependsOnTargets="GetSourceBuildIntermediateNupkgNameConvention">

<Message Text="--> Initializing repo $(SourceBuildRepoName)" Importance="High" />
<PropertyGroup>
<SourceDir>$(SourceBuildRepoName)/</SourceDir>
<IndividualRepoSourceDir>$(VmrSourceDir)$(SourceDir)</IndividualRepoSourceDir>
<IndividualRepoSourceEngDir>$(IndividualRepoSourceDir)eng/</IndividualRepoSourceEngDir>
<IndividualRepoVersionDetailsFile>$(IndividualRepoSourceEngDir)Version.Details.xml</IndividualRepoVersionDetailsFile>
</PropertyGroup>

<VirtualMonoRepo_Initialize
Repository="$(SourceBuildRepoName)"
Revision="$(RepoSha)"
VmrPath="$(VmrDir)"
TmpPath="$(TmpDir)" />

<Message Text=" -> Done initializing repo $(SourceBuildRepoName)" Importance="High" />

<Tarball_ReadSourceBuildIntermediateNupkgDependencies
VersionDetailsXmlFile="$([MSBuild]::NormalizePath($(IndividualRepoVersionDetailsFile)))"
SourceBuildIntermediateNupkgPrefix="$(SourceBuildIntermediateNupkgPrefix)"
SourceBuildIntermediateNupkgRid="$(SourceBuildIntermediateNupkgRid)"
ConvertInternalRepos="$(ConvertInternalRepos)">
<Output TaskParameter="Dependencies" ItemName="SourceBuildRepos" />
</Tarball_ReadSourceBuildIntermediateNupkgDependencies>

<!-- Remove repo if it has already be cloned at any sha. This results in
The commit sha for the cloned repo in the tarball being the one that
was first encountered. -->
<ItemGroup>
<SourceBuildRepos Remove="@(SourceBuildRepos)" Condition=" EXISTS('$(VmrGitInfoDir)%(SourceBuildRepoName).props')" />
</ItemGroup>

<Tarball_WriteSourceRepoProperties
SourceBuildMetadataDir="$(VmrGitInfoDir)"
Dependencies="@(SourceBuildRepos)" />

<Message Text="--> Dependencies for $(IndividualRepoVersionDetailsFile):" Importance="High" Condition=" '@(SourceBuildRepos)' != '' " />
<Message Text="--> %(SourceBuildRepos.SourceBuildRepoName) / %(SourceBuildRepos.Sha)" Importance="High" Condition=" '@(SourceBuildRepos)' != '' " />
<MSBuild Projects="$(MSBuildProjectFile)"
Condition=" '@(SourceBuildRepos)' != '' "
Targets="InitializeRepoAndDependentsRecursive"
Properties="SourceBuildRepoName=%(SourceBuildRepos.SourceBuildRepoName);RepoSha=%(SourceBuildRepos.Sha)" />

</Target>

<Target Name="CommitGitInfoFiles">
<Copy
SourceFiles="$(VmrGitInfoDir)runtime.props"
DestinationFiles="$(VmrGitInfoDir)runtime-portable.props" />

<Exec Command="git add git-info" WorkingDirectory="$(VmrDir)" />
<Exec Command="git commit -m 'Initialized git-info files'" WorkingDirectory="$(VmrDir)" />
</Target>

<Target Name="CommitTextOnlyPackages">
<Exec Command="git add packages/text-only" WorkingDirectory="$(VmrDir)" />
<Exec Command="git commit -m 'Initialized text-only packages'" WorkingDirectory="$(VmrDir)" />
</Target>

</Project>
Loading