static void AddOwn(Bundle bundle, Dictionary <string, string> packages, BundleScope scope, bool includeOptional) { foreach (var p in bundle.GetAllPackages(scope, includeOptional)) { packages[p.Key] = p.Value; } }
Dictionary <string, string> GetOptionalPackages(BundleScope scope) { switch (scope) { case BundleScope.All: return (GetOptionalPackages(BundleGroup.All) .Concat(GetOptionalPackages(BundleGroup.Client)) .Concat(GetOptionalPackages(BundleGroup.Server)) .ToDictionary(x => x.Key, x => x.Value)); case BundleScope.Server: return (GetOptionalPackages(BundleGroup.All) .Concat(GetOptionalPackages(BundleGroup.Server)) .ToDictionary(x => x.Key, x => x.Value)); case BundleScope.Client: return (GetOptionalPackages(BundleGroup.All) .Concat(GetOptionalPackages(BundleGroup.Client)) .ToDictionary(x => x.Key, x => x.Value)); } return(null); }
async Task ResolveDependencies(Bundle bundle, Dictionary <string, string> packages, List <string> deps, BundleScope scope = BundleScope.All, bool includeOptional = false, bool remote = true) { await AddDependencies(bundle, packages, deps, scope, includeOptional, remote).ConfigureAwait(false); AddOwn(bundle, packages, scope, includeOptional); }
async Task<Dictionary<string, string>> GetDependencyTree(Bundle bundle, bool includeOptional, BundleScope scope, bool remote = true) { var packages = new Dictionary<string, string>(); var deps = new List<string>(); PackageManager.StatusRepo.Reset(RepoStatus.Resolving, 1); await ResolveDependencies(bundle, packages, deps, scope, includeOptional, remote).ConfigureAwait(false); return packages; }
public async Task<Package[]> Process(string bundleName, bool includeOptional = false, BundleScope scope = BundleScope.All, bool? useVersionedPackageFolders = null, bool noCheckout = false, bool skipWhenLocalMatch = false) { var bundle = await GetCol(bundleName).ConfigureAwait(false); return await Process(bundle, includeOptional, scope, useVersionedPackageFolders, noCheckout, skipWhenLocalMatch).ConfigureAwait(false); }
public async Task<List<Package>> Checkout(Bundle bundle, bool includeOptional = false, BundleScope scope = BundleScope.All, bool? useVersionedPackageFolders = null) { Repository.Log("Processing bundle: {0}", bundle.GetFullName()); var packages = await GetDependencyTree(bundle, includeOptional, scope, false).ConfigureAwait(false); return await PackageManager.Checkout( packages.Reverse().Select(x => new Dependency(x.Key, x.Value).GetFullName()).ToArray(), useVersionedPackageFolders); }
public async Task <List <Package> > Checkout(Bundle bundle, bool includeOptional = false, BundleScope scope = BundleScope.All, bool?useVersionedPackageFolders = null) { Repository.Log("Processing bundle: {0}", bundle.GetFullName()); var packages = await GetDependencyTree(bundle, includeOptional, scope, false).ConfigureAwait(false); return (await PackageManager.Checkout( packages.Reverse().Select(x => new Dependency(x.Key, x.Value).GetFullName()).ToArray(), useVersionedPackageFolders)); }
public async Task <Package[]> Process(string bundleName, bool includeOptional = false, BundleScope scope = BundleScope.All, bool?useVersionedPackageFolders = null, bool noCheckout = false, bool skipWhenLocalMatch = false) { var bundle = await GetCol(bundleName).ConfigureAwait(false); return (await Process(bundle, includeOptional, scope, useVersionedPackageFolders, noCheckout, skipWhenLocalMatch).ConfigureAwait(false)); }
public Dictionary <string, string> GetAllPackages(BundleScope scope, bool includeOptional = false) { IEnumerable <KeyValuePair <string, string> > packages = new Collection <KeyValuePair <string, string> >(); if (includeOptional) { packages = GetOptionalPackages(scope); } return(packages.Concat(GetPackages(scope)).ToDictionary(x => x.Key, x => x.Value)); }
public Dictionary <string, string> GetAllOptionalPackages(BundleScope scope) { var packages = new Dictionary <string, string>(); packages = Dependencies.Select(c => new Bundle("optional-packages")) .Aggregate(packages, (current, col) => current.Concat(col.GetAllOptionalPackages(scope)) .ToDictionary(x => x.Key, x => x.Value)); return(packages.Concat(GetOptionalPackages(scope)).ToDictionary(x => x.Key, x => x.Value)); }
public async Task<Package[]> Process(Bundle bundle, bool includeOptional = false, BundleScope scope = BundleScope.All, bool? useVersionedPackageFolders = null, bool noCheckout = false, bool skipWhenLocalMatch = false) { Repository.Log("Processing bundle: {0}", bundle.GetFullName()); var packages = await GetDependencyTree(bundle, includeOptional, scope).ConfigureAwait(false); return await PackageManager.ProcessPackages( packages.Reverse().Select(x => new SpecificVersion(x.Key, x.Value)).ToArray(), useVersionedPackageFolders, noCheckout, skipWhenLocalMatch).ConfigureAwait(false); }
public async Task <Package[]> Process(Bundle bundle, bool includeOptional = false, BundleScope scope = BundleScope.All, bool?useVersionedPackageFolders = null, bool noCheckout = false, bool skipWhenLocalMatch = false) { Repository.Log("Processing bundle: {0}", bundle.GetFullName()); var packages = await GetDependencyTree(bundle, includeOptional, scope).ConfigureAwait(false); return (await PackageManager.ProcessPackages( packages.Reverse().Select(x => new SpecificVersion(x.Key, x.Value)).ToArray(), useVersionedPackageFolders, noCheckout, skipWhenLocalMatch).ConfigureAwait(false)); }
async Task AddDependencies(Bundle bundle, Dictionary <string, string> packages, List <string> deps, BundleScope scope, bool includeOptional, bool remote) { foreach (var dep in bundle.Dependencies) { var d = new Dependency(dep.Key, dep.Value); if (deps.Contains(dep.Key)) { Repository.Log("Conflicting bundle dependency {0}, skipping", dep.Key); continue; } deps.Add(dep.Key); var depCol = await GetCol(d.GetFullName(), remote).ConfigureAwait(false); await ResolveDependencies(depCol, packages, deps, scope, includeOptional).ConfigureAwait(false); } }
static void AddOwn(Bundle bundle, Dictionary<string, string> packages, BundleScope scope, bool includeOptional) { foreach (var p in bundle.GetAllPackages(scope, includeOptional)) packages[p.Key] = p.Value; }
async Task AddDependencies(Bundle bundle, Dictionary<string, string> packages, List<string> deps, BundleScope scope, bool includeOptional, bool remote) { foreach (var dep in bundle.Dependencies) { var d = new Dependency(dep.Key, dep.Value); if (deps.Contains(dep.Key)) { Repository.Log("Conflicting bundle dependency {0}, skipping", dep.Key); continue; } deps.Add(dep.Key); var depCol = await GetCol(d.GetFullName(), remote).ConfigureAwait(false); await ResolveDependencies(depCol, packages, deps, scope, includeOptional).ConfigureAwait(false); } }
async Task <Dictionary <string, string> > GetDependencyTree(Bundle bundle, bool includeOptional, BundleScope scope, bool remote = true) { var packages = new Dictionary <string, string>(); var deps = new List <string>(); PackageManager.StatusRepo.Reset(RepoStatus.Resolving, 1); await ResolveDependencies(bundle, packages, deps, scope, includeOptional, remote).ConfigureAwait(false); return(packages); }
async Task ResolveDependencies(Bundle bundle, Dictionary<string, string> packages, List<string> deps, BundleScope scope = BundleScope.All, bool includeOptional = false, bool remote = true) { await AddDependencies(bundle, packages, deps, scope, includeOptional, remote).ConfigureAwait(false); AddOwn(bundle, packages, scope, includeOptional); }