/// <summary>
 /// Returns project caches that is used in this dependency.
 /// </summary>
 protected virtual Project GetProject()
 {
     if (m_Project == null)
     {
         var projectSource = Path.Combine(GetLocation(), GetName()) + ".gdproj.cs";
         if (File.Exists(projectSource))
         {
             m_Project = ProjectFactory.Create(projectSource);
         }
         else
         {
             throw new BuildSystemException("Corresponding \"{0}\" project source file was not found.", projectSource);
         }
     }
     return(m_Project);
 }
Esempio n. 2
0
 /// <summary>
 /// Collects list of projects in solution.
 /// </summary>
 public virtual IEnumerable <Project> EnumerateProjects()
 {
     foreach (var solutionSourcePath in Directory.EnumerateFiles(Path.Combine(GetLocation(), "Projects"), "*.gdproj.cs", SearchOption.AllDirectories))
     {
         Project project;
         try
         {
             project = ProjectFactory.Create(solutionSourcePath);
         }
         catch (Exception exception)
         {
             Console.WriteLine($"Failed to load project {solutionSourcePath} with exception {exception}");
             continue;
         }
         //if (solutionCache.IsSupported)
         {
             yield return(project);
         }
     }
 }