forked from dotnet/source-build
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dependencies.targets
114 lines (100 loc) · 4.61 KB
/
dependencies.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask AssemblyFile="$(XPlatSourceBuildTasksAssembly)" TaskName="JoinItems" />
<Target Name="CreateOrchestratedBuildUpdaters"
BeforeTargets="CreateDefaultDependencyInfos"
Condition="'$(SkipOrchestratedBuildUpdate)' != 'true'">
<ItemGroup>
<RepoProjectFile Include="$(ProjectDir)repos\*.proj" />
</ItemGroup>
<!--
Evaluate the dependency properties of each repo project. Use MSBuildSourceProjectFile as the
join key to make one combined item for each project with all available metadata.
-->
<MSBuild Projects="@(RepoProjectFile)" Targets="GetOrchestratedManifestBuildName">
<Output TaskParameter="TargetOutputs" ItemName="OrchestratedManifestBuildNames" />
</MSBuild>
<ItemGroup>
<_RepoProjectExtractedProperties
Include="@(OrchestratedManifestBuildNames)"
BuildName="%(Identity)"
KeepMetadata="MSBuildSourceProjectFile" />
</ItemGroup>
<MSBuild Projects="@(RepoProjectFile)" Targets="GetProjectDirectory">
<Output TaskParameter="TargetOutputs" ItemName="ProjectDirectories" />
</MSBuild>
<ItemGroup>
<_RepoProjectExtractedProperties
Include="@(ProjectDirectories)"
ProjectDirectory="%(Identity)"
KeepMetadata="MSBuildSourceProjectFile" />
</ItemGroup>
<MSBuild Projects="@(RepoProjectFile)" Targets="GetOfficialBuildId">
<Output TaskParameter="TargetOutputs" ItemName="OfficialBuildIds" />
</MSBuild>
<ItemGroup>
<_RepoProjectExtractedProperties
Include="@(OfficialBuildIds)"
OfficialBuildId="%(Identity)"
KeepMetadata="MSBuildSourceProjectFile" />
</ItemGroup>
<JoinItems
Left="@(RepoProjectFile)" LeftMetadata="*"
Right="@(_RepoProjectExtractedProperties)" RightKey="MSBuildSourceProjectFile" RightMetadata="*">
<Output TaskParameter="JoinResult" ItemName="_JoinProjectFileProperties" />
</JoinItems>
<!-- Add the git submodule directory to each project item. -->
<ReadGitConfigFile File="$(GitModulesPath)">
<Output TaskParameter="SubmoduleConfiguration" ItemName="SubmoduleConfigurations" />
</ReadGitConfigFile>
<ItemGroup>
<_ExtractedGitModuleProperties
Include="@(SubmoduleConfigurations)"
ProjectDirectory="$(ProjectDir)%(Path)/"
GitUrl="%(Url)"
KeepMetadata="Identity" />
</ItemGroup>
<JoinItems
Left="@(_JoinProjectFileProperties)" LeftKey="ProjectDirectory" LeftMetadata="*" LeftItemSpec="Identity"
Right="@(_ExtractedGitModuleProperties)" RightKey="ProjectDirectory" RightMetadata="*">
<Output TaskParameter="JoinResult" ItemName="RepoProjectWithProperties" />
</JoinItems>
<ItemGroup>
<UpdateStep
Include="@(RepoProjectWithProperties)"
Condition="'%(RepoProjectWithProperties.BuildName)' != 'N/A'"
UpdaterType="Submodule from orchestrated build"
Path="%(RepoProjectWithProperties.ProjectDirectory)" />
<UpdateStep
Include="@(RepoProjectWithProperties)"
Condition="
'%(RepoProjectWithProperties.BuildName)' != 'N/A' AND
'%(RepoProjectWithProperties.OfficialBuildId)' != ''"
UpdaterType="Build attribute from orchestrated build"
AttributeName="BuildId"
Path="%(RepoProjectWithProperties.Identity)"
ElementName="OfficialBuildId"
SkipIfNoReplacementFound="true" />
<UpdateStep
Include="ProdCon"
UpdaterType="Orchestrated blob feed attribute"
SingleLineFile="$(MSBuildThisFileDirectory)ProdConFeed.txt"
AttributeName="Url"
ReplacementSubstituteOld="$(ProdConBlobFeedReplaceOld)"
ReplacementSubstituteNew="$(ProdConBlobFeedReplaceNew)" />
</ItemGroup>
<!-- Upgrade some package versions that are built only by ProdCon. -->
<ItemGroup>
<PackageUpdatedFromProdCon Include="Microsoft.AspNetCore.All" Element="MicrosoftAspNetCoreAllPackageVersion" />
<PackageUpdatedFromProdCon Include="Microsoft.AspNetCore.App" Element="MicrosoftAspNetCoreAppPackageVersion" />
<PackageUpdatedFromProdCon Include="Microsoft.NET.Sdk.Razor" Element="MicrosoftNETSdkRazorPackageVersion" />
<UpdateStep
Include="ProdCon"
UpdaterType="Orchestrated blob feed package version"
PackageId="@(PackageUpdatedFromProdCon)"
Path="$(MSBuildThisFileDirectory)dependencies.props"
ElementName="%(PackageUpdatedFromProdCon.Element)"
SkipIfNoReplacementFound="true" />
</ItemGroup>
</Target>
</Project>