Example #1
0
        private UDirectory GetPackageDirectory(string packageName, PackageVersionRange versionRange, bool allowPreleaseVersion = false, bool allowUnlisted = false)
        {
            if (packageName == null)
            {
                throw new ArgumentNullException("packageName");
            }

            if (store != null)
            {
                var versionSpec = versionRange.ToVersionSpec();
                var package     = store.Manager.LocalRepository.FindPackage(packageName, versionSpec, allowPreleaseVersion, allowUnlisted);

                // If package was not found,
                if (package != null)
                {
                    var directory = store.PathResolver.GetPackageDirectory(package);
                    if (directory != null)
                    {
                        return(directory);
                    }
                }
            }

            // TODO: Check version for default package
            return(DefaultPackageName == packageName ? defaultPackageDirectory : null);
        }
Example #2
0
        private UDirectory GetPackageDirectory(string packageName, PackageVersionRange versionRange, IPackageConstraintProvider constraintProvider = null, bool allowPreleaseVersion = false, bool allowUnlisted = false)
        {
            if (packageName == null)
            {
                throw new ArgumentNullException("packageName");
            }

            if (store != null)
            {
                var versionSpec = versionRange.ToVersionSpec();
                var package     = store.Manager.LocalRepository.FindPackage(packageName, versionSpec, constraintProvider ?? NullConstraintProvider.Instance, allowPreleaseVersion, allowUnlisted);

                // If package was not found,
                if (package != null)
                {
                    var directory = store.PathResolver.GetPackageDirectory(package);
                    if (directory != null)
                    {
                        return(directory);
                    }
                }
            }

            // TODO: Check version for default package
            if (packageName == DefaultPackageName)
            {
                if (versionRange == null || versionRange.Contains(DefaultPackageVersion))
                {
                    return(defaultPackageDirectory);
                }
            }

            return(null);
        }
Example #3
0
        private UDirectory GetPackageDirectory(string packageName, PackageVersionRange versionRange, IPackageConstraintProvider constraintProvider = null, bool allowPreleaseVersion = false, bool allowUnlisted = false)
        {
            if (packageName == null) throw new ArgumentNullException("packageName");

            if (store != null)
            {
                var versionSpec = versionRange.ToVersionSpec();
                var package = store.Manager.LocalRepository.FindPackage(packageName, versionSpec, constraintProvider ?? NullConstraintProvider.Instance, allowPreleaseVersion, allowUnlisted);

                // If package was not found, 
                if (package != null)
                {
                    var directory = store.PathResolver.GetPackageDirectory(package);
                    if (directory != null)
                    {
                        return directory;
                    }
                }
            }

            // TODO: Check version for default package
            if (packageName == DefaultPackageName)
            {
                if (versionRange == null || versionRange.Contains(DefaultPackageVersion))
                {
                    return defaultPackageDirectory;
                }
            }

            return null;
        }
Example #4
0
        private UDirectory GetPackageDirectory(string packageName, PackageVersionRange versionRange, bool allowPreleaseVersion = false, bool allowUnlisted = false)
        {
            if (packageName == null) throw new ArgumentNullException("packageName");

            if (store != null)
            {
                var versionSpec = versionRange.ToVersionSpec();
                var package = store.Manager.LocalRepository.FindPackage(packageName, versionSpec, allowPreleaseVersion, allowUnlisted);

                // If package was not found, 
                if (package != null)
                {
                    var directory = store.PathResolver.GetPackageDirectory(package);
                    if (directory != null)
                    {
                        return directory;
                    }
                }
            }

            // TODO: Check version for default package
            return DefaultPackageName == packageName ? defaultPackageDirectory : null;
        }