Пример #1
0
 /// <summary>
 /// Searches a directory tree for build products to be cleaned.
 /// </summary>
 /// <param name="BaseDir">The directory to search</param>
 /// <param name="NamePrefixes">Target or application names that may appear at the start of the build product name (eg. "UE4Editor", "ShooterGameEditor")</param>
 /// <param name="NameSuffixes">Suffixes which may appear at the end of the build product name</param>
 /// <param name="FilesToClean">List to receive a list of files to be cleaned</param>
 /// <param name="DirectoriesToClean">List to receive a list of directories to be cleaned</param>
 public void FindBuildProductsToClean(DirectoryReference BaseDir, string[] NamePrefixes, string[] NameSuffixes, List <FileReference> FilesToClean, List <DirectoryReference> DirectoriesToClean)
 {
     foreach (FileReference File in DirectoryReference.EnumerateFiles(BaseDir))
     {
         string FileName = File.GetFileName();
         if (IsDefaultBuildProduct(FileName, NamePrefixes, NameSuffixes) || IsBuildProduct(FileName, NamePrefixes, NameSuffixes))
         {
             FilesToClean.Add(File);
         }
     }
     foreach (DirectoryReference SubDir in DirectoryReference.EnumerateDirectories(BaseDir))
     {
         string SubDirName = SubDir.GetDirectoryName();
         if (IsBuildProduct(SubDirName, NamePrefixes, NameSuffixes))
         {
             DirectoriesToClean.Add(SubDir);
         }
         else
         {
             FindBuildProductsToClean(SubDir, NamePrefixes, NameSuffixes, FilesToClean, DirectoriesToClean);
         }
     }
 }