Skip to content

Commit d795fb1

Browse files
[main] Source code updates from dotnet/dotnet (#477)
* [VMR] Codeflow 37a16c7-37a16c7 [[ commit created by automation ]] * Update dependencies from https://github.com/dotnet/dotnet build 266496 * Update dependencies from https://github.com/dotnet/dotnet build 266608 * Update dependencies from https://github.com/dotnet/dotnet build 266652 * Update source-build.yml * Remove publishing parameters from YML --------- Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com> Co-authored-by: Viktor Hofer <[email protected]>
1 parent 6adf772 commit d795fb1

File tree

8 files changed

+89
-41
lines changed

8 files changed

+89
-41
lines changed

.vsts.pipelines/builds/ci-public.yml

-6
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@ stages:
2828
jobs:
2929
- template: /eng/common/templates/jobs/jobs.yml
3030
parameters:
31-
enablePublishUsingPipelines: true
32-
enablePublishBuildAssets: true
33-
artifacts:
34-
publish:
35-
artifacts: true
36-
manifests: true
3731
jobs:
3832
- job: SourceBuild_Managed
3933
displayName: Source-Build (Managed)

.vsts.pipelines/builds/ci.yml

-6
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ extends:
4949
jobs:
5050
- template: /eng/common/templates-official/jobs/jobs.yml@self
5151
parameters:
52-
enablePublishUsingPipelines: true
53-
enablePublishBuildAssets: true
54-
artifacts:
55-
publish:
56-
artifacts: true
57-
manifests: true
5852
jobs:
5953
- job: SourceBuild_Managed
6054
displayName: Source-Build (Managed)

eng/Version.Details.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Dependencies>
3-
<Source Uri="https://github.com/dotnet/dotnet" Mapping="source-build-externals" Sha="78c5fa9a48d469a19ab5a61c16c955c1f370b5be" BarId="266331" />
3+
<Source Uri="https://github.com/dotnet/dotnet" Mapping="source-build-externals" Sha="3b83017bbef1dd0918f7c2f894cfd07f56bcd689" BarId="266652" />
44
<ToolsetDependencies>
55
<Dependency Name="Microsoft.Build" Version="17.14.0-preview-24619-01">
66
<Uri>https://github.com/dotnet/msbuild</Uri>
77
<Sha>e9b99f554a3c298e1106ea171f5a0462780af2c5</Sha>
88
</Dependency>
9-
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25229.109">
9+
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25251.105">
1010
<Uri>https://github.com/dotnet/dotnet</Uri>
11-
<Sha>78c5fa9a48d469a19ab5a61c16c955c1f370b5be</Sha>
11+
<Sha>3b83017bbef1dd0918f7c2f894cfd07f56bcd689</Sha>
1212
</Dependency>
1313
</ToolsetDependencies>
1414
</Dependencies>

eng/common/core-templates/jobs/source-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ parameters:
1414
# This is the default platform provided by Arcade, intended for use by a managed-only repo.
1515
defaultManagedPlatform:
1616
name: 'Managed'
17-
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
17+
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream-10-amd64'
1818

1919
# Defines the platforms on which to run build jobs. One job is created for each platform, and the
2020
# object in this array is sent to the job template as 'platform'. If no platforms are specified,

eng/common/core-templates/steps/source-build.yml

+1-23
Original file line numberDiff line numberDiff line change
@@ -66,24 +66,14 @@ steps:
6666
baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}'
6767
fi
6868
69-
publishArgs=
70-
if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then
71-
publishArgs='--publish'
72-
fi
73-
74-
assetManifestFileName=SourceBuild_RidSpecific.xml
75-
if [ '${{ parameters.platform.name }}' != '' ]; then
76-
assetManifestFileName=SourceBuild_${{ parameters.platform.name }}.xml
77-
fi
78-
7969
portableBuildArgs=
8070
if [ '${{ parameters.platform.portableBuild }}' != '' ]; then
8171
portableBuildArgs='/p:PortableBuild=${{ parameters.platform.portableBuild }}'
8272
fi
8373
8474
${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \
8575
--configuration $buildConfig \
86-
--restore --build --pack $publishArgs -bl \
76+
--restore --build --pack -bl \
8777
${{ parameters.platform.buildArguments }} \
8878
$officialBuildArgs \
8979
$internalRuntimeDownloadArgs \
@@ -94,7 +84,6 @@ steps:
9484
$portableBuildArgs \
9585
/p:DotNetBuildSourceOnly=true \
9686
/p:DotNetBuildRepo=true \
97-
/p:AssetManifestFileName=$assetManifestFileName
9887
displayName: Build
9988

10089
# Upload build logs for diagnosis.
@@ -121,14 +110,3 @@ steps:
121110
continueOnError: true
122111
condition: succeededOrFailed()
123112
sbomEnabled: false # we don't need SBOM for logs
124-
125-
# Manually inject component detection so that we can ignore the source build upstream cache, which contains
126-
# a nupkg cache of input packages (a local feed).
127-
# This path must match the upstream cache path in property 'CurrentRepoSourceBuiltNupkgCacheDir'
128-
# in src\Microsoft.DotNet.Arcade.Sdk\tools\SourceBuild\SourceBuildArcade.targets
129-
- template: /eng/common/core-templates/steps/component-governance.yml
130-
parameters:
131-
displayName: Component Detection (Exclude upstream cache)
132-
is1ESPipeline: ${{ parameters.is1ESPipeline }}
133-
componentGovernanceIgnoreDirectories: '$(Build.SourcesDirectory)/artifacts/sb/src/artifacts/obj/source-built-upstream-cache'
134-
disableComponentGovernance: ${{ eq(variables['System.TeamProject'], 'public') }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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+
using System.IO;
5+
using System.Linq;
6+
using System.Xml.Linq;
7+
using Microsoft.Build.Framework;
8+
using Microsoft.Build.Utilities;
9+
10+
namespace Microsoft.DotNet.Build.Tasks
11+
{
12+
/// <summary>
13+
/// This task adds a source to a well-formed NuGet.Config file with highest
14+
/// priority, or replaces a source with the same name if present. The task
15+
/// also by default adds a 'clear' element if none exists, to avoid
16+
/// unintended leaks from the build environment.
17+
/// </summary>
18+
public class AddSourceToNuGetConfig : Task
19+
{
20+
[Required]
21+
public string NuGetConfigFile { get; set; }
22+
23+
[Required]
24+
public string SourceName { get; set; }
25+
26+
[Required]
27+
public string SourcePath { get; set; }
28+
29+
public bool SkipEnsureClear { get; set; }
30+
31+
public override bool Execute()
32+
{
33+
XDocument document = XDocument.Load(NuGetConfigFile);
34+
35+
XName CreateQualifiedName(string plainName)
36+
{
37+
return document.Root.GetDefaultNamespace().GetName(plainName);
38+
}
39+
40+
XElement packageSourcesElement = document.Root
41+
.Element(CreateQualifiedName("packageSources"));
42+
43+
var sourceElementToAdd = new XElement(
44+
"add",
45+
new XAttribute("key", SourceName),
46+
new XAttribute("value", SourcePath));
47+
48+
XElement existingSourceElement = packageSourcesElement
49+
.Elements(CreateQualifiedName("add"))
50+
.FirstOrDefault(e => e.Attribute("key").Value == SourceName);
51+
52+
XElement lastClearElement = packageSourcesElement
53+
.Elements(CreateQualifiedName("clear"))
54+
.LastOrDefault();
55+
56+
if (existingSourceElement != null)
57+
{
58+
existingSourceElement.ReplaceWith(sourceElementToAdd);
59+
}
60+
else if (lastClearElement != null)
61+
{
62+
lastClearElement.AddAfterSelf(sourceElementToAdd);
63+
}
64+
else
65+
{
66+
packageSourcesElement.AddFirst(sourceElementToAdd);
67+
}
68+
69+
if (lastClearElement == null && !SkipEnsureClear)
70+
{
71+
packageSourcesElement.AddFirst(new XElement("clear"));
72+
}
73+
74+
using (var fs = new FileStream(NuGetConfigFile, FileMode.Create, FileAccess.ReadWrite))
75+
{
76+
document.Save(fs);
77+
}
78+
79+
return !Log.HasLoggedErrors;
80+
}
81+
}
82+
}

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"dotnet": "10.0.100-preview.3.25201.16"
44
},
55
"msbuild-sdks": {
6-
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25229.109"
6+
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25251.105"
77
}
88
}

repo-projects/Directory.Build.targets

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<NuGetConfigFile Condition="'$(NuGetConfigFile)' == '' and Exists('$(ProjectDirectory)src\NuGet.Config')">$(ProjectDirectory)src\NuGet.Config</NuGetConfigFile>
88
</PropertyGroup>
99

10-
<UsingTask TaskName="Microsoft.DotNet.Arcade.Sdk.SourceBuild.AddSourceToNuGetConfig" AssemblyFile="$(ArcadeSdkBuildTasksAssembly)" />
10+
<UsingTask TaskName="AddSourceToNuGetConfig" AssemblyFile="$(XPlatSourceBuildTasksAssembly)" />
1111
<UsingTask TaskName="UpdateJson" AssemblyFile="$(XPlatSourceBuildTasksAssembly)" />
1212

1313
<Target Name="BuildRepoReferences" Condition="'@(RepositoryReference)' != '' and '$(SkipRepoReferences)' != 'true'">

0 commit comments

Comments
 (0)