protected bool AddPackage(ALAppPackageFileInfosCollection packageFiles, string publisher, string name, string version, bool forceReload) { ALAppPackageFileInfo packageFileInfo = packageFiles.Find(publisher, name, version); if (packageFileInfo != null) { this.Dependencies.Add(this.PackageSymbolsCache.GetSymbols(packageFileInfo.FilePath, forceReload)); return(true); } return(false); }
protected void ProcessDependencies(ALProjectFile projectFile, bool forceReload) { //load list of packages ALAppPackageFileInfosCollection packageFiles = new ALAppPackageFileInfosCollection(); packageFiles.LoadFromFolder(this.PackagesPath); //collect list of projects from other folders WorkspaceProjectsCollection workspaceProjects = null; if ((this.WorkspaceFolders != null) && (this.WorkspaceFolders.Length > 1)) { workspaceProjects = new WorkspaceProjectsCollection(this.WorkspaceFolders); workspaceProjects.Load(); } //collect packages if (projectFile.dependencies != null) { for (int i = 0; i < projectFile.dependencies.Length; i++) { bool workspaceProjectFound = false; if (workspaceProjects != null) { WorkspaceProject depProject = workspaceProjects.FindByReference(projectFile.dependencies[i].appId, projectFile.dependencies[i].publisher, projectFile.dependencies[i].name, projectFile.dependencies[i].version); if (depProject != null) { workspaceProjectFound = true; this.AddDepProject(depProject); } } if (!workspaceProjectFound) { this.AddPackage(packageFiles, projectFile.dependencies[i].publisher, projectFile.dependencies[i].name, projectFile.dependencies[i].version, forceReload); } } } //collect system packages if (!String.IsNullOrWhiteSpace(projectFile.application)) { this.AddPackage(packageFiles, "Microsoft", "Application", projectFile.application, forceReload); } if (!String.IsNullOrWhiteSpace(projectFile.platform)) { this.AddPackage(packageFiles, "Microsoft", "System", projectFile.platform, forceReload); } if (!String.IsNullOrWhiteSpace(projectFile.test)) { this.AddPackage(packageFiles, "Microsoft", "Test", projectFile.test, forceReload); } //collect dependencies if (this.Dependencies.Count > 0) { ALSymbolInformation dependenciesList = new ALSymbolInformation(ALSymbolKind.Dependencies, "Dependencies"); for (int i = 0; i < this.Dependencies.Count; i++) { dependenciesList.AddChildSymbol(this.Dependencies[i].Root); } this.Root.AddChildSymbol(dependenciesList); } }