Browse Source

Update to NuGet 2.8.5

Adds support for the new .NET Core target frameworks:

core50 - Target framework that is compatible with the Core CLR.
dnx452 - DNX-based apps using the full 4.5.2 version of the framework
dnx46 - DNX-based apps using the full 4.6 version of the framework
dnxcore50 - DNX-based apps using the Core 5.0 version of the framework
4.x
Matt Ward 11 years ago
parent
commit
39bf891c3e
  1. 69
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs
  2. 14
      src/AddIns/Misc/PackageManagement/Project/Src/PackageSourceConverter.cs
  3. 10
      src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs
  4. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/Microsoft.Web.XmlTransform.dll
  5. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Console.Types.dll
  6. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll
  7. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.exe

69
src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs

@ -3,23 +3,25 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using NuGet; using NuGet;
namespace ICSharpCode.PackageManagement.Design namespace ICSharpCode.PackageManagement.Design
{ {
public class FakeSettings : ISettings public class FakeSettings : ISettings
{ {
public List<KeyValuePair<string, string>> PackageSources public List<SettingValue> PackageSources
= new List<KeyValuePair<string, string>>(); = new List<SettingValue> ();
public List<KeyValuePair<string, string>> DisabledPackageSources public List<SettingValue> DisabledPackageSources
= new List<KeyValuePair<string, string>>(); = new List<SettingValue> ();
public List<KeyValuePair<string, string>> ActivePackageSourceSettings = public List<SettingValue> ActivePackageSourceSettings =
new List<KeyValuePair<string, string>>(); new List<SettingValue> ();
public Dictionary<string, IList<KeyValuePair<string, string>>> Sections public Dictionary<string, IList<SettingValue>> Sections
= new Dictionary<string, IList<KeyValuePair<string, string>>>(); = new Dictionary<string, IList<SettingValue>> ();
public FakeSettings() public FakeSettings()
{ {
@ -28,29 +30,29 @@ namespace ICSharpCode.PackageManagement.Design
Sections.Add(RegisteredPackageSourceSettings.DisabledPackageSourceSectionName, DisabledPackageSources); Sections.Add(RegisteredPackageSourceSettings.DisabledPackageSourceSectionName, DisabledPackageSources);
} }
public string GetValue(string section, string key) public string GetValue(string section, string key, bool isPath)
{ {
if (!Sections.ContainsKey(section)) if (!Sections.ContainsKey(section))
return null; return null;
IList<KeyValuePair<string, string>> values = Sections[section]; IList<SettingValue> values = Sections[section];
foreach (KeyValuePair<string, string> keyPair in values) { foreach (SettingValue setting in values) {
if (keyPair.Key == key) { if (setting.Key == key) {
return keyPair.Value; return setting.Value;
} }
} }
return null; return null;
} }
public IList<KeyValuePair<string, string>> GetValues(string section) public IList<SettingValue> GetValues(string section, bool isPath)
{ {
return Sections[section]; return Sections[section];
} }
public void AddFakePackageSource(PackageSource packageSource) public void AddFakePackageSource(PackageSource packageSource)
{ {
var valuePair = new KeyValuePair<string, string>(packageSource.Name, packageSource.Source); var setting = new SettingValue (packageSource.Name, packageSource.Source, false);
PackageSources.Add(valuePair); PackageSources.Add(setting);
} }
public Dictionary<string, KeyValuePair<string, string>> SavedSectionValues = public Dictionary<string, KeyValuePair<string, string>> SavedSectionValues =
@ -115,8 +117,8 @@ namespace ICSharpCode.PackageManagement.Design
public void SetFakeActivePackageSource(PackageSource packageSource) public void SetFakeActivePackageSource(PackageSource packageSource)
{ {
ActivePackageSourceSettings.Clear(); ActivePackageSourceSettings.Clear();
var valuePair = new KeyValuePair<string, string>(packageSource.Name, packageSource.Source); var setting = new SettingValue(packageSource.Name, packageSource.Source, false);
ActivePackageSourceSettings.Add(valuePair); ActivePackageSourceSettings.Add(setting);
} }
public void MakeActivePackageSourceSectionNull() public void MakeActivePackageSourceSectionNull()
@ -138,20 +140,20 @@ namespace ICSharpCode.PackageManagement.Design
} }
} }
public IList<KeyValuePair<string, string>> GetNestedValues(string section, string key) public IList<SettingValue> GetNestedValues(string section, string key)
{ {
throw new NotImplementedException(); return new List<SettingValue>();
} }
public void SetNestedValues(string section, string key, IList<KeyValuePair<string, string>> values) public virtual void SetNestedValues(string section, string key, IList<KeyValuePair<string, string>> values)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public void AddDisabledPackageSource(PackageSource packageSource) public void AddDisabledPackageSource(PackageSource packageSource)
{ {
var valuePair = new KeyValuePair<string, string>(packageSource.Name, packageSource.Source); var setting = new SettingValue(packageSource.Name, packageSource.Source, false);
DisabledPackageSources.Add(valuePair); DisabledPackageSources.Add(setting);
} }
public IList<KeyValuePair<string, string>> GetValuesPassedToSetValuesForDisabledPackageSourcesSection() public IList<KeyValuePair<string, string>> GetValuesPassedToSetValuesForDisabledPackageSourcesSection()
@ -165,10 +167,10 @@ namespace ICSharpCode.PackageManagement.Design
} }
} }
public void SetPackageRestoreSetting(bool enabled) public virtual void SetPackageRestoreSetting(bool enabled)
{ {
var items = new List<KeyValuePair<string, string>>(); var items = new List<SettingValue> ();
items.Add(new KeyValuePair<string, string>("enabled", enabled.ToString())); items.Add(new SettingValue("enabled", enabled.ToString(), false));
Sections.Add("packageRestore", items); Sections.Add("packageRestore", items);
} }
@ -182,20 +184,5 @@ namespace ICSharpCode.PackageManagement.Design
return SectionsDeleted.Contains("packageRestore"); return SectionsDeleted.Contains("packageRestore");
} }
} }
public string GetValue(string section, string key, bool isPath)
{
throw new NotImplementedException();
}
public IList<KeyValuePair<string, string>> GetValues(string section, bool isPath)
{
throw new NotImplementedException();
}
public IList<SettingValue> GetSettingValues(string section, bool isPath)
{
throw new NotImplementedException();
}
} }
} }

14
src/AddIns/Misc/PackageManagement/Project/Src/PackageSourceConverter.cs

@ -10,16 +10,16 @@ namespace ICSharpCode.PackageManagement
{ {
public static class PackageSourceConverter public static class PackageSourceConverter
{ {
public static IEnumerable<PackageSource> ConvertFromKeyValuePairs(IEnumerable<KeyValuePair<string, string>> packageSources) public static IEnumerable<PackageSource> ConvertFromSettings(IEnumerable<SettingValue> packageSources)
{ {
if (HasAny(packageSources)) { if (HasAny(packageSources)) {
foreach (KeyValuePair<string, string> packageSource in packageSources) { foreach (SettingValue packageSource in packageSources) {
yield return CreatePackageSourceFromKeyValuePair(packageSource); yield return CreatePackageSourceFromSetting(packageSource);
} }
} }
} }
static bool HasAny(IEnumerable<KeyValuePair<string, string>> packageSources) static bool HasAny(IEnumerable<SettingValue> packageSources)
{ {
if (packageSources != null) { if (packageSources != null) {
return packageSources.Any(); return packageSources.Any();
@ -27,17 +27,17 @@ namespace ICSharpCode.PackageManagement
return false; return false;
} }
static PackageSource CreatePackageSourceFromKeyValuePair(KeyValuePair<string, string> savedPackageSource) static PackageSource CreatePackageSourceFromSetting(SettingValue savedPackageSource)
{ {
string source = savedPackageSource.Value; string source = savedPackageSource.Value;
string name = savedPackageSource.Key; string name = savedPackageSource.Key;
return new PackageSource(source, name); return new PackageSource(source, name);
} }
public static PackageSource ConvertFromFirstKeyValuePair(IEnumerable<KeyValuePair<string, string>> packageSources) public static PackageSource ConvertFromFirstSetting(IEnumerable<SettingValue> packageSources)
{ {
if (HasAny(packageSources)) { if (HasAny(packageSources)) {
return CreatePackageSourceFromKeyValuePair(packageSources.First()); return CreatePackageSourceFromSetting(packageSources.First());
} }
return null; return null;
} }

10
src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs

@ -38,8 +38,8 @@ namespace ICSharpCode.PackageManagement
void ReadActivePackageSource() void ReadActivePackageSource()
{ {
IList<KeyValuePair<string, string>> packageSources = settings.GetValues(ActivePackageSourceSectionName); IList<SettingValue> packageSources = settings.GetValues(ActivePackageSourceSectionName, false);
activePackageSource = PackageSourceConverter.ConvertFromFirstKeyValuePair(packageSources); activePackageSource = PackageSourceConverter.ConvertFromFirstSetting(packageSources);
} }
public RegisteredPackageSources PackageSources { public RegisteredPackageSources PackageSources {
@ -64,8 +64,8 @@ namespace ICSharpCode.PackageManagement
IEnumerable<PackageSource> GetPackageSourcesFromSettings() IEnumerable<PackageSource> GetPackageSourcesFromSettings()
{ {
IList<KeyValuePair<string, string>> savedPackageSources = settings.GetValues(PackageSourcesSectionName); IList<SettingValue> savedPackageSources = settings.GetValues(PackageSourcesSectionName, false);
foreach (PackageSource packageSource in PackageSourceConverter.ConvertFromKeyValuePairs(savedPackageSources)) { foreach (PackageSource packageSource in PackageSourceConverter.ConvertFromSettings(savedPackageSources)) {
packageSource.IsEnabled = IsPackageSourceEnabled(packageSource); packageSource.IsEnabled = IsPackageSourceEnabled(packageSource);
yield return packageSource; yield return packageSource;
} }
@ -73,7 +73,7 @@ namespace ICSharpCode.PackageManagement
bool IsPackageSourceEnabled(PackageSource packageSource) bool IsPackageSourceEnabled(PackageSource packageSource)
{ {
string disabled = settings.GetValue(DisabledPackageSourceSectionName, packageSource.Name); string disabled = settings.GetValue(DisabledPackageSourceSectionName, packageSource.Name, false);
return String.IsNullOrEmpty(disabled); return String.IsNullOrEmpty(disabled);
} }

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/Microsoft.Web.XmlTransform.dll

Binary file not shown.

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Console.Types.dll

Binary file not shown.

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll

Binary file not shown.

BIN
src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.exe

Binary file not shown.
Loading…
Cancel
Save