Reduce nuget feeds

This commit is contained in:
Nick Guerrera 2019-10-23 16:09:03 -07:00
parent bfb734dbe0
commit e7a108ab75
4 changed files with 82 additions and 26 deletions

View file

@ -3,20 +3,13 @@
<solution> <solution>
<add key="disableSourceControlIntegration" value="true" /> <add key="disableSourceControlIntegration" value="true" />
</solution> </solution>
<!-- Only specify feed for Arcade SDK (see https://github.com/Microsoft/msbuild/issues/2982) -->
<packageSources> <packageSources>
<clear /> <clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<add key="darc-pub-dotnet-core-setup-7d57652" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-core-setup-7d57652f/nuget/v3/index.json" />
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" /> <add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" /> <add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="msbuild" value="https://dotnet.myget.org/F/msbuild/api/v3/index.json" />
<add key="nuget-build" value="https://dotnet.myget.org/F/nuget-build/api/v3/index.json" /> <add key="nuget-build" value="https://dotnet.myget.org/F/nuget-build/api/v3/index.json" />
<add key="dotnet3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3/nuget/v3/index.json" />
<add key="dotnet3-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3-transport/nuget/v3/index.json" /> <add key="dotnet3-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3-transport/nuget/v3/index.json" />
<add key="dotnet3.1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1/nuget/v3/index.json" />
<add key="dotnet3.1-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json" /> <add key="dotnet3.1-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json" />
<add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" /> <add key="dotnet5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5/nuget/v3/index.json" />
<add key="dotnet5-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json" /> <add key="dotnet5-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet5-transport/nuget/v3/index.json" />

View file

@ -1,10 +1,10 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<NuGetFrameworksPackageVersion>5.0.0-preview1.5663</NuGetFrameworksPackageVersion> <NuGetFrameworksPackageVersion>5.0.0</NuGetFrameworksPackageVersion>
<MicrosoftDotNetCliUtilsPackageVersion>3.0.100-preview.18580.6</MicrosoftDotNetCliUtilsPackageVersion> <MicrosoftDotNetCliUtilsPackageVersion>$(MicrosoftDotnetToolsetInternalPackageVersion)</MicrosoftDotNetCliUtilsPackageVersion>
<MicrosoftDotNetCliCommandLinePackageVersion>0.1.1</MicrosoftDotNetCliCommandLinePackageVersion> <MicrosoftDotNetCliCommandLinePackageVersion>0.1.1</MicrosoftDotNetCliCommandLinePackageVersion>
<MicrosoftNETTestSdkPackageVersion>15.8.0</MicrosoftNETTestSdkPackageVersion> <MicrosoftNETTestSdkPackageVersion>15.8.0</MicrosoftNETTestSdkPackageVersion>
<MicrosoftDotNetPlatformAbstractionsPackageVersion>3.0.0-preview-27218-01</MicrosoftDotNetPlatformAbstractionsPackageVersion> <MicrosoftDotNetPlatformAbstractionsPackageVersion>3.0.0</MicrosoftDotNetPlatformAbstractionsPackageVersion>
<MicrosoftDotNetProjectJsonMigrationPackageVersion>1.3.1</MicrosoftDotNetProjectJsonMigrationPackageVersion> <MicrosoftDotNetProjectJsonMigrationPackageVersion>1.3.1</MicrosoftDotNetProjectJsonMigrationPackageVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View file

@ -12,6 +12,7 @@
<PreReleaseVersionLabel>preview</PreReleaseVersionLabel> <PreReleaseVersionLabel>preview</PreReleaseVersionLabel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/toolset -->
<MicrosoftDotnetToolsetInternalPackageVersion>5.0.100-alpha1.19522.14</MicrosoftDotnetToolsetInternalPackageVersion> <MicrosoftDotnetToolsetInternalPackageVersion>5.0.100-alpha1.19522.14</MicrosoftDotnetToolsetInternalPackageVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
@ -112,7 +113,7 @@
<NUnit3Templates21PackageVersion>1.5.3</NUnit3Templates21PackageVersion> <NUnit3Templates21PackageVersion>1.5.3</NUnit3Templates21PackageVersion>
<MicrosoftDotNetCommonItemTemplates21PackageVersion>1.0.2-beta3</MicrosoftDotNetCommonItemTemplates21PackageVersion> <MicrosoftDotNetCommonItemTemplates21PackageVersion>1.0.2-beta3</MicrosoftDotNetCommonItemTemplates21PackageVersion>
<MicrosoftDotNetCommonProjectTemplates21PackageVersion>$(MicrosoftDotNetCommonItemTemplates21PackageVersion)</MicrosoftDotNetCommonProjectTemplates21PackageVersion> <MicrosoftDotNetCommonProjectTemplates21PackageVersion>$(MicrosoftDotNetCommonItemTemplates21PackageVersion)</MicrosoftDotNetCommonProjectTemplates21PackageVersion>
<MicrosoftDotNetTestProjectTemplates21PackageVersion>1.0.2-beta4-20181009-2100240</MicrosoftDotNetTestProjectTemplates21PackageVersion> <MicrosoftDotNetTestProjectTemplates21PackageVersion>1.0.2-beta4.19511.1</MicrosoftDotNetTestProjectTemplates21PackageVersion>
<AspNetCorePackageVersionFor21Templates>2.1.12</AspNetCorePackageVersionFor21Templates> <AspNetCorePackageVersionFor21Templates>2.1.12</AspNetCorePackageVersionFor21Templates>
</PropertyGroup> </PropertyGroup>
<!-- infrastructure and test only dependencies --> <!-- infrastructure and test only dependencies -->
@ -127,19 +128,4 @@
<!-- pinned dependency. This package is not being produced outside of the 2.0 branch of corefx and should not change. --> <!-- pinned dependency. This package is not being produced outside of the 2.0 branch of corefx and should not change. -->
<CLI_NETStandardLibraryNETFrameworkVersion>2.0.1-servicing-26011-01</CLI_NETStandardLibraryNETFrameworkVersion> <CLI_NETStandardLibraryNETFrameworkVersion>2.0.1-servicing-26011-01</CLI_NETStandardLibraryNETFrameworkVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup>
<RestoreSources>
$(RestoreSources);
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
https://dotnet.myget.org/F/msbuild/api/v3/index.json;
https://dotnet.myget.org/F/nuget-build/api/v3/index.json;
https://dotnet.myget.org/F/templating/api/v3/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-toolset/index.json;
</RestoreSources>
</PropertyGroup>
</Project> </Project>

View file

@ -0,0 +1,77 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Text.Json;
using System.IO;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.TestFramework
{
internal class RuntimeConfigFramework
{
public string Name { get; set; }
public string Version { get; set; }
}
public class RuntimeConfig
{
public bool IsPortable { get; }
internal RuntimeConfigFramework Framework { get; }
public RuntimeConfig(string runtimeConfigPath)
{
var jsonDocumentOptions = new JsonDocumentOptions
{
AllowTrailingCommas = true,
CommentHandling = JsonCommentHandling.Skip
};
using (var stream = File.OpenRead(runtimeConfigPath))
using (JsonDocument doc = JsonDocument.Parse(stream, jsonDocumentOptions))
{
JsonElement root = doc.RootElement;
if (root.TryGetProperty("runtimeOptions", out var runtimeOptionsRoot))
{
if (runtimeOptionsRoot.TryGetProperty("framework", out var framework))
{
var runtimeConfigFramework = new RuntimeConfigFramework();
string name = null;
string version = null;
foreach (var property in framework.EnumerateObject())
{
if (property.Name.Equals("name", StringComparison.OrdinalIgnoreCase))
{
name = property.Value.GetString();
}
if (property.Name.Equals("version", StringComparison.OrdinalIgnoreCase))
{
version = property.Value.GetString();
}
}
if (name == null || version == null)
{
Framework = null;
}
else
{
Framework = new RuntimeConfigFramework
{
Name = name,
Version = version
};
}
}
else
{
Framework = null;
}
}
}
IsPortable = Framework != null;
}
}
}