private Task <NugetResult> findDependenciesFor(Dependency dependency, UpdateMode mode, int depth, SearchLocation location, List <Dependency> dependencies) { var result = findLocal(dependency, location); return(Task.Factory.StartNew(() => { if (result.Found) { processNuget(result.Nuget, dependency, mode, depth, location, dependencies); return result; } var search = NugetSearch.Find(_solution, dependency); search.ContinueWith(task => { if (!task.Result.Found) { return; } result.Import(task.Result); var nuget = task.Result.Nuget; processNuget(nuget, dependency, mode, depth, location, dependencies); }, TaskContinuationOptions.NotOnFaulted | TaskContinuationOptions.AttachedToParent); return result; }, TaskCreationOptions.AttachedToParent)); }
public void find_the_async_package() { var asyncTargetPack = new Dependency("Microsoft.CompilerServices.AsyncTargetingPack"); var solution = new Solution(); solution.AddDependency(asyncTargetPack); var task = NugetSearch.Find(solution, asyncTargetPack); task.Wait(); task.Result.Nuget.Version.ShouldEqual(new SemanticVersion("1.0.1")); }
public virtual Task <NugetResult> NugetFor(Dependency dependency) { return(NugetSearch.Find(_solution, dependency)); }