예제 #1
0
 public void Build(IEnumerable <string> roots)
 {
     foreach (var t in roots)
     {
         if (string.IsNullOrEmpty(t))
         {
             Errors.Add(new BuilderError(t, "Target specification was null or empty."));
             continue;
         }
         if (!Directory.Exists(t))
         {
             Errors.Add(new BuilderError(t, "The specified target directory does not exist."));
         }
         var tree = new ParameterFileTree(t);
         Trees.Add(t, tree);
     }
 }
 public IParameterFileForest Build(IEnumerable<string> targets)
 {
     Targets = targets.ToList();
     Errors = new List<BuilderError>(Targets.Count);
     var forest = new ParameterFileForest();
     foreach (var t in targets)
     {
         if (string.IsNullOrEmpty(t))
         {
             Errors.Add(new BuilderError(t, "Target specification was null or empty."));
             continue;
         }
         if (!Directory.Exists(t))
         {
             Errors.Add(new BuilderError(t, "The specified target directory does not exist."));
         }
         var tree = new ParameterFileTree(t);
         forest.Trees.Add(t, tree);
     }
     return Result = forest; // cache it in case the builder lifetime will be extended for some reason
 }