Permalink
Browse files

Update to NuGet 1.4

  • Loading branch information...
1 parent 3e105b2 commit 33fc889decb7d3a32337c908500cda932af47ced @mrward mrward committed Jun 25, 2011
Showing with 656 additions and 180 deletions.
  1. +1 −0 src/AddIns/Misc/PackageManagement/Project/PackageManagement.csproj
  2. +16 −0 src/AddIns/Misc/PackageManagement/Project/Src/Design/FakePackageManager.cs
  3. +7 −2 src/AddIns/Misc/PackageManagement/Project/Src/Design/FakeProjectManager.cs
  4. +6 −6 src/AddIns/Misc/PackageManagement/Project/Src/PackageRepositoryCache.cs
  5. +16 −0 src/AddIns/Misc/PackageManagement/Project/Src/PackageSourceExtensions.cs
  6. +2 −2 src/AddIns/Misc/PackageManagement/Project/Src/ProjectTemplatePackageRepositoryCache.cs
  7. +3 −3 src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageRepositories.cs
  8. +2 −14 src/AddIns/Misc/PackageManagement/Project/Src/RegisteredPackageSourceSettings.cs
  9. +512 −70 src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Cmdlets.dll-Help.xml
  10. BIN src/AddIns/Misc/PackageManagement/RequiredLibraries/NuGet.Core.dll
  11. +11 −2 src/AddIns/Misc/PackageManagement/RequiredLibraries/about_NuGet.Cmdlets.help.txt
  12. +2 −2 src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageReferenceFile.cs
  13. +7 −8 src/AddIns/Misc/PackageManagement/Test/Src/Helpers/FakePackageRepositoryFactory.cs
  14. +2 −2 src/AddIns/Misc/PackageManagement/Test/Src/PackageManagementProjectTests.cs
  15. +1 −1 src/AddIns/Misc/PackageManagement/Test/Src/PackageReferenceInstallerTests.cs
  16. +36 −36 src/AddIns/Misc/PackageManagement/Test/Src/PackageRepositoryCacheTests.cs
  17. +1 −1 src/AddIns/Misc/PackageManagement/Test/Src/ProjectTemplatePackageRepositoryCacheTests.cs
  18. +30 −30 src/AddIns/Misc/PackageManagement/Test/Src/RegisteredPackageRepositoriesTests.cs
  19. +1 −1 src/AddIns/Misc/PackageManagement/Test/Src/Scripting/RunPackageScriptsActionTests.cs
@@ -143,6 +143,7 @@
<Compile Include="Src\PackageReferenceFileNameForProject.cs" />
<Compile Include="Src\PackageReferenceInstaller.cs" />
<Compile Include="Src\PackageReferencesForProject.cs" />
+ <Compile Include="Src\PackageSourceExtensions.cs" />
<Compile Include="Src\PackageViewModelOperationLogger.cs" />
<Compile Include="Src\ParentPackageOperationEventArgs.cs" />
<Compile Include="Src\ProcessPackageOperationsAction.cs" />
@@ -151,5 +151,21 @@ public void FirePackageUninstalled(PackageOperationEventArgs e)
{
PackageUninstalled(this, e);
}
+
+ public IPackagePathResolver PathResolver {
+ get {
+ throw new NotImplementedException();
+ }
+ }
+
+ public void UpdatePackage(IPackage newPackage, bool updateDependencies)
+ {
+ throw new NotImplementedException();
+ }
+
+ public void UpdatePackage(string packageId, IVersionSpec versionSpec, bool updateDependencies)
+ {
+ throw new NotImplementedException();
+ }
}
}
@@ -31,7 +31,7 @@ public FakeProjectManager()
protected virtual void OnPackageReferenceAdded(IPackage package)
{
if (PackageReferenceAdded != null) {
- PackageReferenceAdded(this, new PackageOperationEventArgs(package, String.Empty));
+ PackageReferenceAdded(this, new PackageOperationEventArgs(package, null, String.Empty));
}
}
@@ -40,7 +40,7 @@ protected virtual void OnPackageReferenceAdded(IPackage package)
protected virtual void OnPackageReferenceRemoved(IPackage package)
{
if (PackageReferenceRemoved != null) {
- PackageReferenceRemoved(this, new PackageOperationEventArgs(package, String.Empty));
+ PackageReferenceRemoved(this, new PackageOperationEventArgs(package, null, String.Empty));
}
}
@@ -103,5 +103,10 @@ public void RemovePackageReference(IPackage package, bool forceRemove, bool remo
{
throw new NotImplementedException();
}
+
+ public void UpdatePackageReference(string packageId, IVersionSpec versionSpec, bool updateDependencies)
+ {
+ throw new NotImplementedException();
+ }
}
}
@@ -14,8 +14,8 @@ public class PackageRepositoryCache : IPackageRepositoryCache
RegisteredPackageSources registeredPackageSources;
IList<RecentPackageInfo> recentPackages;
IRecentPackageRepository recentPackageRepository;
- ConcurrentDictionary<PackageSource, IPackageRepository> repositories =
- new ConcurrentDictionary<PackageSource, IPackageRepository>();
+ ConcurrentDictionary<string, IPackageRepository> repositories =
+ new ConcurrentDictionary<string, IPackageRepository>();
public PackageRepositoryCache(
ISharpDevelopPackageRepositoryFactory factory,
@@ -37,7 +37,7 @@ public class PackageRepositoryCache : IPackageRepositoryCache
{
}
- public IPackageRepository CreateRepository(PackageSource packageSource)
+ public IPackageRepository CreateRepository(string packageSource)
{
IPackageRepository repository = GetExistingRepository(packageSource);
if (repository != null) {
@@ -46,7 +46,7 @@ public IPackageRepository CreateRepository(PackageSource packageSource)
return CreateNewCachedRepository(packageSource);
}
- IPackageRepository GetExistingRepository(PackageSource packageSource)
+ IPackageRepository GetExistingRepository(string packageSource)
{
IPackageRepository repository = null;
if (repositories.TryGetValue(packageSource, out repository)) {
@@ -55,7 +55,7 @@ IPackageRepository GetExistingRepository(PackageSource packageSource)
return null;
}
- IPackageRepository CreateNewCachedRepository(PackageSource packageSource)
+ IPackageRepository CreateNewCachedRepository(string packageSource)
{
IPackageRepository repository = factory.CreateRepository(packageSource);
repositories.TryAdd(packageSource, repository);
@@ -76,7 +76,7 @@ public IPackageRepository CreateAggregateRepository()
IEnumerable<IPackageRepository> CreateAllRepositories()
{
foreach (PackageSource source in registeredPackageSources) {
- yield return CreateRepository(source);
+ yield return CreateRepository(source.Source);
}
}
@@ -0,0 +1,16 @@
+// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
+// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
+
+using System;
+using NuGet;
+
+namespace ICSharpCode.PackageManagement
+{
+ public static class PackageSourceExtensions
+ {
+ public static bool IsAggregate(this PackageSource packageSource)
+ {
+ return packageSource.Source == RegisteredPackageSourceSettings.AggregatePackageSource.Source;
+ }
+ }
+}
@@ -42,7 +42,7 @@ public IPackageRepository CreateAggregateRepository()
IEnumerable<IPackageRepository> GetRegisteredPackageRepositories()
{
foreach (PackageSource packageSource in registeredPackageSources.PackageSources) {
- yield return CreateRepository(packageSource);
+ yield return CreateRepository(packageSource.Source);
}
}
@@ -61,7 +61,7 @@ public IPackageRepository CreateAggregateRepository(IEnumerable<IPackageReposito
return packageRepositoryCache.CreateAggregateRepository(repositories);
}
- public IPackageRepository CreateRepository(PackageSource packageSource)
+ public IPackageRepository CreateRepository(string packageSource)
{
return packageRepositoryCache.CreateRepository(packageSource);
}
@@ -30,7 +30,7 @@ public class RegisteredPackageRepositories : IRegisteredPackageRepositories
public IPackageRepository CreateRepository(PackageSource source)
{
- return repositoryCache.CreateRepository(source);
+ return repositoryCache.CreateRepository(source.Source);
}
public IPackageRepository CreateAggregateRepository()
@@ -76,10 +76,10 @@ public IPackageRepository CreateAggregateRepository()
void CreateActiveRepository()
{
- if (ActivePackageSource.IsAggregate) {
+ if (ActivePackageSource.IsAggregate()) {
activePackageRepository = CreateAggregateRepository();
} else {
- activePackageRepository = repositoryCache.CreateRepository(ActivePackageSource);
+ activePackageRepository = repositoryCache.CreateRepository(ActivePackageSource.Source);
}
}
}
@@ -16,7 +16,7 @@ public class RegisteredPackageSourceSettings
public static readonly string ActivePackageSourceSectionName = "activePackageSource";
public static readonly PackageSource AggregatePackageSource =
- new PackageSource("(Aggregate source)", "All") { IsAggregate = true };
+ new PackageSource("(Aggregate source)", "All");
ISettings settings;
PackageSource defaultPackageSource;
@@ -39,18 +39,6 @@ void ReadActivePackageSource()
{
IList<KeyValuePair<string, string>> packageSources = settings.GetValues(ActivePackageSourceSectionName);
activePackageSource = PackageSourceConverter.ConvertFromFirstKeyValuePair(packageSources);
-
- if (IsActivePackageSourceAggregatePackageSource()) {
- activePackageSource.IsAggregate = true;
- }
- }
-
- bool IsActivePackageSourceAggregatePackageSource()
- {
- if (activePackageSource != null) {
- return activePackageSource.Source == AggregatePackageSource.Source;
- }
- return false;
}
public RegisteredPackageSources PackageSources {
@@ -109,7 +97,7 @@ void SavePackageSourceSettings(IList<KeyValuePair<string, string>> newPackageSou
public PackageSource ActivePackageSource {
get {
if (activePackageSource != null) {
- if (activePackageSource.IsAggregate) {
+ if (activePackageSource.IsAggregate()) {
return activePackageSource;
}
if (PackageSources.Contains(activePackageSource)) {
Oops, something went wrong.

0 comments on commit 33fc889

Please sign in to comment.