Exemplo n.º 1
0
        /// <summary>
        /// Execute the task and run the cooker.
        /// </summary>
        /// <param name="BuildProducts">List of build products for the current node. Cooking build products will be appended to this list.</param>
        /// <returns>True if the node succeeded</returns>
        public override bool Execute(List <string> BuildProducts)
        {
            // Figure out the project that this target belongs to
            FileReference ProjectFile;

            if (UProjectInfo.TryGetProjectForTarget(Target, out ProjectFile))
            {
                ProjectFile = null;
            }

            // Execute the cooker
            using (TelemetryStopwatch CookStopwatch = new TelemetryStopwatch("Cook.{0}.{1}", ProjectFile.GetFileNameWithoutExtension(), CookPlatform))
            {
                CommandUtils.CookCommandlet(ProjectFile, "UE4Editor-Cmd.exe", Maps, null, null, null, CookPlatform, Arguments);
            }

            // Find all the cooked files
            DirectoryReference   CookedDirectory = DirectoryReference.Combine(ProjectFile.Directory, "Saved", "Cooked", CookPlatform);
            List <FileReference> CookedFiles     = CookedDirectory.EnumerateFileReferences().ToList();

            if (CookedFiles.Count == 0)
            {
                throw new AutomationException("Cooking did not produce any files in {0}", CookedDirectory.FullName);
            }
            BuildProducts.AddRange(CookedFiles.Select(x => x.FullName));
            return(true);
        }