Browse Source

Update to NuGet 1.5

4.1
Matt Ward 15 years ago
parent
commit
bfa6884b3e
  1. 6
      src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/GetPackageCmdlet.cs
  2. 4
      src/AddIns/Misc/PackageManagement/Project/Src/Design/FakePackage.cs
  3. 16
      src/AddIns/Misc/PackageManagement/Project/Src/PackageFromRepository.cs
  4. 30
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml
  5. BIN
      src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll
  6. 56
      src/AddIns/Misc/PackageManagement/RequiredLibraries/about_NuGet.Cmdlets.help.txt
  7. 53
      src/AddIns/Misc/PackageManagement/Test/Src/PackageFromRepositoryTests.cs

6
src/AddIns/Misc/PackageManagement/Cmdlets/Project/Src/GetPackageCmdlet.cs

@ -142,11 +142,7 @@ namespace ICSharpCode.PackageManagement.Cmdlets
IQueryable<IPackage> FilterPackages(IQueryable<IPackage> packages) IQueryable<IPackage> FilterPackages(IQueryable<IPackage> packages)
{ {
if (Filter != null) { return packages.Find(Filter);
string[] searchTerms = Filter.Split(' ');
return packages.Find(searchTerms);
}
return packages;
} }
IQueryable<IPackage> GetUpdatedPackages() IQueryable<IPackage> GetUpdatedPackages()

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

@ -158,5 +158,9 @@ namespace ICSharpCode.PackageManagement.Design
} }
public DateTime? LastUpdated { get; set; } public DateTime? LastUpdated { get; set; }
public bool IsLatestVersion { get; set; }
public Nullable<DateTimeOffset> Published { get; set; }
public string ReleaseNotes { get; set; }
public string Copyright { get; set; }
} }
} }

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

@ -143,5 +143,21 @@ namespace ICSharpCode.PackageManagement
return hasDependencies.Value; return hasDependencies.Value;
} }
} }
public bool IsLatestVersion {
get { return package.IsLatestVersion; }
}
public Nullable<DateTimeOffset> Published {
get { return package.Published; }
}
public string ReleaseNotes {
get { return package.ReleaseNotes; }
}
public string Copyright {
get { return package.Copyright; }
}
} }
} }

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

@ -191,6 +191,9 @@ c:\temp\packages to find the package.
<command:parameter required="false" position="named"> <command:parameter required="false" position="named">
<maml:name>Updates</maml:name> <maml:name>Updates</maml:name>
</command:parameter> </command:parameter>
<command:parameter required="false" position="named">
<maml:name>ProjectName</maml:name>
</command:parameter>
<command:parameter required="false" position="named"> <command:parameter required="false" position="named">
<maml:name>Recent</maml:name> <maml:name>Recent</maml:name>
</command:parameter> </command:parameter>
@ -229,6 +232,12 @@ c:\temp\packages to find the package.
<maml:para>Gets packages available from the online package source.</maml:para> <maml:para>Gets packages available from the online package source.</maml:para>
</maml:description> </maml:description>
</command:parameter> </command:parameter>
<command:parameter required="false">
<maml:name>ProjectName</maml:name>
<maml:description>
<maml:para>Specifies the project to get installed packages from. If ommitted, the command will return installed projects for the entire solution.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named"> <command:parameter required="false" position="named">
<maml:name>Recent</maml:name> <maml:name>Recent</maml:name>
<maml:description> <maml:description>
@ -276,7 +285,7 @@ c:\temp\packages to find the package.
<maml:para> <maml:para>
Description Description
------------------------------------------------------------------ ------------------------------------------------------------------
Returns the packages installed in the default project. Returns packages installed in the current solution.
</maml:para> </maml:para>
<maml:para></maml:para> <maml:para></maml:para>
<maml:para></maml:para> <maml:para></maml:para>
@ -284,6 +293,19 @@ Returns the packages installed in the default project.
</command:example> </command:example>
<command:example> <command:example>
<maml:title>---------- EXAMPLE 2 ----------</maml:title> <maml:title>---------- EXAMPLE 2 ----------</maml:title>
<dev:code>PM&gt; Get-Package -ProjectName MyProject</dev:code>
<dev:remarks>
<maml:para>
Description
------------------------------------------------------------------
Returns packages installed in the "MyProject" project.
</maml:para>
<maml:para></maml:para>
<maml:para></maml:para>
</dev:remarks>
</command:example>
<command:example>
<maml:title>---------- EXAMPLE 3 ----------</maml:title>
<dev:code>PM&gt; Get-Package -ListAvailable</dev:code> <dev:code>PM&gt; Get-Package -ListAvailable</dev:code>
<dev:remarks> <dev:remarks>
<maml:para> <maml:para>
@ -296,7 +318,7 @@ Returns a list of packages available online in the current package source.
</dev:remarks> </dev:remarks>
</command:example> </command:example>
<command:example> <command:example>
<maml:title>---------- EXAMPLE 3 ----------</maml:title> <maml:title>---------- EXAMPLE 4 ----------</maml:title>
<dev:code>PM&gt; Get-Package -ListAvailable -Filter Ninject</dev:code> <dev:code>PM&gt; Get-Package -ListAvailable -Filter Ninject</dev:code>
<dev:remarks> <dev:remarks>
<maml:para> <maml:para>
@ -308,7 +330,7 @@ Returns a list of packages available online using "Ninject" as a search term.
</dev:remarks> </dev:remarks>
</command:example> </command:example>
<command:example> <command:example>
<maml:title>---------- EXAMPLE 4 ----------</maml:title> <maml:title>---------- EXAMPLE 5 ----------</maml:title>
<dev:code>PS&gt; Get-Package -Updates</dev:code> <dev:code>PS&gt; Get-Package -Updates</dev:code>
<dev:remarks> <dev:remarks>
<maml:para> <maml:para>
@ -321,7 +343,7 @@ Returns a list of packages installed in the default project that have updates av
</dev:remarks> </dev:remarks>
</command:example> </command:example>
<command:example> <command:example>
<maml:title>---------- EXAMPLE 5 ----------</maml:title> <maml:title>---------- EXAMPLE 6 ----------</maml:title>
<dev:code>PM&gt; Get-Package -Recent</dev:code> <dev:code>PM&gt; Get-Package -Recent</dev:code>
<dev:remarks> <dev:remarks>
<maml:para> <maml:para>

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

Binary file not shown.

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

@ -1,48 +1,48 @@
TOPIC TOPIC
about_NuGet about_NuGet
SHORT DESCRIPTION SHORT DESCRIPTION
Provides information about NuGet Package Manager commands. Provides information about NuGet Package Manager commands.
LONG DESCRIPTION LONG DESCRIPTION
This topic describes the NuGet Package Manager commands. NuGet is an integrated package This topic describes the NuGet Package Manager commands. NuGet is an integrated package
management tool for adding libraries and tools to .NET projects. management tool for adding libraries and tools to .NET projects.
The following NuGet cmdlets are included. The following NuGet cmdlets are included.
Cmdlet Description Cmdlet Description
------------------ ---------------------------------------------- ------------------ ----------------------------------------------
Get-Package Gets the set of packages available from the package source. Get-Package 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.
Uninstall-Package Uninstalls a package. If other packages depend on this package, Uninstall-Package Uninstalls a package. If other packages depend on this package,
the command will fail unless the –Force option is specified. the command will fail unless the –Force option is specified.
Update-Package Updates a package and its dependencies to a newer version. Update-Package Updates a package and its dependencies to a newer version.
New-Package Creates a new package when supplied with a Nuspec package specification file. New-Package Creates a new package when supplied with a Nuspec package specification file.
Add-BindingRedirect Examines all assemblies within the output path for a project and adds binding Add-BindingRedirect Examines all assemblies within the output path for a project and adds binding
redirects to the application (or web) configuration file where necessary. redirects to the application (or web) configuration file where necessary.
Get-Project Returns a reference to the DTE (Development Tools Environment) for the specified project. Get-Project Returns a reference to the DTE (Development Tools Environment) for the specified project.
If none is specifed, returns the default project selected in the Package Manager Console. If none is specifed, returns the default project selected in the Package Manager Console.
Open-PackagePage Open the browser pointing to ProjectUrl, LicenseUrl or ReportAbuseUrl of the Open-PackagePage Open the browser pointing to ProjectUrl, LicenseUrl or ReportAbuseUrl of the
specified package. specified package.
Register-TabExpansion Registers a tab expansion for the parameters of a command. Register-TabExpansion Registers a tab expansion for the parameters of a command.
SEE ALSO SEE ALSO
Online documentation: http://go.microsoft.com/fwlink/?LinkID=206619 Online documentation: http://go.microsoft.com/fwlink/?LinkID=206619
Get-Package Get-Package
Install-Package Install-Package
Uninstall-Package Uninstall-Package
Update-Package Update-Package
New-Package New-Package
Add-BindingRedirect Add-BindingRedirect
Get-Project Get-Project
Open-PackagePage Open-PackagePage
Register-TabExpansion Register-TabExpansion

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

@ -316,5 +316,58 @@ namespace PackageManagement.Tests
Assert.IsFalse(lastUpdated.HasValue); Assert.IsFalse(lastUpdated.HasValue);
} }
[Test]
public void IsLatestVersion_WrappedPackageIsNotLatestVersion_ReturnsFalse()
{
CreatePackage();
fakePackage.IsLatestVersion = false;
bool result = package.IsLatestVersion;
Assert.IsFalse(result);
}
[Test]
public void IsLatestVersion_WrappedPackageHasOneDependency_ReturnsTrue()
{
CreatePackage();
fakePackage.IsLatestVersion = true;
bool result = package.IsLatestVersion;
Assert.IsTrue(result);
}
[Test]
public void Published_PackageWrapsPackageThatHasPublishedDateOffset_ReturnsDateTimeOffsetFromWrappedPackage()
{
CreatePackage();
var dateTime = new DateTime(2011, 1, 2);
var expectedDateTimeOffset = new DateTimeOffset(dateTime);
fakePackage.Published = expectedDateTimeOffset;
DateTimeOffset? published = package.Published;
Assert.AreEqual(expectedDateTimeOffset, published.Value);
}
[Test]
public void Copyright_WrappedPackageCopyrightIsTest_ReturnsTest()
{
CreatePackage();
fakePackage.Copyright = "Test";
string copyright = package.Copyright;
Assert.AreEqual("Test", copyright);
}
[Test]
public void ReleaseNotes_WrappedPackageReleaseNotesIsTest_ReturnsTest()
{
CreatePackage();
fakePackage.ReleaseNotes = "Test";
string releaseNotes = package.ReleaseNotes;
Assert.AreEqual("Test", releaseNotes);
}
} }
} }

Loading…
Cancel
Save