File tree Expand file tree Collapse file tree 3 files changed +43
-2
lines changed
tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat Expand file tree Collapse file tree 3 files changed +43
-2
lines changed Original file line number Diff line number Diff line change 113
113
<NuGetConfigFiles Include =" $(NuGetConfigFile)" />
114
114
</ItemGroup >
115
115
116
- <RemoveInternetSourcesFromNuGetConfig NuGetConfigFile =" %(NuGetConfigFiles.Identity)"
117
- OfflineBuild =" $(OfflineBuild)" />
116
+ <RemoveInternetSourcesFromNuGetConfig
117
+ NuGetConfigFile =" %(NuGetConfigFiles.Identity)"
118
+ OfflineBuild =" $(OfflineBuild)"
119
+ KeepFeedPrefixes =" @(KeepFeedPrefixes)" />
118
120
119
121
<AddSourceToNuGetConfig NuGetConfigFile =" %(NuGetConfigFiles.Identity)"
120
122
SourceName =" prebuilt"
140
142
SourcePath =" $(ExtraRestoreSourcePath)"
141
143
Condition =" '$(ExtraRestoreSourcePath)' != ''" />
142
144
145
+ <!--
146
+ The internal transport feed is dynamically added by Arcade by a script called directly in the
147
+ official pipeline, so in some cases we need to do the same here.
148
+ -->
149
+ <AddSourceToNuGetConfig
150
+ Condition ="
151
+ '$(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)' != '' and
152
+ '$(SetUpInternalTransportFeed)' == 'true'"
153
+ NuGetConfigFile =" %(NuGetConfigFiles.Identity)"
154
+ SourceName =" dotnet5-internal-transport"
155
+ SourcePath =" https://pkgs.dev.azure.com/dnceng/internal/_packaging/dotnet5-internal-transport/nuget/v3/index.json" />
156
+
143
157
<!-- Update NuGet.Config files that have deprecated myget feeds -->
144
158
<ItemGroup >
145
159
<LegacyFeedMapping
Original file line number Diff line number Diff line change 63
63
<!-- This project builds zips, not NuGet packages. -->
64
64
<SkipEnsurePackagesCreated >true</SkipEnsurePackagesCreated >
65
65
<NuGetConfigFile >$(ProjectDirectory)/NuGet.config</NuGetConfigFile >
66
+
67
+ <!-- This repo uses text-only template packages from the internal transport feed. -->
68
+ <SetUpInternalTransportFeed >true</SetUpInternalTransportFeed >
66
69
</PropertyGroup >
67
70
68
71
<ItemGroup >
89
92
<RepositoryReference Include =" xliff-tasks" />
90
93
</ItemGroup >
91
94
95
+ <!--
96
+ If we have authentication, keep the templating internal feed (if one exists) to acquire the
97
+ text-only prebuilt. The source-build repo as a whole should depend on the same internal feed as
98
+ this repo does, so authentication should already be set up in the global endpoints json.
99
+ -->
100
+ <ItemGroup Condition =" '$(VSS_NUGET_EXTERNAL_FEED_ENDPOINTS)' != ''" >
101
+ <KeepFeedPrefixes Include =" darc-int-dotnet-aspnetcore-" />
102
+ </ItemGroup >
103
+
92
104
<ItemGroup >
93
105
<EnvironmentVariables Include =" CLIBUILD_SKIP_TESTS=true" />
94
106
Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ public class RemoveInternetSourcesFromNuGetConfig : Task
27
27
/// </summary>
28
28
public bool OfflineBuild { get ; set ; }
29
29
30
+ /// <summary>
31
+ /// A list of prefix strings that make the task keep a package source unconditionally. For
32
+ /// example, a source named 'darc-pub-dotnet-aspnetcore-e81033e' will be kept if the prefix
33
+ /// 'darc-pub-dotnet-aspnetcore-' is in this list.
34
+ /// </summary>
35
+ public string [ ] KeepFeedPrefixes { get ; set ; }
36
+
30
37
public override bool Execute ( )
31
38
{
32
39
XDocument d = XDocument . Load ( NuGetConfigFile ) ;
@@ -36,6 +43,14 @@ public override bool Execute()
36
43
{
37
44
if ( e . Name == "add" )
38
45
{
46
+ string feedName = e . Attribute ( "key" ) . Value ;
47
+ if ( KeepFeedPrefixes
48
+ ? . Any ( prefix => feedName . StartsWith ( prefix , StringComparison . OrdinalIgnoreCase ) )
49
+ == true )
50
+ {
51
+ return true ;
52
+ }
53
+
39
54
string feedUrl = e . Attribute ( "value" ) . Value ;
40
55
if ( OfflineBuild )
41
56
{
You can’t perform that action at this time.
0 commit comments