/
helix.proj
149 lines (130 loc) · 8.77 KB
/
helix.proj
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test" TreatAsLocalProperty="ProjectToBuild">
<!--
TEMPORARY workaround while we wait for https://github.com/dotnet/arcade/issues/8336 to be addressed.
When the runtime version we're ingesting was built publicly, or we're building in public CI, IsPublicRuntime should be true,
causing us to use the normal workflow of downloading it from the public location in Helix.
When the runtime was built internally (which necessarily also means we're building in the internal project), IsPublicRuntime should be false,
causing us to pass the right Sas token to get Helx to download it from the internal location.
Once https://github.com/dotnet/arcade/issues/8336, we only need to set AdditionalDotNetPackage below,
not HelixCorrelationPayload.
-->
<PropertyGroup>
<IsPublicRuntime>false</IsPublicRuntime>
</PropertyGroup>
<PropertyGroup>
<!--
When invoking helix.proj for the whole repo with build.cmd, ProjectToBuild will be set to the path to this project.
This must be reset in order for Build.props to evaluate a list of projects to be tested on Helix.
-->
<ProjectToBuild Condition="'$(ProjectToBuild)' == '$(MSBuildProjectFullPath)'"/>
</PropertyGroup>
<Import Project="..\targets\Helix.Common.props" />
<Import Project="..\Build.props" />
<Import Project="..\Versions.props" />
<!-- Microsoft.DotNet.Helix.Sdk.MultiQueue.targets splits $(HelixTargetQueues) into @(HelixTargetQueue) items. -->
<ItemGroup Condition=" '$(HelixTargetQueues)' == '' ">
<HelixTargetQueue Condition="'$(_UseHelixOpenQueues)' == 'true'" Include="@(HelixAvailableTargetQueue)" />
<HelixTargetQueue Condition="'$(_UseHelixOpenQueues)' != 'true'" Include="@(HelixAvailableTargetQueue->'%(Identity)'->Replace('.Open',''))" />
</ItemGroup>
<PropertyGroup>
<HelixBuild>private-$(USERNAME)</HelixBuild>
<HelixBuild Condition=" '$(USERNAME)' == '' ">private-$(USER)</HelixBuild>
<IsExternal>true</IsExternal>
<MaxRetryCount Condition="'$(MaxRetryCount)' == ''">2</MaxRetryCount>
<HelixAccessToken Condition="'$(_UseHelixOpenQueues)' != 'true'">$(HelixApiAccessToken)</HelixAccessToken>
<IncludeDotNetCli>true</IncludeDotNetCli>
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<DotNetCliVersion>$(NETCoreSdkVersion)</DotNetCliVersion>
<DotNetCliChannel>Current</DotNetCliChannel>
<ArchiveExtension>.tar.gz</ArchiveExtension>
<ArchiveExtension Condition="'$(IsWindowsHelixQueue)' == 'true'">.zip</ArchiveExtension>
<!-- Similar to ProjectLayout.props in the Arcade SDK. The Helix SDK contains nothing similar. -->
<OutputPath Condition=" '$(OutputPath)' == '' ">$(RepoRoot)artifacts\bin\$(MSBuildProjectName)\</OutputPath>
</PropertyGroup>
<!-- Specify the runtime we need which will be included as a correlation payload -->
<ItemGroup>
<!--
Use the BrowserDebugHost transport package as a sentinel for the non-shipping version of the NETCoreApp shared framework.
!temporary! e.g. https://dotnetbuilds.blob.core.windows.net/internal/Runtime/6.0.2-servicing.22060.12/dotnet-runtime-6.0.2-win-x86.zip?{token}
-->
<HelixCorrelationPayload Include="dotnet-cli"
Condition="'$(SYSTEM_TEAMPROJECT)' == 'internal' AND '$(IsPublicRuntime)' == 'false'"
Destination="dotnet-cli"
Uri="https://dotnetbuilds.blob.core.windows.net/internal/Runtime/$(MicrosoftNETCoreBrowserDebugHostTransportVersion)/dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-$(DotNetCliRuntime)$(ArchiveExtension)$([System.Environment]::GetEnvironmentVariable('DotNetBuildsInternalReadSasToken'))" />
<AdditionalDotNetPackage Include="$(MicrosoftNETCoreBrowserDebugHostTransportVersion)"
Condition="'$(SYSTEM_TEAMPROJECT)' != 'internal' OR '$(IsPublicRuntime)' == 'true'">
<PackageType>runtime</PackageType>
</AdditionalDotNetPackage>
</ItemGroup>
<PropertyGroup Condition=" '$(ContinuousIntegrationBuild)' == 'true' ">
<HelixType>ci</HelixType>
<!-- Creator is not valid for internal queues -->
<Creator Condition="'$(_UseHelixOpenQueues)' == 'true'">aspnetcore</Creator>
<HelixBuild>$(BUILD_BUILDNUMBER).$(TargetArchitecture).$(SYSTEM_JOBATTEMPT)</HelixBuild>
<WaitForWorkItemCompletion>true</WaitForWorkItemCompletion>
<EnableAzurePipelinesReporter>true</EnableAzurePipelinesReporter>
<EnableXUnitReporter>true</EnableXUnitReporter>
</PropertyGroup>
<PropertyGroup Condition=" '$(ContinuousIntegrationBuild)' != 'true' ">
<HelixType>dev</HelixType>
<!-- Creator is not valid for internal queues -->
<Creator Condition="'$(_UseHelixOpenQueues)' == 'true'">$(USERNAME)</Creator>
<Creator Condition="'$(USERNAME)' == '' AND '$(_UseHelixOpenQueues)' == 'true'">$(USER)</Creator>
<HelixBuild>$([System.DateTime]::Now.ToString('yyyyMMddHHmm'))</HelixBuild>
</PropertyGroup>
<!-- Items with the type "HelixProperties" will become arbitrary JSON associated with the job -->
<!-- NOTE: These are global to the whole Job, so don't include project-specific content here. -->
<ItemGroup>
<HelixProperties Include="buildNumber" Value="$(BUILD_BUILDNUMBER)" Condition="'$(BUILD_BUILDNUMBER)' != ''" />
<HelixProperties Include="buildId" Value="$(BUILD_BUILDID)" Condition="'$(BUILD_BUILDID)' != ''" />
<HelixProperties Include="azdoProject" Value="$(SYSTEM_TEAMPROJECT)" Condition="'$(SYSTEM_TEAMPROJECT)' != ''" />
<HelixProperties Include="buildDefinition" Value="$(BUILD_DEFINITIONNAME)" Condition="'$(BUILD_DEFINITIONNAME)' != ''" />
<HelixProperties Include="commitSha" Value="$(BUILD_SOURCEVERSION)" Condition="'$(BUILD_SOURCEVERSION)' != ''" />
<HelixProperties Include="branch" Value="$(BUILD_SOURCEBRANCH)" Condition="'$(BUILD_SOURCEBRANCH)' != ''" />
<HelixProperties Condition="'$(RunQuarantinedTests)' == 'true'" Include="runType" Value="quarantined" />
<HelixProperties Condition="'$(RunQuarantinedTests)' != 'true'" Include="runType" Value="unquarantined" />
</ItemGroup>
<Target Name="IncludeAspNetRuntime" BeforeTargets="Gather"
Condition="'$(DoNotRequireSharedFxHelix)' != 'true' OR
EXISTS('$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Runtime.$(TargetRuntimeIdentifier).$(SharedFxVersion).nupkg')">
<MSBuild Projects="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj"
Properties="DisableYarnCheck=true;ExcludeFromBuild=false"
Targets="_GetPackageVersionInfo"
SkipNonexistentProjects="false">
<Output TaskParameter="TargetOutputs" ItemName="_ResolvedProductVersionInfo" />
</MSBuild>
<PropertyGroup>
<SharedFxVersion>@(_ResolvedProductVersionInfo->'%(PackageVersion)')</SharedFxVersion>
</PropertyGroup>
<!-- Use package because .dotnet/ folder doesn't contain RuntimeList.xml file and SharedFxTests checks that. -->
<Unzip
SourceFiles="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Runtime.$(TargetRuntimeIdentifier).$(SharedFxVersion).nupkg"
DestinationFolder="$(OutputPath)\SharedFx.Unzip" />
<ItemGroup>
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\*.txt" />
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\*.json" />
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\*.dll" />
<_appRuntimeFiles Include="$(OutputPath)\SharedFx.Unzip\**\RuntimeList.xml" />
</ItemGroup>
<Copy SourceFiles="@(_appRuntimeFiles)"
DestinationFolder="$(OutputPath)\SharedFx.Layout\shared\Microsoft.AspNetCore.App\$(SharedFxVersion)" />
<Copy SourceFiles="$(OutputPath)\SharedFx.Unzip\Microsoft.AspNetCore.App.versions.txt"
DestinationFiles="$(OutputPath)\SharedFx.Layout\shared\Microsoft.AspNetCore.App\$(SharedFxVersion)\.version" />
<Unzip Condition="Exists('$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg')"
SourceFiles="$(RepoRoot)artifacts\packages\$(Configuration)\Shipping\Microsoft.AspNetCore.App.Ref.$(SharedFxVersion).nupkg"
DestinationFolder="$(OutputPath)\SharedFx.Layout\packs\Microsoft.AspNetCore.App.Ref\$(SharedFxVersion)" />
<ZipDirectory Condition="Exists('$(OutputPath)\SharedFx.Layout')"
SourceDirectory="$(OutputPath)\SharedFx.Layout"
DestinationFile="$(OutputPath)\SharedFx.Layout.zip" Overwrite="true" />
<ItemGroup>
<HelixCorrelationPayload Include="$(OutputPath)\SharedFx.Layout.zip" Destination="$(DotNetCliDestination)" />
</ItemGroup>
</Target>
<Target Name="Gather" BeforeTargets="Build">
<MSBuild Projects="@(ProjectToBuild)"
Targets="CreateHelixPayload"
SkipNonexistentTargets="true">
<Output TaskParameter="TargetOutputs" ItemName="HelixWorkItem" />
</MSBuild>
</Target>
</Project>