Browse Source

Update to NuGet 2.8.7

NuGet.Core has been updated to version 2.8.7 but NuGet.exe and
NuGet.Console.Types.dll have not because the builds from Microsoft
target .NET 4.5 and not 4.0
4.x
Matt Ward 10 years ago
parent
commit
44a04fca6c
  1. 9
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakePackage.cs
  2. 30
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs
  3. 5
      src/AddIns/Misc/PackageManagement/Project/Src/PackageFromRepository.cs
  4. 10
      src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs
  5. 2
      src/AddIns/Misc/PackageManagement/RequiredLibraries/COPYRIGHT.txt
  6. 8
      src/AddIns/Misc/PackageManagement/RequiredLibraries/CREDITS.txt
  7. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/Microsoft.Web.XmlTransform.dll
  8. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll
  9. 13
      src/AddIns/Misc/PackageManagement/Test/Src/PackageFromRepositoryTests.cs
  10. 34
      src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsTests.cs
  11. 5
      src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsViewModelTests.cs

9
src/AddIns/Misc/PackageManagement/Project/Src/Design/FakePackage.cs

@ -197,5 +197,14 @@ namespace ICSharpCode.PackageManagement.Design
public Uri GalleryUrl { get; set; } public Uri GalleryUrl { get; set; }
public bool DevelopmentDependency { get; set; } public bool DevelopmentDependency { get; set; }
public IFileSystem FileSystemPassedToExtractContents;
public string ExtractPathPassedToExtractContents;
public void ExtractContents(IFileSystem fileSystem, string extractPath)
{
FileSystemPassedToExtractContents = fileSystem;
ExtractPathPassedToExtractContents = extractPath;
}
} }
} }

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

@ -55,30 +55,30 @@ namespace ICSharpCode.PackageManagement.Design
PackageSources.Add(setting); PackageSources.Add(setting);
} }
public Dictionary<string, KeyValuePair<string, string>> SavedSectionValues = public Dictionary<string, SettingValue> SavedSectionValues =
new Dictionary<string, KeyValuePair<string, string>>(); new Dictionary<string, SettingValue>();
public void SetValue(string section, string key, string value) public void SetValue(string section, string key, string value)
{ {
SavedSectionValues.Remove(section); SavedSectionValues.Remove(section);
SavedSectionValues.Add(section, new KeyValuePair<string, string>(key, value)); SavedSectionValues.Add(section, new SettingValue(key, value, false));
} }
public KeyValuePair<string, string> GetValuePassedToSetValueForActivePackageSourceSection() public SettingValue GetValuePassedToSetValueForActivePackageSourceSection()
{ {
return SavedSectionValues[RegisteredPackageSourceSettings.ActivePackageSourceSectionName]; return SavedSectionValues[RegisteredPackageSourceSettings.ActivePackageSourceSectionName];
} }
public void SetValues(string section, IList<KeyValuePair<string, string>> values) public void SetValues(string section, IList<SettingValue> values)
{ {
SavedSectionValueLists.Remove(section); SavedSectionValueLists.Remove(section);
SavedSectionValueLists.Add(section, values); SavedSectionValueLists.Add(section, values);
} }
public Dictionary<string, IList<KeyValuePair<string, string>>> SavedSectionValueLists public Dictionary<string, IList<SettingValue>> SavedSectionValueLists
= new Dictionary<string, IList<KeyValuePair<string, string>>>(); = new Dictionary<string, IList<SettingValue>>();
public IList<KeyValuePair<string, string>> GetValuesPassedToSetValuesForPackageSourcesSection() public IList<SettingValue> GetValuesPassedToSetValuesForPackageSourcesSection()
{ {
return SavedSectionValueLists[RegisteredPackageSourceSettings.PackageSourcesSectionName]; return SavedSectionValueLists[RegisteredPackageSourceSettings.PackageSourcesSectionName];
} }
@ -156,7 +156,7 @@ namespace ICSharpCode.PackageManagement.Design
DisabledPackageSources.Add(setting); DisabledPackageSources.Add(setting);
} }
public IList<KeyValuePair<string, string>> GetValuesPassedToSetValuesForDisabledPackageSourcesSection() public IList<SettingValue> GetValuesPassedToSetValuesForDisabledPackageSourcesSection()
{ {
return SavedSectionValueLists[RegisteredPackageSourceSettings.DisabledPackageSourceSectionName]; return SavedSectionValueLists[RegisteredPackageSourceSettings.DisabledPackageSourceSectionName];
} }
@ -174,7 +174,7 @@ namespace ICSharpCode.PackageManagement.Design
Sections.Add("packageRestore", items); Sections.Add("packageRestore", items);
} }
public KeyValuePair<string, string> GetValuePassedToSetValueForPackageRestoreSection() public SettingValue GetValuePassedToSetValueForPackageRestoreSection()
{ {
return SavedSectionValues["packageRestore"]; return SavedSectionValues["packageRestore"];
} }
@ -184,5 +184,15 @@ namespace ICSharpCode.PackageManagement.Design
return SectionsDeleted.Contains("packageRestore"); return SectionsDeleted.Contains("packageRestore");
} }
} }
public Dictionary<string, IList<SettingValue>> SectionsUpdated =
new Dictionary<string, IList<SettingValue>>();
public void UpdateSections(string section, IList<SettingValue> values)
{
SectionsUpdated.Remove(section);
SectionsUpdated.Add(section, values);
SetValues(section, values);
}
} }
} }

5
src/AddIns/Misc/PackageManagement/Project/Src/PackageFromRepository.cs

@ -196,5 +196,10 @@ namespace ICSharpCode.PackageManagement
public bool DevelopmentDependency { public bool DevelopmentDependency {
get { return package.DevelopmentDependency; } get { return package.DevelopmentDependency; }
} }
public void ExtractContents(IFileSystem fileSystem, string extractPath)
{
package.ExtractContents(fileSystem, extractPath);
}
} }
} }

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

@ -103,7 +103,7 @@ namespace ICSharpCode.PackageManagement
void SavePackageSourceSettings(IList<KeyValuePair<string, string>> newPackageSourceSettings) void SavePackageSourceSettings(IList<KeyValuePair<string, string>> newPackageSourceSettings)
{ {
settings.DeleteSection(PackageSourcesSectionName); settings.DeleteSection(PackageSourcesSectionName);
settings.SetValues(PackageSourcesSectionName, newPackageSourceSettings); settings.SetValues(PackageSourcesSectionName, ConvertToSettings(newPackageSourceSettings));
} }
IList<KeyValuePair<string, string>> GetSettingsForDisabledPackageSources() IList<KeyValuePair<string, string>> GetSettingsForDisabledPackageSources()
@ -118,10 +118,16 @@ namespace ICSharpCode.PackageManagement
{ {
settings.DeleteSection(DisabledPackageSourceSectionName); settings.DeleteSection(DisabledPackageSourceSectionName);
if (disabledPackageSourceSettings.Any()) { if (disabledPackageSourceSettings.Any()) {
settings.SetValues(DisabledPackageSourceSectionName, disabledPackageSourceSettings); settings.SetValues(DisabledPackageSourceSectionName, ConvertToSettings(disabledPackageSourceSettings));
} }
} }
static IList<SettingValue> ConvertToSettings(IList<KeyValuePair<string, string>> settings)
{
return settings.Select(setting => new SettingValue(setting.Key, setting.Value, false))
.ToList();
}
public PackageSource ActivePackageSource { public PackageSource ActivePackageSource {
get { get {
if (activePackageSource != null) { if (activePackageSource != null) {

2
src/AddIns/Misc/PackageManagement/RequiredLibraries/COPYRIGHT.txt

@ -1,4 +1,4 @@
Copyright 2010-2012 Outercurve Foundation Copyright 2010-2014 Outercurve Foundation
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

8
src/AddIns/Misc/PackageManagement/RequiredLibraries/CREDITS.txt

@ -1,6 +1,6 @@
NuGet Project NuGet Project
ASP.NET Open Source Gallery at Outercurve Foundation ASP.NET Open Source Gallery at Outercurve Foundation
Copyright 2010 Outercurve Foundation Copyright 2010-2014 Outercurve Foundation
This product includes software developed at This product includes software developed at
The Outercurve Foundation (http://www.outercurve.org/). The Outercurve Foundation (http://www.outercurve.org/).
@ -30,3 +30,9 @@ Ninject 2.1
Website: http://ninject.org/ Website: http://ninject.org/
Copyright: Copyright (c) 2010 Nate Kohari Copyright: Copyright (c) 2010 Nate Kohari
License: Apache 2.0 License: Apache 2.0
QueryInterceptor 0.2
-----
Website: https://github.com/davidfowl/QueryInterceptor
Copyright: Copyright (c) 2011 David Fowler
License: The MIT License

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

Binary file not shown.

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

Binary file not shown.

13
src/AddIns/Misc/PackageManagement/Test/Src/PackageFromRepositoryTests.cs

@ -443,5 +443,18 @@ namespace PackageManagement.Tests
Assert.IsTrue(dependency); Assert.IsTrue(dependency);
} }
[Test]
public void ExtractPath_WrappedPackage_WrappedPackageExtractContentsCalled()
{
CreatePackage();
var expectedFileSystem = new FakeFileSystem();
string expectedPath = @"d:\projects\test\packages";
package.ExtractContents(expectedFileSystem, expectedPath);
Assert.AreEqual(expectedFileSystem, fakePackage.FileSystemPassedToExtractContents);
Assert.AreEqual(expectedPath, fakePackage.ExtractPathPassedToExtractContents);
}
} }
} }

34
src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsTests.cs

@ -117,12 +117,12 @@ namespace PackageManagement.Tests
PackageSource defaultSource = RegisteredPackageSources.DefaultPackageSource; PackageSource defaultSource = RegisteredPackageSources.DefaultPackageSource;
var expectedSavedPackageSourceSettings = new List<KeyValuePair<string, string>>(); var expectedSavedPackageSourceSettings = new List<SettingValue>();
string name = defaultSource.Name; string name = defaultSource.Name;
string sourceUrl = defaultSource.Source; string sourceUrl = defaultSource.Source;
expectedSavedPackageSourceSettings.Add(new KeyValuePair<string, string>(name, sourceUrl)); expectedSavedPackageSourceSettings.Add(new SettingValue(name, sourceUrl, false));
IList<KeyValuePair<string, string>> actualSavedPackageSourceSettings = fakeSettings.GetValuesPassedToSetValuesForPackageSourcesSection(); IList<SettingValue> actualSavedPackageSourceSettings = fakeSettings.GetValuesPassedToSetValuesForPackageSourcesSection();
Assert.AreEqual(expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings); Assert.AreEqual(expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings);
} }
@ -138,10 +138,10 @@ namespace PackageManagement.Tests
registeredPackageSources.Clear(); registeredPackageSources.Clear();
registeredPackageSources.Add(packageSource); registeredPackageSources.Add(packageSource);
var expectedSavedPackageSourceSettings = new List<KeyValuePair<string, string>>(); var expectedSavedPackageSourceSettings = new List<SettingValue>();
expectedSavedPackageSourceSettings.Add(new KeyValuePair<string, string>("Test", "http://codeplex.com")); expectedSavedPackageSourceSettings.Add(new SettingValue("Test", "http://codeplex.com", false));
IList<KeyValuePair<string, string>> actualSavedPackageSourceSettings = fakeSettings.GetValuesPassedToSetValuesForPackageSourcesSection(); IList<SettingValue> actualSavedPackageSourceSettings = fakeSettings.GetValuesPassedToSetValuesForPackageSourcesSection();
Assert.AreEqual(expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings); Assert.AreEqual(expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings);
} }
@ -189,10 +189,10 @@ namespace PackageManagement.Tests
options.ActivePackageSource = packageSource; options.ActivePackageSource = packageSource;
var expectedKeyValuePair = new KeyValuePair<string, string>("Test", "http://sharpdevelop.com"); var expectedSetting = new SettingValue("Test", "http://sharpdevelop.com", false);
KeyValuePair<string, string> actualKeyValuePair = fakeSettings.GetValuePassedToSetValueForActivePackageSourceSection(); SettingValue actualSetting = fakeSettings.GetValuePassedToSetValueForActivePackageSourceSection();
Assert.AreEqual(expectedKeyValuePair, actualKeyValuePair); Assert.AreEqual(expectedSetting, actualSetting);
} }
[Test] [Test]
@ -370,10 +370,10 @@ namespace PackageManagement.Tests
registeredPackageSources.Clear(); registeredPackageSources.Clear();
registeredPackageSources.Add(packageSource); registeredPackageSources.Add(packageSource);
var expectedSavedPackageSourceSettings = new List<KeyValuePair<string, string>>(); var expectedSavedPackageSourceSettings = new List<SettingValue>();
expectedSavedPackageSourceSettings.Add(new KeyValuePair<string, string>(packageSource.Name, "true")); expectedSavedPackageSourceSettings.Add(new SettingValue(packageSource.Name, "true", false));
IList<KeyValuePair<string, string>> actualSavedPackageSourceSettings = IList<SettingValue> actualSavedPackageSourceSettings =
fakeSettings.GetValuesPassedToSetValuesForDisabledPackageSourcesSection(); fakeSettings.GetValuesPassedToSetValuesForDisabledPackageSourcesSection();
Assert.AreEqual(expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings); Assert.AreEqual(expectedSavedPackageSourceSettings, actualSavedPackageSourceSettings);
} }
@ -423,10 +423,10 @@ namespace PackageManagement.Tests
options.IsPackageRestoreEnabled = true; options.IsPackageRestoreEnabled = true;
KeyValuePair<string, string> keyPair = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection(); SettingValue setting = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection();
Assert.AreEqual("enabled", keyPair.Key); Assert.AreEqual("enabled", setting.Key);
Assert.AreEqual("True", keyPair.Value); Assert.AreEqual("True", setting.Value);
} }
[Test] [Test]
@ -451,8 +451,8 @@ namespace PackageManagement.Tests
options.IsPackageRestoreEnabled = false; options.IsPackageRestoreEnabled = false;
KeyValuePair<string, string> keyValuePair = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection(); SettingValue setting = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection();
Assert.AreEqual("False", keyValuePair.Value); Assert.AreEqual("False", setting.Value);
} }
} }
} }

5
src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementOptionsViewModelTests.cs

@ -6,6 +6,7 @@ using System.Collections.Generic;
using ICSharpCode.Core; using ICSharpCode.Core;
using ICSharpCode.PackageManagement; using ICSharpCode.PackageManagement;
using ICSharpCode.PackageManagement.Design; using ICSharpCode.PackageManagement.Design;
using NuGet;
using NUnit.Framework; using NUnit.Framework;
using PackageManagement.Tests.Helpers; using PackageManagement.Tests.Helpers;
@ -349,8 +350,8 @@ namespace PackageManagement.Tests
viewModel.SaveOptions(); viewModel.SaveOptions();
KeyValuePair<string, string> keyPair = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection(); SettingValue setting = fakeSettings.GetValuePassedToSetValueForPackageRestoreSection();
Assert.AreEqual("True", keyPair.Value); Assert.AreEqual("True", setting.Value);
} }
} }
} }

Loading…
Cancel
Save