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. 5
      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. 5
      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. 25
      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
{ {
throw new NotImplementedException(); 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
{ {
return SupportedFrameworks; 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
} }
public bool IsBindingRedirectSupported { get; set; } 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();
}
} }
} }

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

@ -187,5 +187,10 @@ namespace ICSharpCode.PackageManagement.Design
{ {
throw new NotImplementedException(); 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
{ {
return package.ToString(); 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
{ {
packageManagementEvents.OnPackageOperationMessageLogged(level, message, args); packageManagementEvents.OnPackageOperationMessageLogged(level, message, args);
} }
public FileConflictResolution ResolveFileConflict(string message)
{
throw new NotImplementedException();
}
} }
} }

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

@ -90,5 +90,10 @@ namespace ICSharpCode.PackageManagement
string message = GetFormattedStartPackageOperationMessage(ManagingPackageMessageFormat); 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
return IsMatchIgnoringCase(directoryName, "bin"); return IsMatchIgnoringCase(directoryName, "bin");
} }
bool FileExistsInProject(string path) public bool FileExistsInProject(string path)
{ {
string fullPath = GetFullPath(path); string fullPath = GetFullPath(path);
return project.IsFileInProject(fullPath); return project.IsFileInProject(fullPath);
@ -300,5 +300,15 @@ namespace ICSharpCode.PackageManagement
{ {
return path; 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 @@
Copyright 2010 Outercurve Foundation Copyright 2010-2012 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.

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

@ -50,6 +50,9 @@
<command:parameter required="false" position="named"> <command:parameter required="false" position="named">
<maml:name>IncludePrerelease</maml:name> <maml:name>IncludePrerelease</maml:name>
</command:parameter> </command:parameter>
<command:parameter required="false" position="named">
<maml:name>FileConflictAction</maml:name>
</command:parameter>
</command:syntaxItem> </command:syntaxItem>
</command:syntax> </command:syntax>
@ -104,6 +107,12 @@
<maml:para>Indicates whether this command will consider prerelease packages. If omitted, only stable packages are considered.</maml:para> <maml:para>Indicates whether this command will consider prerelease packages. If omitted, only stable packages are considered.</maml:para>
</maml:description> </maml:description>
</command:parameter> </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:parameters>
<!-- Examples section --> <!-- Examples section -->
@ -175,7 +184,7 @@
Get-Package Get-Package
</command:name> </command:name>
<maml:description> <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> </maml:description>
<command:verb>Get</command:verb> <command:verb>Get</command:verb>
<command:noun>Package</command:noun> <command:noun>Package</command:noun>
@ -183,7 +192,7 @@
</command:details> </command:details>
<maml:description> <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> </maml:description>
<!-- Cmdlet syntax section--> <!-- Cmdlet syntax section-->
@ -202,6 +211,7 @@
</command:parameter> </command:parameter>
<command:parameter required="false" position="named"> <command:parameter required="false" position="named">
<maml:name>ProjectName</maml:name> <maml:name>ProjectName</maml:name>
<command:parameterValue required="true">string</command:parameterValue>
</command:parameter> </command:parameter>
<command:parameter required="false" position="named"> <command:parameter required="false" position="named">
<maml:name>Filter</maml:name> <maml:name>Filter</maml:name>
@ -567,6 +577,9 @@
<command:parameter required="false" position="named"> <command:parameter required="false" position="named">
<maml:name>Reinstall</maml:name> <maml:name>Reinstall</maml:name>
</command:parameter> </command:parameter>
<command:parameter required="false" position="named">
<maml:name>FileConflictAction</maml:name>
</command:parameter>
</command:syntaxItem> </command:syntaxItem>
</command:syntax> </command:syntax>
@ -633,6 +646,12 @@
<maml:para>Reinstall packages with the existing versions.</maml:para> <maml:para>Reinstall packages with the existing versions.</maml:para>
</maml:description> </maml:description>
</command:parameter> </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:parameters>
<command:examples> <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
Cmdlet 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. 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
{ {
return FormattedMessagesLogged.Any(message => message.Contains(text)); 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
{ {
throw new NotImplementedException(); 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
Assert.AreEqual("MyPackage 1.1", result); 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);
}
} }
} }

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

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

Loading…
Cancel
Save