Skip to content

Commit b98297b

Browse files
authored
Add new ProdCon manifest updaters from 2.1.1 (#605)
Update OfficialBuildId from BuildId in the manifest. Update ProdCon feed to latest in manifest. * Update BuildTools to 2.1.0-rc1-02911-02 This brings in the new updaters without any other changes. (cherry picked from commit 6ec0829)
1 parent b560e5a commit b98297b

File tree

10 files changed

+233
-39
lines changed

10 files changed

+233
-39
lines changed

BuildToolsVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.0-rc1-02804-05
1+
2.1.0-rc1-02911-02

dependencies.props

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<PropertyGroup>
88
<ProdConCurrentRef>79731c509a9d31b921f531ee63c48daa8e0c30d5</ProdConCurrentRef>
99
<CoreClrCurrentRef>79731c509a9d31b921f531ee63c48daa8e0c30d5</CoreClrCurrentRef>
10-
<BuildToolsCurrentRef>54227d85bec7093210eef26b6013d1435c6fc21e</BuildToolsCurrentRef>
10+
<BuildToolsCurrentRef>ba7a90f8cbc824737d0fae5ff230635a9764a1d7</BuildToolsCurrentRef>
1111
</PropertyGroup>
1212

1313
<!-- Package dependency verification/auto-upgrade configuration. -->
@@ -40,11 +40,17 @@
4040

4141
<DependencyInfo Include="ProdCon">
4242
<DependencyType>Orchestrated build</DependencyType>
43-
<BasePath>build-info/dotnet/product/cli/release/2.1</BasePath>
43+
<BasePath>build-info/dotnet/product/cli/release/2.1.1</BasePath>
4444
<CurrentRef>$(ProdConCurrentRef)</CurrentRef>
4545
<VersionsRepoOwner>dotnet</VersionsRepoOwner>
4646
<VersionsRepo>versions</VersionsRepo>
4747
</DependencyInfo>
48+
49+
<UpdateStep Include="ProdCon">
50+
<UpdaterType>Orchestrated blob feed attribute</UpdaterType>
51+
<SingleLineFile>$(MSBuildThisFileDirectory)ProdConFeed.txt</SingleLineFile>
52+
<AttributeName>Url</AttributeName>
53+
</UpdateStep>
4854
</ItemGroup>
4955

5056
<ItemGroup Condition="'$(SkipBuildToolsUpdate)' != 'true'">
@@ -53,7 +59,7 @@
5359
<Path>$(MSBuildThisFileDirectory)BuildToolsVersion.txt</Path>
5460
<PackageId>Microsoft.DotNet.BuildTools</PackageId>
5561
</UpdateStep>
56-
<UpdateStep Include="BuildTools">
62+
<UpdateStep Include="CoreClr">
5763
<UpdaterType>File</UpdaterType>
5864
<Path>$(MSBuildThisFileDirectory)tools-local/ILAsmVersion.txt</Path>
5965
<PackageId>Microsoft.NETCore.ILAsm</PackageId>

dependencies.targets

Lines changed: 67 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,90 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Target Name="CreateOrchestratedBuildSubmoduleUpdaters"
3+
4+
<UsingTask AssemblyFile="$(TasksBinDir)Microsoft.DotNet.SourceBuild.Tasks.dll" TaskName="JoinItems" />
5+
6+
<Target Name="CreateOrchestratedBuildUpdaters"
47
BeforeTargets="CreateDefaultDependencyInfos"
5-
Condition="'$(SkipOrchestratedBuildSubmoduleUpdate)' != 'true'">
8+
Condition="'$(SkipOrchestratedBuildUpdate)' != 'true'">
69

710
<ItemGroup>
8-
<OrchestratedBuildRepoProjects Include="$(ProjectDir)repos\*.proj" />
11+
<RepoProjectFile Include="$(ProjectDir)repos\*.proj" />
912
</ItemGroup>
1013

11-
<MSBuild Projects="@(OrchestratedBuildRepoProjects)"
12-
Targets="GetOrchestratedManifestBuildName">
14+
<!--
15+
Evaluate the dependency properties of each repo project. Use MSBuildSourceProjectFile as the
16+
join key to make one combined item for each project with all available metadata.
17+
-->
18+
<MSBuild Projects="@(RepoProjectFile)" Targets="GetOrchestratedManifestBuildName">
1319
<Output TaskParameter="TargetOutputs" ItemName="OrchestratedManifestBuildNames" />
1420
</MSBuild>
21+
<ItemGroup>
22+
<_RepoProjectExtractedProperties
23+
Include="@(OrchestratedManifestBuildNames)"
24+
BuildName="%(Identity)"
25+
KeepMetadata="MSBuildSourceProjectFile" />
26+
</ItemGroup>
1527

16-
<MSBuild Projects="@(OrchestratedBuildRepoProjects)"
17-
Targets="GetProjectDirectory">
28+
<MSBuild Projects="@(RepoProjectFile)" Targets="GetProjectDirectory">
1829
<Output TaskParameter="TargetOutputs" ItemName="ProjectDirectories" />
1930
</MSBuild>
31+
<ItemGroup>
32+
<_RepoProjectExtractedProperties
33+
Include="@(ProjectDirectories)"
34+
ProjectDirectory="%(Identity)"
35+
KeepMetadata="MSBuildSourceProjectFile" />
36+
</ItemGroup>
37+
38+
<MSBuild Projects="@(RepoProjectFile)" Targets="GetOfficialBuildId">
39+
<Output TaskParameter="TargetOutputs" ItemName="OfficialBuildIds" />
40+
</MSBuild>
41+
<ItemGroup>
42+
<_RepoProjectExtractedProperties
43+
Include="@(OfficialBuildIds)"
44+
OfficialBuildId="%(Identity)"
45+
KeepMetadata="MSBuildSourceProjectFile" />
46+
</ItemGroup>
2047

48+
<JoinItems
49+
Left="@(RepoProjectFile)" LeftMetadata="*"
50+
Right="@(_RepoProjectExtractedProperties)" RightKey="MSBuildSourceProjectFile" RightMetadata="*">
51+
<Output TaskParameter="JoinResult" ItemName="_JoinProjectFileProperties" />
52+
</JoinItems>
53+
54+
<!-- Add the git submodule directory to each project item. -->
2155
<ReadGitConfigFile File="$(GitModulesPath)">
2256
<Output TaskParameter="SubmoduleConfiguration" ItemName="SubmoduleConfigurations" />
2357
</ReadGitConfigFile>
24-
25-
<!--
26-
Perform joins to gather information about each repo into a single item each. Each A-B join
27-
first creates all A*B "candidate" combinations. The candidate items are then filtered down to
28-
the combinations where the desired metadata from A and B match.
29-
-->
3058
<ItemGroup>
31-
<!-- Join manifest build name to project directory. -->
32-
<BuildNamePathCandidate Include="@(OrchestratedManifestBuildNames)">
33-
<Path>%(ProjectDirectories.Identity)</Path>
34-
<ProjectDirectorySourceProjectFile>%(ProjectDirectories.MSBuildSourceProjectFile)</ProjectDirectorySourceProjectFile>
35-
</BuildNamePathCandidate>
36-
37-
<BuildNamePath Include="@(BuildNamePathCandidate)"
38-
Condition="'%(MSBuildSourceProjectFile)' == '%(ProjectDirectorySourceProjectFile)' AND
39-
'%(Identity)' != 'N/A'" />
40-
41-
<!-- Join project directory to submodule URL. -->
42-
<BuildNamePathGitUrlCandidate Include="@(BuildNamePath)">
43-
<Submodule>$(ProjectDir)%(SubmoduleConfigurations.Path)/</Submodule>
44-
<GitUrl>%(SubmoduleConfigurations.Url)</GitUrl>
45-
</BuildNamePathGitUrlCandidate>
46-
47-
<BuildNamePathGitUrl Include="@(BuildNamePathGitUrlCandidate)"
48-
Condition="'%(Path)' == '%(Submodule)'" />
59+
<_ExtractedGitModuleProperties
60+
Include="@(SubmoduleConfigurations)"
61+
ProjectDirectory="$(ProjectDir)%(Path)/"
62+
GitUrl="%(Url)"
63+
KeepMetadata="Identity" />
4964
</ItemGroup>
5065

66+
<JoinItems
67+
Left="@(_JoinProjectFileProperties)" LeftKey="ProjectDirectory" LeftMetadata="*" LeftItemSpec="Identity"
68+
Right="@(_ExtractedGitModuleProperties)" RightKey="ProjectDirectory" RightMetadata="*">
69+
<Output TaskParameter="JoinResult" ItemName="RepoProjectWithProperties" />
70+
</JoinItems>
71+
5172
<ItemGroup>
52-
<UpdateStep Include="@(BuildNamePathGitUrl)">
53-
<UpdaterType>Submodule from orchestrated build</UpdaterType>
54-
<BuildName>%(BuildNamePathGitUrl.Identity)</BuildName>
55-
</UpdateStep>
73+
<UpdateStep
74+
Include="@(RepoProjectWithProperties)"
75+
Condition="'%(RepoProjectWithProperties.BuildName)' != 'N/A'"
76+
UpdaterType="Submodule from orchestrated build"
77+
Path="%(RepoProjectWithProperties.ProjectDirectory)" />
78+
79+
<UpdateStep
80+
Include="@(RepoProjectWithProperties)"
81+
Condition="
82+
'%(RepoProjectWithProperties.BuildName)' != 'N/A' AND
83+
'%(RepoProjectWithProperties.OfficialBuildId)' != ''"
84+
UpdaterType="Build attribute from orchestrated build"
85+
AttributeName="BuildId"
86+
Path="%(RepoProjectWithProperties.Identity)"
87+
ElementName="OfficialBuildId" />
5688
</ItemGroup>
5789
</Target>
5890
</Project>

repos/cli-migrate.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
<GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
1515
<DependencyVersionInputRepoApiImplemented>false</DependencyVersionInputRepoApiImplemented>
1616
<UsesRepoToolset>true</UsesRepoToolset>
17+
<!--
18+
This repo is not currently built in ProdCon
1719
<OrchestratedManifestBuildName>dotnet/cli-migrate</OrchestratedManifestBuildName>
20+
-->
21+
<OrchestratedManifestBuildName>N/A</OrchestratedManifestBuildName>
1822
</PropertyGroup>
1923

2024
<ItemGroup>

repos/clicommandlineparser.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
<DependencyVersionInputRepoApiImplemented>false</DependencyVersionInputRepoApiImplemented>
1212
<UsesRepoToolset>true</UsesRepoToolset>
1313
<GlobalJsonFile>$(ProjectDirectory)global.json</GlobalJsonFile>
14+
<!--
15+
This repo is not currently built in ProdCon
1416
<OrchestratedManifestBuildName>dotnet/CliCommandLineParser</OrchestratedManifestBuildName>
17+
-->
18+
<OrchestratedManifestBuildName>N/A</OrchestratedManifestBuildName>
1519
</PropertyGroup>
1620

1721
<ItemGroup>

repos/dir.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@
371371

372372
<Target Name="GetProjectDirectory" Outputs="$(ProjectDirectory)" />
373373
<Target Name="GetOrchestratedManifestBuildName" Outputs="$(OrchestratedManifestBuildName)" />
374+
<Target Name="GetOfficialBuildId" Outputs="$(OfficialBuildId)" />
374375

375376
<Import Project="$(ToolsDir)VersionTools.targets" />
376377
</Project>

repos/fsharp.proj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
<BuildRevision>171107</BuildRevision>
77
<BuildCommand>$(ProjectDirectory)/src/buildfromsource$(ShellExtension)</BuildCommand>
88
<RepoApiImplemented>false</RepoApiImplemented>
9+
<!-- This repo is not currently built in ProdCon -->
10+
<OrchestratedManifestBuildName>N/A</OrchestratedManifestBuildName>
911
</PropertyGroup>
1012

1113
<!-- Auto-detect the root NuGet.Config, but also update the build-from-source-specific one. -->

repos/nuget-client.proj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
<NuGetKeyFilePath>$(KeysDir)NuGet.Client.snk</NuGetKeyFilePath>
99
<NuGetClientBuildNumber>5156</NuGetClientBuildNumber>
1010
<RepoApiImplemented>false</RepoApiImplemented>
11+
<!--
12+
This repo is not currently built in ProdCon
1113
<OrchestratedManifestBuildName>nuget.client</OrchestratedManifestBuildName>
14+
-->
15+
<OrchestratedManifestBuildName>N/A</OrchestratedManifestBuildName>
1216
</PropertyGroup>
1317

1418
<ItemGroup>

repos/templating.proj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
<PackageDateTime>20170727</PackageDateTime>
88
<PackageBuildQuality>beta2</PackageBuildQuality>
99
<RepoApiImplemented>false</RepoApiImplemented>
10+
<!-- This repo is not currently built in ProdCon -->
11+
<OrchestratedManifestBuildName>N/A</OrchestratedManifestBuildName>
1012
</PropertyGroup>
1113

1214
<ItemGroup>
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
// Copied from https://github.com/aspnet/Universe/blob/1f8f30a1e834eff147ced0c669cef8828f9511c8/build/tasks/JoinItems.cs.
5+
// When this task is available in https://github.com/dotnet/Arcade, switch to use that version.
6+
// Modified to allow multiple Right matches using GroupJoin.
7+
8+
using Microsoft.Build.Framework;
9+
using Microsoft.Build.Utilities;
10+
using System;
11+
using System.Linq;
12+
13+
namespace RepoTasks
14+
{
15+
public class JoinItems : Task
16+
{
17+
[Required]
18+
public ITaskItem[] Left { get; set; }
19+
20+
[Required]
21+
public ITaskItem[] Right { get; set; }
22+
23+
// The metadata to use as the new item spec. If not specified, LeftKey is used.
24+
public string LeftItemSpec { get; set; }
25+
26+
// LeftKey and RightKey: The metadata to join on. If not set, then use the ItemSpec
27+
public string LeftKey { get; set; }
28+
29+
public string RightKey { get; set; }
30+
31+
32+
// LeftMetadata and RightMetadata: The metadata names to include in the result. Specify "*" to include all metadata
33+
public string[] LeftMetadata { get; set; }
34+
35+
public string[] RightMetadata { get; set; }
36+
37+
38+
[Output]
39+
public ITaskItem[] JoinResult { get; private set; }
40+
41+
public override bool Execute()
42+
{
43+
bool useAllLeftMetadata = LeftMetadata != null && LeftMetadata.Length == 1 && LeftMetadata[0] == "*";
44+
bool useAllRightMetadata = RightMetadata != null && RightMetadata.Length == 1 && RightMetadata[0] == "*";
45+
var newItemSpec = string.IsNullOrEmpty(LeftItemSpec)
46+
? LeftKey
47+
: LeftItemSpec;
48+
49+
JoinResult = Left.GroupJoin(Right,
50+
item => GetKeyValue(LeftKey, item),
51+
item => GetKeyValue(RightKey, item),
52+
(left, rights) =>
53+
{
54+
// If including all metadata from left items and none from right items, just return left items directly
55+
if (useAllLeftMetadata &&
56+
string.IsNullOrEmpty(LeftKey) &&
57+
string.IsNullOrEmpty(LeftItemSpec) &&
58+
(RightMetadata == null || RightMetadata.Length == 0))
59+
{
60+
return left;
61+
}
62+
63+
// If including all metadata from all right items and none from left items, just return the right items directly
64+
if (useAllRightMetadata &&
65+
string.IsNullOrEmpty(RightKey) &&
66+
string.IsNullOrEmpty(LeftItemSpec) &&
67+
(LeftMetadata == null || LeftMetadata.Length == 0))
68+
{
69+
return rights.Aggregate(
70+
new TaskItem(),
71+
(agg, next) =>
72+
{
73+
CopyAllMetadata(next, agg);
74+
return agg;
75+
});
76+
}
77+
78+
var ret = new TaskItem(GetKeyValue(newItemSpec, left));
79+
80+
// Weird ordering here is to prefer left metadata in all cases, as CopyToMetadata doesn't overwrite any existing metadata
81+
if (useAllLeftMetadata)
82+
{
83+
CopyAllMetadata(left, ret);
84+
}
85+
86+
if (!useAllRightMetadata && RightMetadata != null)
87+
{
88+
foreach (string name in RightMetadata)
89+
{
90+
foreach (var right in rights)
91+
{
92+
ret.SetMetadata(name, right.GetMetadata(name));
93+
}
94+
}
95+
}
96+
97+
if (!useAllLeftMetadata && LeftMetadata != null)
98+
{
99+
foreach (string name in LeftMetadata)
100+
{
101+
ret.SetMetadata(name, left.GetMetadata(name));
102+
}
103+
}
104+
105+
if (useAllRightMetadata)
106+
{
107+
foreach (var right in rights)
108+
{
109+
CopyAllMetadata(right, ret);
110+
}
111+
}
112+
113+
return (ITaskItem)ret;
114+
},
115+
StringComparer.OrdinalIgnoreCase).ToArray();
116+
117+
return true;
118+
}
119+
120+
static void CopyAllMetadata(ITaskItem source, ITaskItem dest)
121+
{
122+
// CopyMetadata adds an OriginalItemSpec, which we don't want. So we subsequently remove it
123+
source.CopyMetadataTo(dest);
124+
dest.RemoveMetadata("OriginalItemSpec");
125+
}
126+
127+
static string GetKeyValue(string key, ITaskItem item)
128+
{
129+
if (string.IsNullOrEmpty(key))
130+
{
131+
return item.ItemSpec;
132+
}
133+
else
134+
{
135+
return item.GetMetadata(key);
136+
}
137+
}
138+
}
139+
}

0 commit comments

Comments
 (0)