4 using System.Collections;
5 using System.Collections.Generic;
8 using SiliconStudio.Core.IO;
10 namespace SiliconStudio.Assets
28 if (rootPackage == null)
throw new ArgumentNullException(
"rootPackage");
31 if (includeRootPackage)
33 packages.Add(rootPackage);
36 FillPackageDependencies(rootPackage, isRecursive, packages);
49 return packages.Any(
package => package.Assets.ContainsById(assetGuid));
60 return packages.Any(
package => package.Assets.Find(location) != null);
65 var session = rootPackage.Session;
69 throw new InvalidOperationException(
"Cannot query package with dependencies when it is not attached to a session");
75 var
package = session.Packages.Find(packageDependency);
81 if (!packagesFound.Contains(package))
83 packagesFound.Add(package);
87 FillPackageDependencies(package, isRecursive, packagesFound);
95 var
package = session.Packages.Find(packageReference.Id);
101 if (!packagesFound.Contains(package))
103 packagesFound.Add(package);
107 FillPackageDependencies(package, isRecursive, packagesFound);
static PackageCollection FindDependencies(this Package rootPackage, bool includeRootPackage=false, bool isRecursive=true)
Finds the package dependencies for the specified Package. See remarks.
static bool ContainsAsset(this IEnumerable< Package > packages, Guid assetGuid)
Determines whether the specified packages contains an asset by its guid.
static bool ContainsAsset(this IEnumerable< Package > packages, UFile location)
Determines whether the specified packages contains an asset by its location.
List< PackageReference > LocalDependencies
Gets the local package dependencies used by this package (only valid for local references). Global dependencies are defined through the Meta property in PackageMeta.Dependencies
A package managing assets.
PackageMeta Meta
Gets or sets the metadata associated with this package.
Defines a normalized file path. See UPath for details. This class cannot be inherited.