Skip to content

Commit 171339d

Browse files
authored
Merge branch 'main' into dev/jorobich/format-remove-msbuildlocator
2 parents baa2530 + fa511bd commit 171339d

File tree

6 files changed

+361
-283
lines changed

6 files changed

+361
-283
lines changed

eng/Version.Details.xml

Lines changed: 202 additions & 202 deletions
Large diffs are not rendered by default.

eng/Versions.props

Lines changed: 76 additions & 76 deletions
Large diffs are not rendered by default.

eng/pipelines/templates/variables/vmr-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ variables:
8686
- ${{ elseif eq(variables['Build.Reason'], 'PullRequest') }}:
8787
- name: signEnabled
8888
value: true
89-
# Pass sign on the internal project if the, branch is a main or release branch
90-
- ${{ elseif and(eq(variables['System.TeamProject'], 'internal'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), and(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), contains(variables['Build.SourceBranch'], '-preview')))) }}:
89+
# Pass sign on the internal project if the, branch is a release branch
90+
- ${{ elseif and(eq(variables['System.TeamProject'], 'internal'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) }}:
9191
- name: signEnabled
9292
value: true
9393
# Do not sign otherwise.
@@ -104,7 +104,7 @@ variables:
104104
value: false
105105
# Otherwise, sign if the branch is a release branch.
106106
# We can't sign the DAC in main because the certificates are locked down.
107-
- ${{ elseif and(eq(variables['System.TeamProject'], 'internal'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/reltest/'), and(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), contains(variables['Build.SourceBranch'], '-preview')))) }}:
107+
- ${{ elseif and(eq(variables['System.TeamProject'], 'internal'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'))) }}:
108108
- name: signDacEnabled
109109
value: true
110110
- ${{ else }}:

src/SourceBuild/content/eng/pipelines/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ parameters:
3333
- name: desiredSigning
3434
displayName: 'Sign?'
3535
type: string
36-
default: 'Default (unsigned for manual and non-main/release builds)'
36+
default: 'Default (unsigned for non release-branch builds)'
3737
values:
3838
- Signed
3939
- Unsigned
40-
- Default (unsigned for manual and non-main/release builds)
40+
- Default (unsigned for non release-branch builds)
4141

4242
- name: desiredIBC
4343
displayName: 'Enable IBC?'
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Licensed to the .NET Foundation under one or more agreements.
2+
// The .NET Foundation licenses this file to you under the MIT license.
3+
4+
namespace Microsoft.NET.Build.Tests
5+
{
6+
public class EvaluatorFastPathTests : SdkTest
7+
{
8+
public EvaluatorFastPathTests(ITestOutputHelper log) : base(log)
9+
{
10+
11+
}
12+
13+
[Fact]
14+
public void FastPathDoesNotNeedReflection()
15+
{
16+
var testAsset = _testAssetsManager
17+
.CopyTestAsset("MSBuildBareBonesProject")
18+
.WithSource();
19+
var command = new MSBuildCommand(testAsset, string.Empty);
20+
command
21+
.WithEnvironmentVariable("MSBuildLogPropertyFunctionsRequiringReflection", "true")
22+
.WithWorkingDirectory(testAsset.Path);
23+
command
24+
.ExecuteWithoutRestore()
25+
.Should()
26+
.Pass();
27+
28+
var logPath = Path.Combine(testAsset.Path, "PropertyFunctionsRequiringReflection");
29+
File.Exists(logPath).Should().BeFalse();
30+
}
31+
32+
[Theory]
33+
[InlineData("console")]
34+
[InlineData("webapp")]
35+
public void EnsureDotnetCommonProjectPropertyFunctionsOnFastPath(string alias)
36+
{
37+
var testDir = _testAssetsManager.CreateTestDirectory().Path;
38+
39+
new DotnetNewCommand(Log, alias)
40+
.WithoutCustomHive()
41+
.WithWorkingDirectory(testDir)
42+
.Execute()
43+
.Should()
44+
.Pass();
45+
46+
new DotnetBuildCommand(Log)
47+
.WithWorkingDirectory(testDir)
48+
.WithEnvironmentVariable("MSBuildLogPropertyFunctionsRequiringReflection", "true")
49+
.Execute()
50+
.Should()
51+
.Pass();
52+
53+
var logPath = Path.Combine(testDir, "PropertyFunctionsRequiringReflection");
54+
// Functions from Microsoft.Build.Utilities.ToolLocationHelper are pending to add fast path, tracked by https://github.com/dotnet/msbuild/issues/10411.
55+
// This verification should be changed to no log file created once it is done.
56+
var toolLocationHelper_GetPlatformSDKLocation = "ReceiverType=Microsoft.Build.Utilities.ToolLocationHelper; ObjectInstanceType=; MethodName=GetPlatformSDKLocation(String, String)";
57+
var toolLocationHelper_GetPlatformSDKDisplayName = "ReceiverType=Microsoft.Build.Utilities.ToolLocationHelper; ObjectInstanceType=; MethodName=GetPlatformSDKDisplayName(String, String)";
58+
var lines = File.ReadAllLines(logPath);
59+
var allOnFastPathWithExceptions = lines.All(l => (toolLocationHelper_GetPlatformSDKLocation.Equals(l) || toolLocationHelper_GetPlatformSDKDisplayName.Equals(l)));
60+
allOnFastPathWithExceptions.Should().BeTrue();
61+
}
62+
}
63+
}

test/TestAssets/TestProjects/MSBuildBareBonesProject/BareBones.proj

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33

4+
<PropertyGroup>
5+
<MajorMinorVersion>$([System.Version]::Parse('17.12.11.10').ToString(2))</MajorMinorVersion>
6+
<String_Replace>$([System.Text.RegularExpressions.Regex]::Replace('abc123def', 'abc', ''))</String_Replace>
7+
<String_Equals>$([System.String]::new('Hi').Equals('Hi'))</String_Equals>
8+
<FileName>$([System.IO.Path]::GetFileNameWithoutExtension('C:\folder\file.txt'))</FileName>
9+
<NumberToString>$([System.Int32]::new(123).ToString('mm')</NumberToString>
10+
<Directory>$([Microsoft.Build.Evaluation.IntrinsicFunctions]::NormalizeDirectory('C:/folder1/./folder2/'))</Directory>
11+
<IsWindows>$([Microsoft.Build.Evaluation.IntrinsicFunctions]::IsOSPlatform('Windows'))</IsWindows>
12+
<!-- Functions from Microsoft.Build.Utilities.ToolLocationHelper are pending to add fast path, tracked by https://github.com/dotnet/msbuild/issues/10411.
13+
Comment out this for testing once it's done.
14+
<PlatformSdkLocation>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKLocation('Windows', ''))</PlatformSdkLocation>
15+
<PlatformDisplayName>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPlatformSDKDisplayName('Windows', ''))</PlatformDisplayName>
16+
-->
17+
</PropertyGroup>
18+
419
<Target Name="SayHello">
520
<Message Importance="high" Text="Hello, from MSBuild!" />
621
</Target>

0 commit comments

Comments
 (0)