Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit e7f4fb0

Browse files
author
John Beisner
committed
Writing a NuGet.config as part of the preparatory steps.
1 parent e303461 commit e7f4fb0

File tree

6 files changed

+67
-24
lines changed

6 files changed

+67
-24
lines changed

NuGet.Config

Lines changed: 0 additions & 20 deletions
This file was deleted.

build.proj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@
2929
<RestoreDotnetCliBuildFrameworkOutputs Include="$(DotnetCliBuildDirectory)/obj/dotnet-cli-build.csproj.nuget.g.props" />
3030
<RestoreDotnetCliBuildFrameworkOutputs Include="$(DotnetCliBuildDirectory)/obj/dotnet-cli-build.csproj.nuget.g.targets" />
3131
</ItemGroup>
32-
32+
3333
<Target Name="RestoreDotnetCliBuildFramework"
3434
Inputs="$(DotnetCliBuildDirectory)/dotnet-cli-build.csproj"
35-
Outputs="@(RestoreDotnetCliBuildFrameworkOutputs)">
35+
Outputs="@(RestoreDotnetCliBuildFrameworkOutputs)"
36+
DependsOnTargets="WriteNugetConfigFile">
3637

3738
<PropertyGroup>
3839
<ExtraRestoreArgs>$(ExtraRestoreArgs) /p:GeneratePropsFile=$(GeneratePropsFile)</ExtraRestoreArgs>
@@ -48,6 +49,7 @@
4849
<Import Project="build/GitCommitInfo.targets" />
4950
<Import Project="build/HostInfo.targets" />
5051
<Import Project="build/BuildInfo.targets" />
52+
<Import Project="build/NugetConfigFile.targets" />
5153
<Import Project="build/Prepare.targets" />
5254
<Import Project="build/Compile.targets" />
5355
<Import Project="build/Package.targets" />

build/InitRepo.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@
44
<GitCommitInfoProps>$(GeneratedPropsDir)/GitCommitInfo.props</GitCommitInfoProps>
55
<HostInfoProps>$(GeneratedPropsDir)/HostInfo.props</HostInfoProps>
66
<BuildInfoProps>$(GeneratedPropsDir)/BuildInfo.props</BuildInfoProps>
7+
<BuildInfoProps>$(GeneratedPropsDir)/BuildInfo.props</BuildInfoProps>
8+
<GeneratedNuGetConfig>$(RepoRoot)/NuGet.Config</GeneratedNuGetConfig>
79
</PropertyGroup>
810
</Project>

build/InitRepo.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project ToolsVersion="15.0">
22
<Target Name="WriteDynamicPropsToStaticPropsFiles"
3-
DependsOnTargets="BuildDotnetCliBuildFramework;
3+
DependsOnTargets="WriteNugetConfigFile;
4+
BuildDotnetCliBuildFramework;
45
EnsureGeneratedPropsDirectory;
56
WriteGitCommitInfoProps;
67
WriteHostInfoProps;

build/NugetConfigFile.targets

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<Project ToolsVersion="15.0">
2+
<Target Name="WriteNugetConfigFile">
3+
4+
<PropertyGroup>
5+
<NugetConfigHeader>
6+
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
7+
&lt;configuration&gt;
8+
&lt;packageSources&gt;
9+
&lt;!--To inherit the global NuGet package sources remove the &lt;clear/&gt; line below --&gt;
10+
&lt;clear /&gt;
11+
</NugetConfigHeader>
12+
13+
<NugetConfigFeedsPrivate>
14+
&lt;add key=&quot;PrivateBlobFeed&quot; value=&quot;$(ExternalRestoreSources)&quot; /&gt;
15+
</NugetConfigFeedsPrivate>
16+
17+
<NugetConfigFeedsNormal>
18+
&lt;add key=&quot;BlobFeed&quot; value=&quot;https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json&quot; /&gt;
19+
&lt;add key=&quot;templating&quot; value=&quot;https://dotnet.myget.org/F/templating/api/v3/index.json&quot; /&gt;
20+
&lt;add key=&quot;aspnet&quot; value=&quot;https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json&quot; /&gt;
21+
&lt;add key=&quot;websdkfeed&quot; value=&quot;https://dotnet.myget.org/F/dotnet-web/api/v3/index.json&quot; /&gt;
22+
&lt;add key=&quot;cli-deps&quot; value=&quot;https://dotnet.myget.org/F/cli-deps/api/v3/index.json&quot; /&gt;
23+
&lt;add key=&quot;roslyn&quot; value=&quot;https://dotnet.myget.org/f/roslyn/api/v3/index.json&quot; /&gt;
24+
&lt;add key=&quot;symreader-native&quot; value=&quot;https://dotnet.myget.org/f/symreader-native/api/v3/index.json&quot; /&gt;
25+
&lt;add key=&quot;xunit&quot; value=&quot;https://www.myget.org/F/xunit/api/v3/index.json&quot; /&gt;
26+
&lt;add key=&quot;api.nuget.org&quot; value=&quot;https://api.nuget.org/v3/index.json&quot; /&gt;
27+
&lt;add key=&quot;vstest&quot; value=&quot;https://dotnet.myget.org/F/vstest/api/v3/index.json&quot; /&gt;
28+
&lt;add key=&quot;web-api&quot; value=&quot;https://dotnet.myget.org/F/dotnet-web/api/v3/index.json&quot; /&gt;
29+
&lt;add key=&quot;symreader-native&quot; value=&quot;https://dotnet.myget.org/F/symreader-native/api/v3/index.json&quot; /&gt;
30+
&lt;add key=&quot;AspNetMaster&quot; value=&quot;https://dotnet.myget.org/F/aspnetcore-master/api/v3/index.json" /&gt;
31+
</NugetConfigFeedsNormal>
32+
33+
<NugetConfigSuffix>
34+
&lt;/packageSources&gt;
35+
&lt;/configuration&gt;
36+
</NugetConfigSuffix>
37+
</PropertyGroup>
38+
39+
<WriteLinesToFile File="$(GeneratedNuGetConfig)"
40+
Lines="$(NugetConfigHeader)"
41+
Overwrite="true" />
42+
43+
<WriteLinesToFile Condition="'$(ExternalRestoreSources)' != ''"
44+
File="$(GeneratedNuGetConfig)"
45+
Lines="$(NugetConfigFeedsPrivate)"
46+
Overwrite="false" />
47+
48+
<WriteLinesToFile Condition="'$(DotNetBuildOffline)' != 'true'"
49+
File="$(GeneratedNuGetConfig)"
50+
Lines="$(NugetConfigFeedsNormal)"
51+
Overwrite="false" />
52+
53+
<WriteLinesToFile File="$(GeneratedNuGetConfig)"
54+
Lines="$(NugetConfigSuffix)"
55+
Overwrite="false" />
56+
57+
</Target>
58+
</Project>

run-build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ if ($NoBuild)
106106
}
107107
else
108108
{
109-
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles
109+
dotnet msbuild build.proj /p:Architecture=$Architecture /p:GeneratePropsFile=true /t:WriteDynamicPropsToStaticPropsFiles $ExtraParameters
110110
dotnet msbuild build.proj /m /v:normal /fl /flp:v=diag /p:Architecture=$Architecture $ExtraParameters
111111
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
112112
}

0 commit comments

Comments
 (0)