public static bool PackageExists(LocalDirectoryNugetRepository repository, PackageID packageID, Version packageVersion) { // Does the version directory of the package directory exist? var packageVersionDirectoryPath = LocalDirectoryNugetRepository.GetPackageVersionDirectoryPath(repository, packageID, packageVersion); if (!packageVersionDirectoryPath.Exists()) { return(false); } var nuspecFilePath = NuGetIoUtilities.GetNuspecFilePath(packageVersionDirectoryPath); // Does the nuspec file in the correct directory actually state the specified packageID and version number? var packageSpecification = NuGetIoUtilities.GetPackageSpecification(nuspecFilePath); if (packageSpecification.ID != packageID) { return(false); } if (packageSpecification.Version != packageVersion) { return(false); } return(true); }
public static void DeletePackage(LocalDirectoryNugetRepository repository, PackageID packageID, Version packageVersion) { var packageVersionDirectoryPath = LocalDirectoryNugetRepository.GetPackageVersionDirectoryPath(repository, packageID, packageVersion); if (packageVersionDirectoryPath.Exists()) { packageVersionDirectoryPath.Delete(); } }
public PackageSpecification(PackageID name) : this(name, VersionHelper.None) { }
public PackageSpecification(PackageID name, Version version) { this.ID = name; this.Version = version; }
public static VersionDirectoryPath GetPackageVersionDirectoryPath(LocalDirectoryNugetRepository repository, PackageID packageID, Version packageVersion) { var packageDirectoryPath = LocalDirectoryNugetRepository.GetPackageDirectoryPath(repository, packageID); var versionDirectoryName = NuGetIoUtilities.GetVersionDirectoryName(packageVersion); var packageVersionDirectoryPath = PathUtilitiesExtra.Combine(packageDirectoryPath, versionDirectoryName).Value.AsVersionDirectoryPath(); return(packageVersionDirectoryPath); }
public static PackageDirectoryPath GetPackageDirectoryPath(DirectoryPath localPackageRepositoryDirectoryPath, PackageID packageID) { var localDirectoryNugetRepository = new LocalDirectoryNugetRepository(localPackageRepositoryDirectoryPath); var output = LocalDirectoryNugetRepository.GetPackageDirectoryPath(localDirectoryNugetRepository, packageID); return(output); }
public static PackageDirectoryPath GetPackageDirectoryPath(LocalDirectoryNugetRepository repository, PackageID packageID) { var packageDirectoryName = NuGetIoUtilities.GetPackageDirectoryName(packageID); var packageDirectoryPath = PathUtilitiesExtra.Combine(repository.DirectoryPath, packageDirectoryName).Value.AsPackageDirectoryPath(); return(packageDirectoryPath); }
public static void ListAllPackageVersions(DirectoryPath localPackageRepositoryDirectoryPath, PackageID packageID, TextWriter writer) { var localDirectoryNugetRepository = new LocalDirectoryNugetRepository(localPackageRepositoryDirectoryPath); LocalDirectoryNugetRepository.ListAllPackageVersions(localDirectoryNugetRepository, packageID, writer); }
public static void ListAllPackageVersions(LocalDirectoryNugetRepository repository, PackageID packageID, TextWriter writer) { var packageDirectoryName = NuGetIoUtilities.GetPackageDirectoryName(packageID); var packageDirectoryPath = PathUtilitiesExtra.Combine(repository.DirectoryPath, packageDirectoryName).Value.AsPackageDirectoryPath(); LocalDirectoryNugetRepository.ListAllPackageVersions(packageDirectoryPath, writer); }
public static void DeletePackage(DirectoryPath localPackageRepositoryDirectoryPath, PackageID packageID, Version packageVersion) { var localDirectoryNugetRepository = new LocalDirectoryNugetRepository(localPackageRepositoryDirectoryPath); LocalDirectoryNugetRepository.DeletePackage(localDirectoryNugetRepository, packageID, packageVersion); }
public static bool PackageExists(DirectoryPath localPackageRepositoryDirectoryPath, PackageID packageID, Version packageVersion) { var localDirectoryNugetRepository = new LocalDirectoryNugetRepository(localPackageRepositoryDirectoryPath); var output = LocalDirectoryNugetRepository.PackageExists(localDirectoryNugetRepository, packageID, packageVersion); return(output); }
/// <summary> /// The default package ID is the same as the project file-name-without-extensions. /// </summary> public static PackageID GetDefaultPackageID(FileNameWithoutExtension projectFileNameWithoutExtension) { var packageID = new PackageID(projectFileNameWithoutExtension.Value); return(packageID); }