protected void LoadFromCompiledPackage(ALProjectFile projectFile) { string projectPackageFileName = System.IO.Path.Combine(this.Path, projectFile.publisher.NotNull() + "_" + projectFile.name.NotNull() + "_" + projectFile.version.NotNull() + ".app"); if (File.Exists(projectPackageFileName)) { ALPackageSymbolsLibrary mainSymbolsLib = this.PackageSymbolsCache.GetSymbols(projectPackageFileName, false); this.Root.AddChildSymbol(mainSymbolsLib.Root); } else { this.Root.AddChildSymbol(new ALSymbolInformation(ALSymbolKind.Package, "Recompile solution - project file not found")); } }
public override bool Load(bool forceReload) { this.Dependencies.Clear(); //load project information ALProjectFile projectFile = ALProjectFile.Load(System.IO.Path.Combine(this.Path, "app.json")); this.FullName = StringHelper.Merge(projectFile.publisher, projectFile.name, projectFile.version); this.Root = new ALSymbolInformation(ALSymbolKind.ProjectDefinition, this.FullName); if (this.IncludeDependencies) { this.ProcessDependencies(projectFile, forceReload); } //process project source code this.ProcessSourceCode(); //return base.Load(forceReload); return(true); }
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); } }