8000 [main] Source code updates from dotnet/arcade (#1599) · dotnet/dotnet@87e4c82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 87e4c82

Browse files
[main] Source code updates from dotnet/arcade (#1599)
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
1 parent afe70fa commit 87e4c82

File tree

13 files changed

+144
-85
lines changed

13 files changed

+144
-85
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- will get filled in the next backflow -->

src/arcade/eng/Version.Details.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,25 @@
2727
<Uri>https://github.com/dotnet/templating</Uri>
2828
<Sha>43b5827697e501c442eb75ffff832cd4df2514fe</Sha>
2929
</Dependency>
30-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25367.3">
30+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25367.5">
3131
<Uri>https://github.com/dotnet/arcade</Uri>
32-
<Sha>6445f37f3e88b2fda5b7315d3c67366fe1cdfb51</Sha>
32+
<Sha>d777c20040bdc2e52b372fa98dcb84141ed692d3</Sha>
3333
</Dependency>
34-
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="10.0.0-beta.25367.3">
34+
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="10.0.0-beta.25367.5">
3535
<Uri>https://github.com/dotnet/arcade</Uri>
36-
<Sha>6445f37f3e88b2fda5b7315d3c67366fe1cdfb51</Sha>
36+
<Sha>d777c20040bdc2e52b372fa98dcb84141ed692d3</Sha>
3737
</Dependency>
38-
<Dependency Name="Microsoft.DotNet.ProductConstructionService.Client" Version="1.1.0-beta.25366.3">
38+
<Dependency Name="Microsoft.DotNet.ProductConstructionService.Client" Version="1.1.0-beta.25367.2">
3939
<Uri>https://github.com/dotnet/arcade-services</Uri>
40-
<Sha>c58bb8877ac5a73622fede6b154a328438545bd9</Sha>
40+
<Sha>584861c7778116820c4768ac59b78b9dc2ab9245</Sha>
4141
</Dependency>
42-
<Dependency Name="Microsoft.DotNet.DarcLib" Version="1.1.0-beta.25366.3">
42+
<Dependency Name="Microsoft.DotNet.DarcLib" Version="1.1.0-beta.25367.2">
4343
<Uri>https://github.com/dotnet/arcade-services</Uri>
44-
<Sha>c58bb8877ac5a73622fede6b154a328438545bd9</Sha>
44+
<Sha>584861c7778116820c4768ac59b78b9dc2ab9245</Sha>
4545
</Dependency>
46-
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="10.0.0-prerelease.25361.1">
46+
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="10.0.0-prerelease.25365.3">
4747
<Uri>https://github.com/dotnet/xharness</Uri>
48-
<Sha>8eecd2e8f62f56f7c4293bc85fe792789b9712c2</Sha>
48+
<Sha>656faa7f359cf9b3803f22fccd0be3bd1cf99fab</Sha>
4949
</Dependency>
5050
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.8.0">
5151
<Uri>https://github.com/dotnet/roslyn</Uri>

src/arcade/eng/Versions.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
<!-- arcade -->
2424
<MicrosoftDotNetSwaggerGeneratorMSBuildVersion>9.0.0-beta.24223.1</MicrosoftDotNetSwaggerGeneratorMSBuildVersion>
2525
<!-- arcade-services -->
26-
<MicrosoftDotNetProductConstructionServiceClientVersion>1.1.0-beta.25366.3</MicrosoftDotNetProductConstructionServiceClientVersion>
27-
<MicrosoftDotNetDarcLibVersion>1.1.0-beta.25366.3</MicrosoftDotNetDarcLibVersion>
26+
<MicrosoftDotNetProductConstructionServiceClientVersion>1.1.0-beta.25367.2</MicrosoftDotNetProductConstructionServiceClientVersion>
27+
<MicrosoftDotNetDarcLibVersion>1.1.0-beta.25367.2</MicrosoftDotNetDarcLibVersion>
2828
<!-- command-line-api -->
2929
<SystemCommandLineVersion>2.0.0-beta5.25210.1</SystemCommandLineVersion>
3030
<!-- corefx -->
@@ -99,6 +99,6 @@
9999
<!-- vstest -->
100100
<MicrosoftNetTestSdkVersion>17.5.0</MicrosoftNetTestSdkVersion>
101101
<!-- xharness -->
102-
<MicrosoftDotNetXHarnessCLIVersion>10.0.0-prerelease.25361.1</MicrosoftDotNetXHarnessCLIVersion>
102+
<MicrosoftDotNetXHarnessCLIVersion>10.0.0-prerelease.25365.3</MicrosoftDotNetXHarnessCLIVersion>
103103
</PropertyGroup>
104104
</Project>

src/arcade/eng/common/core-templates/job/job.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ parameters:
2020
artifacts: ''
2121
enableMicrobuild: false
2222
enableMicrobuildForMacAndLinux: false
23+
microbuildUseESRP: true
2324
enablePublishBuildArtifacts: false
2425
enablePublishBuildAssets: false
2526
enablePublishTestResults: false
@@ -128,6 +129,7 @@ jobs:
128129
parameters:
129130
enableMicrobuild: ${{ parameters.enableMicrobuild }}
130131
enableMicrobuildForMacAndLinux: ${{ parameters.enableMicrobuildForMacAndLinux }}
132+
microbuildUseESRP: ${{ parameters.microbuildUseESRP }}
131133
continueOnError: ${{ parameters.continueOnError }}
132134

133135
- ${{ if and(eq(parameters.runAsPublic, 'false'), eq(variables['System.TeamProject'], 'internal')) }}:

src/arcade/eng/common/core-templates/steps/install-microbuild.yml

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ parameters:
44
# Enable install tasks for MicroBuild on Mac and Linux
55
# Will be ignored if 'enableMicrobuild' is false or 'Agent.Os' is 'Windows_NT'
66
enableMicrobuildForMacAndLinux: false
7+
# Determines whether the ESRP service connection information should be passed to the signing plugin.
8+
# This overlaps with _SignType to some degree. We only need the service connection for real signing.
9+
# It's important that the service connection not be passed to the MicroBuildSigningPlugin task in this place.
10+
# Doing so will cause the service connection to be authorized for the pipeline, which isn't allowed and won't work for non-prod.
11+
# Unfortunately, _SignType can't be used to exclude the use of the service connection in non-real sign scenarios. The
12+
# variable is not available in template expression. _SignType has a very large proliferation across .NET, so replacing it is tough.
13+
microbuildUseESRP: true
714
# Location of the MicroBuild output folder
815
microBuildOutputFolder: '$(Build.SourcesDirectory)'
16+
917
continueOnError: false
1018

1119
steps:
@@ -21,19 +29,37 @@ steps:
2129
workingDirectory: ${{ parameters.microBuildOutputFolder }}
2230
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
2331

32+
- script: |
33+
REM Check if ESRP is disabled while SignType is real
34+
if /I "${{ parameters.microbuildUseESRP }}"=="false" if /I "$(_SignType)"=="real" (
35+
echo Error: ESRP must be enabled when SignType is real.
36+
exit /b 1
37+
)
38+
displayName: 'Validate ESRP usage (Windows)'
39+
condition: and(succeeded(), eq(variables['Agent.Os'], 'Windows_NT'))
40+
- script: |
41+
# Check if ESRP is disabled while SignType is real
42+
if [ "${{ parameters.microbuildUseESRP }}" = "false" ] && [ "$(_SignType)" = "real" ]; then
43+
echo "Error: ESRP must be enabled when SignType is real."
44+
exit 1
45+
fi
46+
displayName: 'Validate ESRP usage (Non-Windows)'
47+
condition: and(succeeded(), ne(variables['Agent.Os'], 'Windows_NT'))
48+
2449
- task: MicroBuildSigningPlugin@4
2550
displayName: Install MicroBuild plugin
2651
inputs:
2752
signType: $(_SignType)
2853
zipSources: false
2954
feedSource: https://dnceng.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json
30-
${{ if and(eq(parameters.enableMicrobuildForMacAndLinux, 'true'), ne(variables['Agent.Os'], 'Windows_NT')) }}:
31-
azureSubscription: 'MicroBuild Signing Task (DevDiv)'
32-
useEsrpCli: true
33-
${{ elseif eq(variables['System.TeamProject'], 'DevDiv') }}:
34-
ConnectedPMEServiceName: 6cc74545-d7b9-4050-9dfa-ebefcc8961ea
35-
${{ else }}:
36-
ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca
55+
${{ if eq(parameters.microbuildUseESRP, true) }}:
56+
${{ if eq(parameters.enableMicrobuildForMacAndLinux, 'true') }}:
57+
azureSubscription: 'MicroBuild Signing Task (DevDiv)'
58+
useEsrpCli: true
59+
${{ elseif eq(variables['System.TeamProject'], 'DevDiv') }}:
60+
ConnectedPMEServiceName: 6cc74545-d7b9-4050-9dfa-ebefcc8961ea
61+
${{ else }}:
62+
ConnectedPMEServiceName: 248d384a-b39b-46e3-8ad5-c2c210d5e7ca
3763
env:
3864
TeamName: $(_TeamName)
3965
MicroBuildOutputFolderOverride: ${{ parameters.microBuildOutputFolder }}

src/arcade/global.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
"dotnet": "10.0.100-preview.7.25322.101"
1313
},
1414
"msbuild-sdks": {
15-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25367.3",
16-
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25367.3",
15+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25367.5",
16+
"Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25367.5",
1717
"Microsoft.Build.NoTargets": "3.7.0"
1818
}
1919
}

src/arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/MSTest/MSTest.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<PropertyGroup>
55
<UseMSTestMetaPackage Condition=" '$(UseMSTestMetaPackage)' == '' ">false</UseMSTestMetaPackage>
66
<UseMSTestSdk Condition=" '$(UseMSTestSdk)' == '' ">false</UseMSTestSdk>
7-
<UseMSTestRunner Condition=" '$(UseMSTestRunner)' == '' ">false</UseMSTestRunner>
7+
<EnableMSTestRunner Condition=" '$(EnableMSTestRunner)' == '' ">false</EnableMSTestRunner>
88
</PropertyGroup>
99

1010
<Target Name="_MSTestValidatePackageDeps" BeforeTargets="Build">
@@ -26,7 +26,7 @@
2626
<PackageReference Include="MSTest" Version="$(MSTestVersion)" IsImplicitlyDefined="true" PrivateAssets="all" Publish="true" />
2727
</ItemGroup>
2828

29-
<Import Project="..\VSTest.targets" Condition=" '$(UseMSTestRunner)' == 'false' " />
30-
<Import Project="..\Microsoft.Testing.Platform.targets" Condition=" '$(UseMSTestRunner)' == 'true' " />
29+
<Import Project="..\VSTest.targets" Condition=" '$(EnableMSTestRunner)' == 'false' " />
30+
<Import Project="..\Microsoft.Testing.Platform\Microsoft.Testing.Platform.targets" Condition=" '$(EnableMSTestRunner)' == 'true' " />
3131

3232
</Project>

src/arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Testing.Platform.targets renamed to src/arcade/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Testing.Platform/Microsoft.Testing.Platform.targets

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,19 @@
55
<PropertyGroup>
66
<_TestEnvironment>%(TestToRun.EnvironmentDisplay)</_TestEnvironment>
77
<_TestAssembly>%(TestToRun.Identity)</_TestAssembly>
8+
<_TestRunner>%(TestToRun.RunCommand)</_TestRunner>
89
<_TestRuntime>%(TestToRun.TestRuntime)</_TestRuntime>
910
<_TestTimeout>%(TestToRun.TestTimeout)</_TestTimeout>
10-
<_TestRunnerAdditionalArguments>%(TestToRun.TestRunnerAdditionalArguments)</_TestRunnerAdditionalArguments>
11-
</PropertyGroup>
11+
<_TestRunnerAdditionalArguments>$(TestToRun.RunArguments) %(TestToRun.TestRunnerAdditionalArguments)</_TestRunnerAdditionalArguments>
1212

13-
<PropertyGroup>
1413
<_TestResultDirectory>$([System.IO.Path]::GetDirectoryName('%(TestToRun.ResultsTrxPath)'))</_TestResultDirectory>
1514
<_TestResultTrxFileName>$([System.IO.Path]::GetFileName('%(TestToRun.ResultsTrxPath)'))</_TestResultTrxFileName>
16-
</PropertyGroup>
17-
18-
<PropertyGroup Condition="'$(_TestRuntime)' == 'Core'">
19-
<_TargetFileNameNoExt>$([System.IO.Path]::GetFileNameWithoutExtension('$(_TestAssembly)'))</_TargetFileNameNoExt>
20-
<_TargetDir>$([System.IO.Path]::GetDirectoryName('$(_TestAssembly)'))\</_TargetDir>
21-
<_CoreRuntimeConfigPath>$(_TargetDir)$(_TargetFileNameNoExt).runtimeconfig.json</_CoreRuntimeConfigPath>
22-
<_CoreDepsPath>$(_TargetDir)$(_TargetFileNameNoExt).deps.json</_CoreDepsPath>
23-
24-
<_TestRunner Condition="'%(TestToRun.Architecture)'=='x86' And Exists('$(DotNetRoot)x86\dotnet.exe')">$(DotNetRoot)x86\dotnet.exe</_TestRunner>
25-
<_TestRunner Condition="'$(_TestRunner)'==''">$(DotNetTool)</_TestRunner>
26-
27-
<_TestRunnerArgs>exec --depsfile "$(_CoreDepsPath)" --runtimeconfig "$(_CoreRuntimeConfigPath)" $(TestRuntimeAdditionalArguments) "$(_TestAssembly)" --report-trx --report-trx-filename "$(_TestResultTrxFileName)" --results-directory "$(_TestResultDirectory)" $(_TestRunnerAdditionalArguments)</_TestRunnerArgs>
28-
</PropertyGroup>
29-
30-
<PropertyGroup Condition="'$(_TestRuntime)' != 'Core'">
31-
<_TestRunner Condition="'$(_TestRunner)'==''">$(_TestAssembly)</_TestRunner>
32-
<_TestRunnerArgs>--results-directory "$(_TestResultDirectory)" $(_TestRunnerAdditionalArguments)</_TestRunnerArgs>
15+
<_TestRunnerArgs>"$(_TestRunner)" $(_TestRunnerAdditionalArguments) --no-progress --report-trx --report-trx-filename "$(_TestResultTrxFileName)" --results-directory "$(_TestResultDirectory)"</_TestRunnerArgs>
3316
</PropertyGroup>
3417

3518
<!-- Validate that non-Core workloads use executable files, not DLL files -->
36-
<Error Condition="'$(_TestRuntime)' != 'Core' and !$(_TestAssembly.EndsWith('.exe', StringComparison.OrdinalIgnoreCase))"
37-
Text="Microsoft.Testing.Platform runner requires an executable (.exe) file (for non-.NET workloads), but was given: '$(_TestAssembly)'. Please set &lt;OutputType&gt;Exe&lt;/OutputType&gt; in your project file." />
19+
<Error Condition="'$(_TestRuntime)' != 'Core' and !$(_TestRunner.EndsWith('.exe', StringComparison.OrdinalIgnoreCase))"
20+
Text="Microsoft.Testing.Platform runner requires an executable (.exe) file (for non-.NET workloads), but was given: '$(_TestRunner)'. Please set &lt;OutputType&gt;Exe&lt;/OutputType&gt; in your project file." />
3821

3922
<PropertyGroup>
4023
<_TestRunnerCommand>"$(_TestRunner)" $(_TestRunnerArgs)</_TestRunnerCommand>

src/arcade/src/Microsoft.DotNet.Build.Tasks.Installers/src/CreateWixBuildWixpack.cs

Lines changed: 45 additions & 4 deletions
B2EA
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
using Microsoft.Build.Framework;
5+
using Microsoft.Build.Utilities;
46
using System;
57
using System.Collections.Generic;
68
using System.IO;
79
using System.IO.Compression;
810
using System.Linq;
911
using System.Text;
12+
using System.Text.RegularExpressions;
1013
using System.Xml.Linq;
11-
using Microsoft.Build.Framework;
12-
using Microsoft.Build.Utilities;
1314

1415
namespace Microsoft.DotNet.Build.Tasks.Installers
1516
{
@@ -58,6 +59,7 @@ public class CreateWixBuildWixpack : Task
5859
public string WixpackWorkingDir { get; set; }
5960

6061
private Dictionary<string, string> _defineConstantsDictionary;
62+
private Dictionary<string, string> _defineVariablesDictionary;
6163
private string _wixprojDir;
6264
private string _installerFilename;
6365

@@ -99,9 +101,10 @@ public override bool Execute()
99101
throw new InvalidOperationException("ProjectPath not defined in DefineConstants. Task cannot proceed.");
100102
}
101103

104+
CopyIncludeSearchPathsContents();
105+
ProcessIncludeFiles();
102106
CopySourceFilesAndContent();
103107
CopyExtensions();
104-
CopyIncludeSearchPathsContents();
105108
UpdatePaths();
106109
GenerateWixBuildCommandLineFile();
107110
CreateWixpackPackage();
@@ -155,6 +158,42 @@ private void CopyIncludeSearchPathsContents()
155158
}
156159
}
157160

161+
private void ProcessIncludeFiles()
162+
{
163+
_defineVariablesDictionary = new Dictionary<string, string>(System.StringComparer.OrdinalIgnoreCase);
164+
foreach (var includeFile in Directory.GetFiles(WixpackWorkingDir, "*.wxi", SearchOption.AllDirectories))
165+
{
166+
try
167+
{
168+
// We're processing a Wix include file, which contains preprocessor elements
169+
// in the format <?define KEY="value"?>
170+
// It can also contain XML comments that we need to remove, so we don't ingest
171+
// variables from elements that are commented out.
172+
173+
XDocument xmlDocument = XDocument.Load(includeFile);
174+
xmlDocument.DescendantNodes()
175+
.OfType<XComment>()
176+
.ToList()
177+
.ForEach(comment => comment.Remove());
178+
179+
// We use regular expressions to process wix preprocessor defines
180+
var regex = new Regex(@"<\?define\s+(\w+)\s*=\s*""([^""]*)""\s*\?>");
181+
182+
foreach (Match match in regex.Matches(xmlDocument.ToString()))
183+
{
184+
if (match.Groups.Count == 3)
185+
{
186+
_defineVariablesDictionary[match.Groups[1].Value] = match.Groups[2].Value;
187+
}
188+
}
189+
}
190+
catch (Exception ex)
191+
{
192+
Log.LogError($"Error processing include file {includeFile}: {ex.Message}");
193+
}
194+
}
195+
}
196+
158197
private void UpdatePaths()
159198
{
160199
// Update ProjectDir to just '.'
@@ -475,8 +514,10 @@ private string ResolvePath(string path)
475514
}
476515

477516
var varName = path.Substring(startIdx + 2, endIdx - (startIdx + 2));
478-
if (_defineConstantsDictionary.TryGetValue(varName, out var varValue))
517+
if (_defineConstantsDictionary.TryGetValue(varName, out var varValue) ||
518+
_defineVariablesDictionary.TryGetValue(varName, out varValue))
479519
{
520+
480521
path = path.Substring(0, startIdx) + varValue + path.Substring(endIdx + 1);
481522
}
482523
else

0 commit comments

Comments
 (0)
0