Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vsts-dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ variables:
- name: SourceBranch
value: ''
- name: EnableReleaseOneLocBuild
value: true # Enable loc for vs17.13
value: false # Disable loc for vs17.13
- name: Codeql.Enabled
value: true
- group: AzureDevOps-Artifact-Feeds-Pats
Expand Down
16 changes: 8 additions & 8 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25111.5">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25164.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>5da211e1c42254cb35e7ef3d5a8428fb24853169</Sha>
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25111.5">
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25164.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>5da211e1c42254cb35e7ef3d5a8428fb24853169</Sha>
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25111.5">
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25164.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>5da211e1c42254cb35e7ef3d5a8428fb24853169</Sha>
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
</Dependency>
<Dependency Name="NuGet.Build.Tasks" Version="6.13.0-rc.93">
<Uri>https://github.com/nuget/nuget.client</Uri>
Expand All @@ -98,9 +98,9 @@
<Sha>31f8433cb625e2aa74d148005003b21d5e3f67b7</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.25111.5">
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.25164.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>5da211e1c42254cb35e7ef3d5a8428fb24853169</Sha>
<Sha>5ba9ca776c1d0bb72b2791591e54cf51fc52dfee</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
4 changes: 2 additions & 2 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<VersionPrefix>17.13.20</VersionPrefix>
<VersionPrefix>17.13.23</VersionPrefix>
<DotNetFinalVersionKind>release</DotNetFinalVersionKind>
<PackageValidationBaselineVersion>17.12.6</PackageValidationBaselineVersion>
<AssemblyVersion>15.1.0.0</AssemblyVersion>
Expand Down Expand Up @@ -62,7 +62,7 @@
Otherwise, this version of dotnet will not be installed and the build will error out. -->
<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\global.json')), '"dotnet": "([^"]*)"').Groups.get_Item(1))</DotNetCliVersion>
<MicrosoftCodeAnalysisCollectionsVersion>4.2.0-1.22102.8</MicrosoftCodeAnalysisCollectionsVersion>
<MicrosoftDotNetXUnitExtensionsVersion>9.0.0-beta.25111.5</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitExtensionsVersion>9.0.0-beta.25164.2</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftNetCompilersToolsetVersion>4.13.0-3.24607.3</MicrosoftNetCompilersToolsetVersion>
<NuGetBuildTasksVersion>6.13.0-rc.93</NuGetBuildTasksVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion eng/common/core-templates/steps/generate-sbom.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 14 additions & 6 deletions eng/common/generate-sbom-prep.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 11 additions & 6 deletions eng/common/generate-sbom-prep.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions eng/common/templates-official/job/job.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions eng/common/tools.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions eng/common/tools.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"allowPrerelease": true
},
"tools": {
"dotnet": "9.0.103",
"dotnet": "9.0.104",
"vs": {
"version": "17.12.0"
},
"xcopy-msbuild": "17.12.0"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25111.5"
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25164.2"
}
}
43 changes: 43 additions & 0 deletions src/Build.UnitTests/Evaluation/SdkResultEvaluation_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml;
using Microsoft.Build.Construction;
using Microsoft.Build.Definition;
using Microsoft.Build.Evaluation;
Expand Down Expand Up @@ -137,6 +138,48 @@ public void SdkResolverCanReturnNoPaths(bool includePropertiesAndItems)
_logger.WarningCount.ShouldBe(0);
}

[Fact]
public void SuccessfullyEvaluatesSdkResultWithPropertiesForNullProjectRootElement()
{
Dictionary<string, string> propertiesToAdd = null;
Dictionary<string, SdkResultItem> itemsToAdd = null;

CreateMockSdkResultPropertiesAndItems(out propertiesToAdd, out itemsToAdd);

var projectOptions = SdkUtilities.CreateProjectOptionsWithResolver(new SdkUtilities.ConfigurableMockSdkResolver(
new Build.BackEnd.SdkResolution.SdkResult(
new SdkReference("TestPropsAndItemsFromResolverSdk", null, null),
Enumerable.Empty<string>(),
version: null,
propertiesToAdd,
itemsToAdd,
warnings: null)));

string projectContent = @"
<Project>
<Import Project=""Sdk.props"" Sdk=""TestPropsAndItemsFromResolverSdk""/>
</Project>";

string projectPath = Path.Combine(_testFolder, "project.proj");
File.WriteAllText(projectPath, projectContent);

using XmlReader xmlReader = XmlReader.Create(projectPath);
try
{
ProjectRootElement projectRootElement = ProjectRootElement.Open(projectPath, _projectCollection);

projectOptions.ProjectCollection = _projectCollection;

// Creating project from XmlReader results in null ProjectRootElement on Evaluation phase.
// In that case project created for SdkResult properties and items is given a unique file name {Guid}.SdkResolver.{propertiesAndItemsHash}.proj in the current directory
Project.FromXmlReader(xmlReader, projectOptions);
}
catch (Exception ex)
{
Assert.Fail("Expected no exception, but got: " + ex.ToString());
}
}

[Theory]
[InlineData(true, true)]
[InlineData(true, false)]
Expand Down
9 changes: 7 additions & 2 deletions src/Build/Evaluation/Evaluator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1912,8 +1912,13 @@ private ProjectRootElement CreateProjectForSdkResult(SdkResult sdkResult)
propertiesAndItemsHash = hash.ToHashCode();
#endif

// Generate a unique filename for the generated project for each unique set of properties and items.
string projectPath = _projectRootElement.FullPath + ".SdkResolver." + propertiesAndItemsHash + ".proj";
// Generate a unique filename for the generated project for each unique set of properties and items that ends like ".SdkResolver.{propertiesAndItemsHash}.proj".
// _projectRootElement.FullPath can be null. This can be in the case when Project is created from XmlReader. For that case we generate filename like "{Guid}.SdkResolver.{propertiesAndItemsHash}.proj in the current directory.
// Oterwise the project is in the same directory as _projectRootElement and has a name of the saem project and ends like ".SdkResolver.{propertiesAndItemsHash}.proj".
string projectNameEnding = $".SdkResolver.{propertiesAndItemsHash}.proj";
string projectPath = _projectRootElement.FullPath != null ?
_projectRootElement.FullPath + projectNameEnding :
FileUtilities.NormalizePath(Guid.NewGuid() + projectNameEnding);

ProjectRootElement InnerCreate(string _, ProjectRootElementCacheBase __)
{
Expand Down
Loading