Browse Source

Update to NuGet 2.5

pull/44/head
Matt Ward 12 years ago
parent
commit
b0767b8518
  1. 15
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeFileSystem.cs
  2. 16
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakePackage.cs
  3. 15
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs
  4. 7
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeSettings.cs
  5. 8
      src/AddIns/Misc/PackageManagement/Project/Src/PackageFromRepository.cs
  6. 5
      src/AddIns/Misc/PackageManagement/Project/Src/PackageManagementLogger.cs
  7. 9
      src/AddIns/Misc/PackageManagement/Project/Src/PackageViewModelOperationLogger.cs
  8. 12
      src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopProjectSystem.cs
  9. 2
      src/AddIns/Misc/PackageManagement/RequiredLibraries/COPYRIGHT.txt
  10. 23
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml
  11. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Console.Types.dll
  12. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll
  13. 3
      src/AddIns/Misc/PackageManagement/RequiredLibraries/about_NuGet.Cmdlets.help.txt
  14. 5
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeLogger.cs
  15. 5
      src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeSharedPackageRepository.cs
  16. 24
      src/AddIns/Misc/PackageManagement/Test/Src/PackageFromRepositoryTests.cs
  17. 27
      src/AddIns/Misc/PackageManagement/Test/Src/SharpDevelopProjectSystemTests.cs

15
src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeFileSystem.cs

@ -94,5 +94,20 @@ namespace ICSharpCode.PackageManagement.Design @@ -94,5 +94,20 @@ namespace ICSharpCode.PackageManagement.Design
{
throw new NotImplementedException();
}
public void AddFile(string path, Action<Stream> writeToStream)
{
throw new NotImplementedException();
}
public void MakeFileWritable(string path)
{
throw new NotImplementedException();
}
public Stream CreateFile(string path)
{
throw new NotImplementedException();
}
}
}

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

@ -178,5 +178,21 @@ namespace ICSharpCode.PackageManagement.Design @@ -178,5 +178,21 @@ namespace ICSharpCode.PackageManagement.Design
{
return SupportedFrameworks;
}
List<PackageReferenceSet> FakePackageAssemblyReferences =
new List<PackageReferenceSet>();
public ICollection<PackageReferenceSet> PackageAssemblyReferences {
get { return FakePackageAssemblyReferences; }
}
public void AddPackageReferences(params string[] names)
{
var frameworkName = new FrameworkName(".NET Framework, Version=4.0");
var packageReferenceSet = new PackageReferenceSet(frameworkName, names);
FakePackageAssemblyReferences.Add(packageReferenceSet);
}
public Version MinClientVersion { get; set; }
}
}

15
src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectSystem.cs

@ -56,5 +56,20 @@ namespace ICSharpCode.PackageManagement.Design @@ -56,5 +56,20 @@ namespace ICSharpCode.PackageManagement.Design
}
public bool IsBindingRedirectSupported { get; set; }
public void AddImport(string targetPath, ProjectImportLocation location)
{
throw new NotImplementedException();
}
public void RemoveImport(string targetPath)
{
throw new NotImplementedException();
}
public bool FileExistsInProject(string path)
{
throw new NotImplementedException();
}
}
}

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

@ -128,7 +128,7 @@ namespace ICSharpCode.PackageManagement.Design @@ -128,7 +128,7 @@ namespace ICSharpCode.PackageManagement.Design
public void MakePackageSourceSectionsNull()
{
Sections.Remove(RegisteredPackageSourceSettings.PackageSourcesSectionName);
Sections.Add(RegisteredPackageSourceSettings.PackageSourcesSectionName, null);
Sections.Add(RegisteredPackageSourceSettings.PackageSourcesSectionName, null);
}
public void AddFakePackageSources(IEnumerable<PackageSource> packageSources)
@ -187,5 +187,10 @@ namespace ICSharpCode.PackageManagement.Design @@ -187,5 +187,10 @@ namespace ICSharpCode.PackageManagement.Design
{
throw new NotImplementedException();
}
public IList<KeyValuePair<string, string>> GetValues(string section, bool isPath)
{
throw new NotImplementedException();
}
}
}

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

@ -174,5 +174,13 @@ namespace ICSharpCode.PackageManagement @@ -174,5 +174,13 @@ namespace ICSharpCode.PackageManagement
{
return package.ToString();
}
public ICollection<PackageReferenceSet> PackageAssemblyReferences {
get { return package.PackageAssemblyReferences; }
}
public Version MinClientVersion {
get { return package.MinClientVersion; }
}
}
}

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

@ -19,5 +19,10 @@ namespace ICSharpCode.PackageManagement @@ -19,5 +19,10 @@ namespace ICSharpCode.PackageManagement
{
packageManagementEvents.OnPackageOperationMessageLogged(level, message, args);
}
public FileConflictResolution ResolveFileConflict(string message)
{
throw new NotImplementedException();
}
}
}

9
src/AddIns/Misc/PackageManagement/Project/Src/PackageViewModelOperationLogger.cs

@ -60,7 +60,7 @@ namespace ICSharpCode.PackageManagement @@ -60,7 +60,7 @@ namespace ICSharpCode.PackageManagement
public void LogAddingPackage()
{
string message = GetFormattedStartPackageOperationMessage(AddingPackageMessageFormat);
LogInformation(message);
LogInformation(message);
}
string GetFormattedStartPackageOperationMessage(string format)
@ -88,7 +88,12 @@ namespace ICSharpCode.PackageManagement @@ -88,7 +88,12 @@ namespace ICSharpCode.PackageManagement
public void LogManagingPackage()
{
string message = GetFormattedStartPackageOperationMessage(ManagingPackageMessageFormat);
LogInformation(message);
LogInformation(message);
}
public FileConflictResolution ResolveFileConflict(string message)
{
throw new NotImplementedException();
}
}
}

12
src/AddIns/Misc/PackageManagement/Project/Src/SharpDevelopProjectSystem.cs

@ -209,7 +209,7 @@ namespace ICSharpCode.PackageManagement @@ -209,7 +209,7 @@ namespace ICSharpCode.PackageManagement
return IsMatchIgnoringCase(directoryName, "bin");
}
bool FileExistsInProject(string path)
public bool FileExistsInProject(string path)
{
string fullPath = GetFullPath(path);
return project.IsFileInProject(fullPath);
@ -300,5 +300,15 @@ namespace ICSharpCode.PackageManagement @@ -300,5 +300,15 @@ namespace ICSharpCode.PackageManagement
{
return path;
}
public void AddImport(string targetPath, ProjectImportLocation location)
{
throw new NotImplementedException();
}
public void RemoveImport(string targetPath)
{
throw new NotImplementedException();
}
}
}

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

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

23
src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml

@ -50,6 +50,9 @@ @@ -50,6 +50,9 @@
<command:parameter required="false" position="named">
<maml:name>IncludePrerelease</maml:name>
</command:parameter>
<command:parameter required="false" position="named">
<maml:name>FileConflictAction</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
@ -104,6 +107,12 @@ @@ -104,6 +107,12 @@
<maml:para>Indicates whether this command will consider prerelease packages. If omitted, only stable packages are considered.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named">
<maml:name>FileConflictAction</maml:name>
<maml:description>
<maml:para>Indicates what this command should do if a file from the package's content folder already exists in the project.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<!-- Examples section -->
@ -175,7 +184,7 @@ @@ -175,7 +184,7 @@
Get-Package
</command:name>
<maml:description>
<maml:para>Gets the set of packages available from the package source. Use the -ListAvailable flag to list packages available from the package source.</maml:para>
<maml:para>Gets the set of installed packages. Use the -ListAvailable flag to list packages available from the package source.</maml:para>
</maml:description>
<command:verb>Get</command:verb>
<command:noun>Package</command:noun>
@ -183,7 +192,7 @@ @@ -183,7 +192,7 @@
</command:details>
<maml:description>
<maml:para>Gets the set of packages available from the package source. Defaults to only showing the list of installed packages. Use the -ListAvailable flag to list packages available from the package source.</maml:para>
<maml:para>Gets the set of installed packages. Use the -ListAvailable flag to list packages available from the package source.</maml:para>
</maml:description>
<!-- Cmdlet syntax section-->
@ -202,6 +211,7 @@ @@ -202,6 +211,7 @@
</command:parameter>
<command:parameter required="false" position="named">
<maml:name>ProjectName</maml:name>
<command:parameterValue required="true">string</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named">
<maml:name>Filter</maml:name>
@ -567,6 +577,9 @@ @@ -567,6 +577,9 @@
<command:parameter required="false" position="named">
<maml:name>Reinstall</maml:name>
</command:parameter>
<command:parameter required="false" position="named">
<maml:name>FileConflictAction</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
@ -633,6 +646,12 @@ @@ -633,6 +646,12 @@
<maml:para>Reinstall packages with the existing versions.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named">
<maml:name>FileConflictAction</maml:name>
<maml:description>
<maml:para>Indicates what this command should do if a file from the package's content folder already exists in the project.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:examples>

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.

3
src/AddIns/Misc/PackageManagement/RequiredLibraries/about_NuGet.Cmdlets.help.txt

@ -13,7 +13,8 @@ LONG DESCRIPTION @@ -13,7 +13,8 @@ LONG DESCRIPTION
Cmdlet Description
------------------ ----------------------------------------------
Get-Package Gets the set of packages available from the package source.
Get-Package Gets the set of installed packages. With -ListAvailable,
gets the set of packages available from the package source.
Install-Package Installs a package and its dependencies into the project.

5
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeLogger.cs

@ -44,5 +44,10 @@ namespace PackageManagement.Tests.Helpers @@ -44,5 +44,10 @@ namespace PackageManagement.Tests.Helpers
{
return FormattedMessagesLogged.Any(message => message.Contains(text));
}
public FileConflictResolution ResolveFileConflict(string message)
{
throw new NotImplementedException();
}
}
}

5
src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakeSharedPackageRepository.cs

@ -38,5 +38,10 @@ namespace PackageManagement.Tests.Helpers @@ -38,5 +38,10 @@ namespace PackageManagement.Tests.Helpers
{
throw new NotImplementedException();
}
public bool IsSolutionReferenced(string packageId, SemanticVersion version)
{
throw new NotImplementedException();
}
}
}

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

@ -407,5 +407,29 @@ namespace PackageManagement.Tests @@ -407,5 +407,29 @@ namespace PackageManagement.Tests
Assert.AreEqual("MyPackage 1.1", result);
}
[Test]
public void MinClientVersion_PackageHasMinClientVersion_ReturnsWrappedPackageMinClientVersion()
{
CreatePackage();
var expectedVersion = new Version("1.1");
fakePackage.MinClientVersion = expectedVersion;
Version version = package.MinClientVersion;
Assert.AreEqual(expectedVersion, version);
}
[Test]
public void PackageAssemblyReferences_PackageHasOnePackageAssemblyReference_ReturnsWrappedPackagePackageAssemblyReferences()
{
CreatePackage();
fakePackage.AddPackageReferences("Test");
List<PackageReferenceSet> expectedReferences = fakePackage.PackageAssemblyReferences.ToList();
List<PackageReferenceSet> result = package.PackageAssemblyReferences.ToList();
Assert.AreEqual(expectedReferences, result);
}
}
}

27
src/AddIns/Misc/PackageManagement/Test/Src/SharpDevelopProjectSystemTests.cs

@ -54,6 +54,11 @@ namespace PackageManagement.Tests @@ -54,6 +54,11 @@ namespace PackageManagement.Tests
projectSystem.FakeProjectService.AddDefaultCustomToolForFileName(fileName, customTool);
}
void AddFile(string fileName)
{
projectSystem.AddFile(fileName, (Stream)null);
}
[Test]
public void Root_NewInstanceCreated_ReturnsProjectDirectory()
{
@ -467,7 +472,7 @@ namespace PackageManagement.Tests @@ -467,7 +472,7 @@ namespace PackageManagement.Tests
CreateProjectSystem(project);
string fileName = @"d:\projects\MyProject\src\NewFile.cs";
projectSystem.AddFile(fileName, null);
AddFile(fileName);
FileProjectItem fileItem = ProjectHelper.GetFile(project, fileName);
FileProjectItem expectedFileItem = new FileProjectItem(project, ItemType.Compile);
@ -484,7 +489,7 @@ namespace PackageManagement.Tests @@ -484,7 +489,7 @@ namespace PackageManagement.Tests
CreateProjectSystem(project);
string fileName = @"d:\projects\MyProject\src\NewFile.resx";
projectSystem.AddFile(fileName, null);
AddFile(fileName);
FileProjectItem fileItem = ProjectHelper.GetFile(project, fileName);
FileProjectItem expectedFileItem = new FileProjectItem(project, ItemType.EmbeddedResource);
@ -502,7 +507,7 @@ namespace PackageManagement.Tests @@ -502,7 +507,7 @@ namespace PackageManagement.Tests
string relativeFileName = @"src\NewFile.cs";
string fileName = @"d:\projects\MyProject\src\NewFile.cs";
projectSystem.AddFile(relativeFileName, null);
AddFile(relativeFileName);
FileProjectItem fileItem = ProjectHelper.GetFile(project, fileName);
FileProjectItem expectedFileItem = new FileProjectItem(project, ItemType.Compile);
@ -520,7 +525,7 @@ namespace PackageManagement.Tests @@ -520,7 +525,7 @@ namespace PackageManagement.Tests
string relativeFileName = @"NewFile.cs";
string fileName = @"d:\projects\MyProject\NewFile.cs";
projectSystem.AddFile(relativeFileName, null);
AddFile(relativeFileName);
FileProjectItem fileItem = ProjectHelper.GetFile(project, fileName);
FileProjectItem expectedFileItem = new FileProjectItem(project, ItemType.Compile);
@ -537,7 +542,7 @@ namespace PackageManagement.Tests @@ -537,7 +542,7 @@ namespace PackageManagement.Tests
CreateProjectSystem(project);
string fileName = @"d:\projects\MyProject\src\NewFile.cs";
projectSystem.AddFile(fileName, null);
AddFile(fileName);
Assert.AreEqual(1, project.ItemsWhenSaved.Count);
}
@ -549,7 +554,7 @@ namespace PackageManagement.Tests @@ -549,7 +554,7 @@ namespace PackageManagement.Tests
CreateProjectSystem(project);
string fileName = @"bin\NewFile.dll";
projectSystem.AddFile(fileName, null);
AddFile(fileName);
FileProjectItem fileItem = ProjectHelper.GetFileFromInclude(project, fileName);
@ -563,7 +568,7 @@ namespace PackageManagement.Tests @@ -563,7 +568,7 @@ namespace PackageManagement.Tests
CreateProjectSystem(project);
string fileName = @"BIN\NewFile.dll";
projectSystem.AddFile(fileName, null);
AddFile(fileName);
FileProjectItem fileItem = ProjectHelper.GetFileFromInclude(project, fileName);
@ -575,10 +580,10 @@ namespace PackageManagement.Tests @@ -575,10 +580,10 @@ namespace PackageManagement.Tests
{
CreateTestProject(@"d:\projects\MyProject\MyProject.csproj");
project.ItemTypeToReturnFromGetDefaultItemType = ItemType.Compile;
CreateProjectSystem(project);
CreateProjectSystem(project);
AddFileToProject(@"d:\projects\MyProject\src\NewFile.cs");
projectSystem.AddFile(@"src\NewFile.cs", null);
AddFile(@"src\NewFile.cs");
int projectItemsCount = project.Items.Count;
Assert.AreEqual(1, projectItemsCount);
@ -591,7 +596,7 @@ namespace PackageManagement.Tests @@ -591,7 +596,7 @@ namespace PackageManagement.Tests
project.Name = "MyTestProject";
CreateProjectSystem(project);
projectSystem.AddFile(@"src\files\abc.cs", null);
AddFile(@"src\files\abc.cs");
var expectedFileNameAndProjectName = new FileNameAndProjectName {
FileName = @"src\files\abc.cs",
@ -609,7 +614,7 @@ namespace PackageManagement.Tests @@ -609,7 +614,7 @@ namespace PackageManagement.Tests
AddFileToProject(@"src\files\abc.cs");
CreateProjectSystem(project);
projectSystem.AddFile(@"src\files\abc.cs", null);
AddFile(@"src\files\abc.cs");
var expectedFileNameAndProjectName = new FileNameAndProjectName {
FileName = @"src\files\abc.cs",

Loading…
Cancel
Save