withSIX.Sync.Core.Packages.PackageManager.ProcessPackages C# (CSharp) Method

ProcessPackages() public method

public ProcessPackages ( IEnumerable packageNames, bool useFullNameOverride = null, bool noCheckout = false, bool skipWhenFileMatches = true ) : Task
packageNames IEnumerable
useFullNameOverride bool
noCheckout bool
skipWhenFileMatches bool
return Task
        public async Task<Package[]> ProcessPackages(IEnumerable<Dependency> packageNames,
            bool? useFullNameOverride = null,
            bool noCheckout = false, bool skipWhenFileMatches = true) {
            if (Repo.Config.OperationMode == RepositoryOperationMode.SinglePackage)
                throw new Exception("Cannot process repository in SinglePackage mode");
            var useFullName = Repo.Config.UseVersionedPackageFolders;

            if (useFullNameOverride.HasValue)
                useFullName = useFullNameOverride.Value;

            // Add this package, then add it's dependencies, and so on
            // The list should be unique based on package (name + version + branch)
            // If there is a conflict, the process should be aborted. A conflict can arise when one package needs a version locked on X, and another on Y
            // First resolve all dependencies
            // So that we can determine conflicting dependencies, remove double dependencies, etc.
            // Let the package Download itself, by providing it with sources (remotes)
            var packages =
                (await GetDependencyTree(packageNames.ToArray(), noCheckout, useFullName).ConfigureAwait(false))
                    .OrderByDescending(x => x.MetaData.SizePacked).ToArray();

            StatusRepo.Reset(RepoStatus.Processing, packages.Length);

            if (Settings.GlobalWorkingPath != null) {
                var s = Settings.GlobalWorkingPath.ToString();
                foreach (var p in packages)
                    p.SetWorkingPath(s);
            }

            if (LegacyMode) {
                await ProcessLegacy(noCheckout, skipWhenFileMatches, packages).ConfigureAwait(false);
            } else {
                await ProcessModern(noCheckout, packages).ConfigureAwait(false);
            }

            await Repo.SaveAsync().ConfigureAwait(false);

            return packages.ToArray();
        }

Same methods

PackageManager::ProcessPackages ( IEnumerable packageNames, bool useFullNameOverride = null, bool noCheckout = false, bool skipWhenFileMatches = true ) : Task