/// <summary>
        /// Discover and fill in the project info
        /// </summary>
        public static void FillProjectInfo()
        {
            DateTime StartTime = DateTime.Now;

            List <DirectoryInfo> DirectoriesToSearch = GetNonForeignProjectBaseDirs().Select(x => new DirectoryInfo(x.FullName)).ToList();

            Log.TraceVerbose("\tFound {0} directories to search", DirectoriesToSearch.Count);

            foreach (DirectoryInfo DirToSearch in DirectoriesToSearch)
            {
                if (DirToSearch.Exists)
                {
                    foreach (DirectoryInfo SubDir in DirToSearch.EnumerateDirectories())
                    {
                        foreach (FileInfo UProjFile in SubDir.EnumerateFiles("*.uproject", SearchOption.TopDirectoryOnly))
                        {
                            AddProject(new FileReference(UProjFile));
                        }
                    }
                }
                else
                {
                    Log.TraceVerbose("ProjectInfo: Skipping directory {0} from .uprojectdirs file as it doesn't exist.", DirToSearch);
                }
            }

            DateTime StopTime = DateTime.Now;

            if (UnrealBuildTool.bPrintPerformanceInfo)
            {
                TimeSpan TotalProjectInfoTime = StopTime - StartTime;
                Log.TraceInformation("FillProjectInfo took {0} milliseconds", TotalProjectInfoTime.TotalMilliseconds);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Discover and fill in the project info
        /// </summary>
        public static void FillProjectInfo()
        {
            DateTime StartTime = DateTime.Now;

            List <DirectoryInfo> DirectoriesToSearch = new List <DirectoryInfo>();

            // Find all the .uprojectdirs files contained in the root folder and add their entries to the search array
            string EngineSourceDirectory = Path.GetFullPath(Path.Combine(RootDirectory, "Engine", "Source"));

            foreach (FileReference ProjectDirsFile in DirectoryReference.EnumerateFiles(UnrealBuildTool.RootDirectory, "*.uprojectdirs", SearchOption.TopDirectoryOnly))
            {
                Log.TraceVerbose("\tFound uprojectdirs file {0}", ProjectDirsFile.FullName);
                foreach (string Line in File.ReadAllLines(ProjectDirsFile.FullName))
                {
                    string TrimLine = Line.Trim();
                    if (!TrimLine.StartsWith(";"))
                    {
                        DirectoryReference BaseProjectDir = DirectoryReference.Combine(UnrealBuildTool.RootDirectory, TrimLine);
                        if (BaseProjectDir.IsUnderDirectory(UnrealBuildTool.RootDirectory))
                        {
                            DirectoriesToSearch.Add(new DirectoryInfo(BaseProjectDir.FullName));
                        }
                        else
                        {
                            Log.TraceWarning("Project search path '{0}' is not under root directory, ignoring.", TrimLine);
                        }
                    }
                }
            }

            Log.TraceVerbose("\tFound {0} directories to search", DirectoriesToSearch.Count);

            foreach (DirectoryInfo DirToSearch in DirectoriesToSearch)
            {
                Log.TraceVerbose("\t\tSearching {0}", DirToSearch.FullName);
                if (DirToSearch.Exists)
                {
                    foreach (DirectoryInfo SubDir in DirToSearch.EnumerateDirectories())
                    {
                        Log.TraceVerbose("\t\t\tFound subdir {0} ({1})", SubDir.FullName, SubDir.Name);
                        foreach (FileInfo UProjFile in SubDir.EnumerateFiles("*.uproject", SearchOption.TopDirectoryOnly))
                        {
                            Log.TraceVerbose("\t\t\t\t{0}", UProjFile.FullName);
                            AddProject(new FileReference(UProjFile));
                        }
                    }
                }
                else
                {
                    Log.TraceVerbose("ProjectInfo: Skipping directory {0} from .uprojectdirs file as it doesn't exist.", DirToSearch);
                }
            }

            DateTime StopTime = DateTime.Now;

            if (UnrealBuildTool.bPrintPerformanceInfo)
            {
                TimeSpan TotalProjectInfoTime = StopTime - StartTime;
                Log.TraceInformation("FillProjectInfo took {0} milliseconds", TotalProjectInfoTime.TotalMilliseconds);
            }
        }