/// <summary>
 /// Allow this task to merge with other tasks within the same node. This can be useful to allow tasks to execute in parallel and reduce overheads.
 /// </summary>
 /// <param name="OtherTasks">Other tasks that this task can merge with. If a merge takes place, the other tasks should be removed from the list.</param>
 public override void Merge(List <BuildTask> OtherTasks)
 {
     for (int Idx = 0; Idx < OtherTasks.Count; Idx++)
     {
         CompileTask OtherCompileTask = OtherTasks[Idx] as CompileTask;
         if (OtherCompileTask != null)
         {
             Targets.AddRange(OtherCompileTask.Targets);
             OtherTasks.RemoveAt(Idx);
         }
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Allow this task to merge with other tasks within the same node. This can be useful to allow tasks to execute in parallel and reduce overheads.
 /// </summary>
 /// <param name="OtherTasks">Other tasks that this task can merge with. If a merge takes place, the other tasks should be removed from the list.</param>
 public override void Merge(List <CustomTask> OtherTasks)
 {
     for (int Idx = 0; Idx < OtherTasks.Count; Idx++)
     {
         CompileTask OtherCompileTask = OtherTasks[Idx] as CompileTask;
         if (OtherCompileTask != null)
         {
             Targets.AddRange(OtherCompileTask.Targets);
             foreach (KeyValuePair <UE4Build.BuildTarget, string> TargetTagName in OtherCompileTask.TargetToTagName)
             {
                 TargetToTagName.Add(TargetTagName.Key, TargetTagName.Value);
             }
             OtherTasks.RemoveAt(Idx);
         }
     }
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Adds another task to this executor
        /// </summary>
        /// <param name="Task">Task to add</param>
        /// <returns>True if the task could be added, false otherwise</returns>
        public bool Add(CustomTask Task)
        {
            CompileTask CompileTask = Task as CompileTask;

            if (CompileTask == null)
            {
                return(false);
            }

            CompileTaskParameters Parameters = CompileTask.Parameters;

            UE4Build.BuildTarget Target = new UE4Build.BuildTarget {
                TargetName = Parameters.Target, Platform = Parameters.Platform, Config = Parameters.Configuration, UBTArgs = "-nobuilduht " + (Parameters.Arguments ?? "")
            };
            if (!String.IsNullOrEmpty(Parameters.Tag))
            {
                TargetToTagName.Add(Target, Parameters.Tag);
            }
            Targets.Add(Target);

            return(true);
        }
        /// <summary>
        /// Adds another task to this executor
        /// </summary>
        /// <param name="Task">Task to add</param>
        /// <returns>True if the task could be added, false otherwise</returns>
        public bool Add(CustomTask Task)
        {
            CompileTask CompileTask = Task as CompileTask;

            if (CompileTask == null)
            {
                return(false);
            }

            if (Targets.Count > 0)
            {
                if (bAllowXGE != CompileTask.Parameters.AllowXGE)
                {
                    return(false);
                }
                if (!bAllowParallelExecutor || !CompileTask.Parameters.AllowParallelExecutor)
                {
                    return(false);
                }
            }

            CompileTaskParameters Parameters = CompileTask.Parameters;

            bAllowXGE &= Parameters.AllowXGE;
            bAllowParallelExecutor &= Parameters.AllowParallelExecutor;

            UE4Build.BuildTarget Target = new UE4Build.BuildTarget {
                TargetName = Parameters.Target, Platform = Parameters.Platform, Config = Parameters.Configuration, UBTArgs = "-nobuilduht " + (Parameters.Arguments ?? "")
            };
            if (!String.IsNullOrEmpty(Parameters.Tag))
            {
                TargetToTagName.Add(Target, Parameters.Tag);
            }
            Targets.Add(Target);

            return(true);
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="Task">Initial task to execute</param>
 public CompileTaskExecutor(CompileTask Task)
 {
     Add(Task);
 }