/// <summary> /// Adds a dependency to the current package. /// </summary> /// <param name="id">The identifier of the dependency.</param> /// <param name="version">The version of the dependency.</param> /// <param name="targetFramework">The target framework for the dependency.</param> /// <param name="includeAssets">An optional array of strings representing the assets to include for the dependency.</param> /// <param name="excludeAssets">An optional array of strings representing the assets to exclude from the dependency.</param> /// <returns>The current <see cref="PackageRepository" />.</returns> public PackageRepository Dependency(string id, string version, string targetFramework, string?includeAssets = "All", string?excludeAssets = "None") { if (LastPackage == null) { throw new InvalidOperationException(Strings.ErrorWhenAddingLibraryRequiresPackage); } LastPackage.AddTargetFramework(targetFramework); LastPackage.AddDependency(targetFramework, id, version, includeAssets, excludeAssets); SavePackageManifest(); return(this); }
/// <summary> /// Adds a dependency to the current package. /// </summary> /// <param name="targetFramework">The target framework of the dependency.</param> /// <param name="id">The package ID of the dependency.</param> /// <param name="version">The minimum version of the dependency.</param> /// <param name="include">An optional comma delimited list of assets to include. The default value is All.</param> /// <param name="exclude">An optional comma delimited list of assets to exclude. The default value is None.</param> /// <returns>The current <see cref="PackageFeed" />.</returns> public PackageFeed Dependency(string targetFramework, string id, string version, string include = "All", string exclude = "None") { LastPackage.AddDependency(targetFramework, id, version, include, exclude); return(this); }