Use MSBuild to set NuGet feeds instead of NuGet.config

This commit is contained in:
Nate McMaster
2017-11-20 12:43:30 -08:00
parent 0de9f0e3ce
commit cd3e3c667c
3 changed files with 18 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
<Project> <Project>
<Import Project="version.props" /> <Import Project="version.props" />
<Import Project="build\dependencies.props" /> <Import Project="build\dependencies.props" />
<Import Project="build\sources.props" />
<PropertyGroup> <PropertyGroup>
<Product>Microsoft ASP.NET Core</Product> <Product>Microsoft ASP.NET Core</Product>

View File

@@ -2,8 +2,6 @@
<configuration> <configuration>
<packageSources> <packageSources>
<clear /> <clear />
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" /> <!-- Restore sources should be defined in build/sources.props. -->
<add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
</packageSources> </packageSources>
</configuration> </configuration>

16
build/sources.props Normal file
View File

@@ -0,0 +1,16 @@
<Project>
<Import Project="$(DotNetRestoreSourcePropsPath)" Condition="'$(DotNetRestoreSourcePropsPath)' != ''"/>
<PropertyGroup Label="RestoreSources">
<RestoreSources>$(DotNetRestoreSources)</RestoreSources>
<RestoreSources Condition="'$(DotNetBuildOffline)' != 'true' AND '$(AspNetUniverseBuildOffline)' != 'true' ">
$(RestoreSources);
https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
</RestoreSources>
<RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'">
$(RestoreSources);
https://api.nuget.org/v3/index.json;
</RestoreSources>
</PropertyGroup>
</Project>