Esempio n. 1
0
        public override void AddNodes(GUBP bp, UnrealTargetPlatform HostPlatform)
        {
            if(!bp.BranchOptions.bNoInstalledEngine)
            {
                // Find all the target platforms for this host platform.
                List<UnrealTargetPlatform> TargetPlatforms = GetTargetPlatforms(bp, HostPlatform);

                // Remove any platforms that aren't available on this machine
                TargetPlatforms.RemoveAll(x => !bp.ActivePlatforms.Contains(x));

                // Get the temp directory for stripped files for this host
                string StrippedDir = Path.GetFullPath(CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "Engine", "Saved", "Rocket", HostPlatform.ToString()));

                // Strip the host platform
                if (StripRocketNode.IsRequiredForPlatform(HostPlatform))
                {
                    bp.AddNode(new StripRocketToolsNode(HostPlatform, StrippedDir));
                    bp.AddNode(new StripRocketEditorNode(HostPlatform, StrippedDir));
                }

                // Strip all the target platforms that are built on this host
                foreach (UnrealTargetPlatform TargetPlatform in TargetPlatforms)
                {
                    if (GetSourceHostPlatform(bp, HostPlatform, TargetPlatform) == HostPlatform && StripRocketNode.IsRequiredForPlatform(TargetPlatform))
                    {
                        bp.AddNode(new StripRocketMonolithicsNode(bp, HostPlatform, TargetPlatform, StrippedDir));
                    }
                }

                // Build the DDC
                bp.AddNode(new BuildDerivedDataCacheNode(HostPlatform, GetCookPlatforms(HostPlatform, TargetPlatforms), CurrentFeaturePacks));

                // Generate a list of files that needs to be copied for each target platform
                bp.AddNode(new FilterRocketNode(bp, HostPlatform, TargetPlatforms, CurrentFeaturePacks, CurrentTemplates));

                // Copy the install to the output directory
                string LocalOutputDir = CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "LocalBuilds", "Rocket", CommandUtils.GetGenericPlatformName(HostPlatform));
                bp.AddNode(new GatherRocketNode(HostPlatform, TargetPlatforms, LocalOutputDir));

                // Add the aggregate node for the entire install
                GUBP.GUBPNode PromotableNode = bp.FindNode(GUBP.SharedAggregatePromotableNode.StaticGetFullName());
                PromotableNode.AddDependency(FilterRocketNode.StaticGetFullName(HostPlatform));
                PromotableNode.AddDependency(BuildDerivedDataCacheNode.StaticGetFullName(HostPlatform));

                // Add a node for GitHub promotions
                if(HostPlatform == UnrealTargetPlatform.Win64)
                {
                    string GitConfigRelativePath = "Engine/Build/Git/UnrealBot.ini";
                    if(CommandUtils.FileExists(CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, GitConfigRelativePath)))
                    {
                        bp.AddNode(new BuildGitPromotable(bp, HostPlatform, GitConfigRelativePath));
                        PromotableNode.AddDependency(BuildGitPromotable.StaticGetFullName(HostPlatform));
                    }
                }

                // Get the output directory for the build zips
                string PublishedEngineDir;
                if(ShouldDoSeriousThingsLikeP4CheckinAndPostToMCP())
                {
                    PublishedEngineDir = CommandUtils.CombinePaths(CommandUtils.RootSharedTempStorageDirectory(), "Rocket", "Automated", GetBuildLabel(), CommandUtils.GetGenericPlatformName(HostPlatform));
                }
                else
                {
                    PublishedEngineDir = CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "LocalBuilds", "RocketPublish", CommandUtils.GetGenericPlatformName(HostPlatform));
                }

                // Publish the install to the network
                bp.AddNode(new PublishRocketNode(HostPlatform, LocalOutputDir, PublishedEngineDir));
                bp.AddNode(new PublishRocketSymbolsNode(bp, HostPlatform, TargetPlatforms, PublishedEngineDir + "Symbols"));

                // Add a dependency on this being published as part of the shared promotable being labeled
                GUBP.SharedLabelPromotableSuccessNode LabelPromotableNode = (GUBP.SharedLabelPromotableSuccessNode)bp.FindNode(GUBP.SharedLabelPromotableSuccessNode.StaticGetFullName());
                LabelPromotableNode.AddDependency(PublishRocketNode.StaticGetFullName(HostPlatform));
                LabelPromotableNode.AddDependency(PublishRocketSymbolsNode.StaticGetFullName(HostPlatform));

                // Add dependencies on a promotable to do these steps too
                GUBP.WaitForSharedPromotionUserInput WaitForPromotionNode = (GUBP.WaitForSharedPromotionUserInput)bp.FindNode(GUBP.WaitForSharedPromotionUserInput.StaticGetFullName(true));
                WaitForPromotionNode.AddDependency(PublishRocketNode.StaticGetFullName(HostPlatform));
                WaitForPromotionNode.AddDependency(PublishRocketSymbolsNode.StaticGetFullName(HostPlatform));

                // Push everything behind the promotion triggers if we're doing things on the build machines
                if(ShouldDoSeriousThingsLikeP4CheckinAndPostToMCP() || bp.ParseParam("WithRocketPromotable"))
                {
                    string WaitForTrigger = GUBP.WaitForSharedPromotionUserInput.StaticGetFullName(false);

                    GatherRocketNode GatherRocket = (GatherRocketNode)bp.FindNode(GatherRocketNode.StaticGetFullName(HostPlatform));
                    GatherRocket.AddDependency(WaitForTrigger);

                    PublishRocketSymbolsNode PublishRocketSymbols = (PublishRocketSymbolsNode)bp.FindNode(PublishRocketSymbolsNode.StaticGetFullName(HostPlatform));
                    PublishRocketSymbols.AddDependency(WaitForTrigger);
                }
            }
        }
Esempio n. 2
0
 static void AddRuleForBuildProducts(FileFilter Filter, GUBP bp, string NodeName, FileFilterType Type)
 {
     GUBP.GUBPNode Node = bp.FindNode(NodeName);
     if(Node == null)
     {
         throw new AutomationException("Couldn't find node '{0}'", NodeName);
     }
     Filter.AddRuleForFiles(Node.BuildProducts, CommandUtils.CmdEnv.LocalRoot, Type);
 }
Esempio n. 3
0
        public override void DoBuild(GUBP bp)
        {
            CommandUtils.DeleteDirectoryContents(OutputDir);

            // Extract the editor headers
            CommandUtils.UnzipFiles(GUBP.RootEditorNode.StaticGetArchivedHeadersPath(HostPlatform), CommandUtils.CmdEnv.LocalRoot);

            // Extract all the headers for code target platforms
            foreach(UnrealTargetPlatform CodeTargetPlatform in CodeTargetPlatforms)
            {
                UnrealTargetPlatform SourceHostPlatform = RocketBuild.GetSourceHostPlatform(bp, HostPlatform, CodeTargetPlatform);
                string ZipFileName = GUBP.GamePlatformMonolithicsNode.StaticGetArchivedHeadersPath(SourceHostPlatform, bp.Branch.BaseEngineProject, CodeTargetPlatform);
                CommandUtils.UnzipFiles(ZipFileName, CommandUtils.CmdEnv.LocalRoot);
            }

            // Copy the depot files to the output directory
            FilterRocketNode FilterNode = (FilterRocketNode)bp.FindNode(FilterRocketNode.StaticGetFullName(HostPlatform));
            CopyManifestFilesToOutput(FilterNode.DepotManifestPath, CommandUtils.CmdEnv.LocalRoot, OutputDir);

            // Copy the stripped files to the output directory
            foreach(KeyValuePair<string, string> StrippedManifestPath in FilterNode.StrippedNodeManifestPaths)
            {
                StripRocketNode StripNode = (StripRocketNode)bp.FindNode(StrippedManifestPath.Key);
                CopyManifestFilesToOutput(StrippedManifestPath.Value, StripNode.StrippedDir, OutputDir);
            }

            // Copy the DDC to the output directory
            BuildDerivedDataCacheNode DerivedDataCacheNode = (BuildDerivedDataCacheNode)bp.FindNode(BuildDerivedDataCacheNode.StaticGetFullName(HostPlatform));
            CopyManifestFilesToOutput(DerivedDataCacheNode.SavedManifestPath, DerivedDataCacheNode.SavedDir, OutputDir);

            // Write the Rocket.txt file with the
            string RocketFile = CommandUtils.CombinePaths(OutputDir, "Engine/Build/Rocket.txt");
            CommandUtils.WriteAllText(RocketFile, "-installedengine -rocket");

            // Create a dummy build product
            BuildProducts = new List<string>();
            SaveRecordOfSuccessAndAddToBuildProducts();
        }
Esempio n. 4
0
        public override void DoBuild(GUBP bp)
        {
            BuildProducts = new List<string>();
            FileFilter Filter = new FileFilter();

            // Include all the editor products
            AddRuleForBuildProducts(Filter, bp, GUBP.ToolsForCompileNode.StaticGetFullName(HostPlatform), FileFilterType.Include);
            AddRuleForBuildProducts(Filter, bp, GUBP.RootEditorNode.StaticGetFullName(HostPlatform), FileFilterType.Include);
            AddRuleForBuildProducts(Filter, bp, GUBP.ToolsNode.StaticGetFullName(HostPlatform), FileFilterType.Include);

            // Include win64 tools on Mac, to get the win64 build of UBT, UAT and IPP
            if (HostPlatform == UnrealTargetPlatform.Mac && bp.HostPlatforms.Contains(UnrealTargetPlatform.Win64))
            {
                AddRuleForBuildProducts(Filter, bp, GUBP.ToolsNode.StaticGetFullName(UnrealTargetPlatform.Win64), FileFilterType.Include);
                AddRuleForBuildProducts(Filter, bp, GUBP.ToolsForCompileNode.StaticGetFullName(UnrealTargetPlatform.Win64), FileFilterType.Include);
            }

            // Include the editor headers
            UnzipAndAddRuleForHeaders(GUBP.RootEditorNode.StaticGetArchivedHeadersPath(HostPlatform), Filter, FileFilterType.Include);

            // Include the build dependencies for every code platform
            foreach(UnrealTargetPlatform TargetPlatform in TargetPlatforms)
            {
                if(RocketBuild.IsCodeTargetPlatform(HostPlatform, TargetPlatform))
                {
                    UnrealTargetPlatform SourceHostPlatform = RocketBuild.GetSourceHostPlatform(bp, HostPlatform, TargetPlatform);
                    string FileListPath = GUBP.GamePlatformMonolithicsNode.StaticGetBuildDependenciesPath(SourceHostPlatform, bp.Branch.BaseEngineProject, TargetPlatform);
                    Filter.AddRuleForFiles(UnrealBuildTool.Utils.ReadClass<UnrealBuildTool.ExternalFileList>(FileListPath).FileNames, CommandUtils.CmdEnv.LocalRoot, FileFilterType.Include);
                    UnzipAndAddRuleForHeaders(GUBP.GamePlatformMonolithicsNode.StaticGetArchivedHeadersPath(SourceHostPlatform, bp.Branch.BaseEngineProject, TargetPlatform), Filter, FileFilterType.Include);
                }
            }

            // Add the monolithic binaries
            foreach(UnrealTargetPlatform TargetPlatform in TargetPlatforms)
            {
                UnrealTargetPlatform SourceHostPlatform = RocketBuild.GetSourceHostPlatform(bp, HostPlatform, TargetPlatform);
                bool bIsCodeTargetPlatform = RocketBuild.IsCodeTargetPlatform(SourceHostPlatform, TargetPlatform);
                AddRuleForBuildProducts(Filter, bp, GUBP.GamePlatformMonolithicsNode.StaticGetFullName(SourceHostPlatform, bp.Branch.BaseEngineProject, TargetPlatform, Precompiled: bIsCodeTargetPlatform), FileFilterType.Include);
            }

            // Include the feature packs
            foreach(string CurrentFeaturePack in CurrentFeaturePacks)
            {
                BranchInfo.BranchUProject Project = bp.Branch.FindGameChecked(CurrentFeaturePack);
                Filter.AddRuleForFile(GUBP.MakeFeaturePacksNode.GetOutputFile(Project), CommandUtils.CmdEnv.LocalRoot, FileFilterType.Include);
            }

            // Include all the templates
            foreach (string Template in CurrentTemplates)
            {
                BranchInfo.BranchUProject Project = bp.Branch.FindGameChecked(Template);
                Filter.Include("/" + Utils.StripBaseDirectory(Path.GetDirectoryName(Project.FilePath), CommandUtils.CmdEnv.LocalRoot).Replace('\\', '/') + "/...");
            }

            // Include all the standard rules
            string RulesFileName = CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "Engine", "Build", "InstalledEngineFilters.ini");
            Filter.ReadRulesFromFile(RulesFileName, "CopyEditor", HostPlatform.ToString());
            Filter.ReadRulesFromFile(RulesFileName, "CopyTargetPlatforms", HostPlatform.ToString());

            // Custom rules for each target platform
            foreach(UnrealTargetPlatform TargetPlaform in TargetPlatforms)
            {
                string SectionName = String.Format("CopyTargetPlatform.{0}", TargetPlaform.ToString());
                Filter.ReadRulesFromFile(RulesFileName, SectionName, HostPlatform.ToString());
            }

            // Add the final exclusions for legal reasons.
            Filter.ExcludeConfidentialPlatforms();
            Filter.ExcludeConfidentialFolders();

            // Run the filter on the stripped symbols, and remove those files from the copy filter
            List<string> AllStrippedFiles = new List<string>();
            foreach(KeyValuePair<string, string> StrippedNodeManifestPath in StrippedNodeManifestPaths)
            {
                List<string> StrippedFiles = new List<string>();

                StripRocketNode StripNode = (StripRocketNode)bp.FindNode(StrippedNodeManifestPath.Key);
                foreach(string BuildProduct in StripNode.BuildProducts)
                {
                    if(Utils.IsFileUnderDirectory(BuildProduct, StripNode.StrippedDir))
                    {
                        string RelativePath = CommandUtils.StripBaseDirectory(Path.GetFullPath(BuildProduct), StripNode.StrippedDir);
                        if(Filter.Matches(RelativePath))
                        {
                            StrippedFiles.Add(RelativePath);
                            AllStrippedFiles.Add(RelativePath);
                            Filter.Exclude("/" + RelativePath);
                        }
                    }
                }

                WriteManifest(StrippedNodeManifestPath.Value, StrippedFiles);
                BuildProducts.Add(StrippedNodeManifestPath.Value);
            }

            // Write the filtered list of depot files to disk, removing any symlinks
            List<string> DepotFiles = Filter.ApplyToDirectory(CommandUtils.CmdEnv.LocalRoot, true).ToList();
            WriteManifest(DepotManifestPath, DepotFiles);
            BuildProducts.Add(DepotManifestPath);

            // Sort the list of output files
            SortedDictionary<string, bool> SortedFiles = new SortedDictionary<string,bool>(StringComparer.InvariantCultureIgnoreCase);
            foreach(string DepotFile in DepotFiles)
            {
                SortedFiles.Add(DepotFile, false);
            }
            foreach(string StrippedFile in AllStrippedFiles)
            {
                SortedFiles.Add(StrippedFile, true);
            }

            // Write the list to the log
            CommandUtils.Log("Files to be included in Rocket build:");
            foreach(KeyValuePair<string, bool> SortedFile in SortedFiles)
            {
                CommandUtils.Log("  {0}{1}", SortedFile.Key, SortedFile.Value? " (stripped)" : "");
            }
        }
Esempio n. 5
0
        public override void DoBuild(GUBP bp)
        {
            BuildProducts = new List<string>();

            string InputDir = Path.GetFullPath(CommandUtils.CmdEnv.LocalRoot);
            string RulesFileName = CommandUtils.CombinePaths(CommandUtils.CmdEnv.LocalRoot, "Engine", "Build", "InstalledEngineFilters.ini");

            // Read the filter for files on this platform
            FileFilter StripFilter = new FileFilter();
            StripFilter.ReadRulesFromFile(RulesFileName, "StripSymbols." + TargetPlatform.ToString(), HostPlatform.ToString());

            // Apply the filter to the build products
            List<string> SourcePaths = new List<string>();
            List<string> TargetPaths = new List<string>();
            foreach(string NodeToStrip in NodesToStrip)
            {
                GUBP.GUBPNode Node = bp.FindNode(NodeToStrip);
                foreach(string DependencyBuildProduct in Node.BuildProducts)
                {
                    string RelativePath = CommandUtils.StripBaseDirectory(Path.GetFullPath(DependencyBuildProduct), InputDir);
                    if(StripFilter.Matches(RelativePath))
                    {
                        SourcePaths.Add(CommandUtils.CombinePaths(InputDir, RelativePath));
                        TargetPaths.Add(CommandUtils.CombinePaths(StrippedDir, RelativePath));
                    }
                }
            }

            // Strip the files and add them to the build products
            StripSymbols(TargetPlatform, SourcePaths.ToArray(), TargetPaths.ToArray());
            BuildProducts.AddRange(TargetPaths);

            SaveRecordOfSuccessAndAddToBuildProducts();
        }
Esempio n. 6
0
        public StripRocketMonolithicsNode(GUBP bp, UnrealTargetPlatform InHostPlatform, UnrealTargetPlatform InTargetPlatform, string InStrippedDir)
            : base(InHostPlatform, InTargetPlatform, InStrippedDir)
        {
            Project = bp.Branch.BaseEngineProject;
            bIsCodeTargetPlatform = RocketBuild.IsCodeTargetPlatform(InHostPlatform, InTargetPlatform);

            GUBP.GUBPNode Node = bp.FindNode(GUBP.GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, Project, InTargetPlatform, Precompiled: bIsCodeTargetPlatform));
            if(String.IsNullOrEmpty(Node.AgentSharingGroup))
            {
                Node.AgentSharingGroup = bp.Branch.BaseEngineProject.GameName + "_MonolithicsGroup_" + InTargetPlatform + StaticGetHostPlatformSuffix(InHostPlatform);
            }
            AddNodeToStrip(Node.GetFullName());

            AgentSharingGroup = Node.AgentSharingGroup;
        }
Esempio n. 7
0
 public CleanSharedTempStorageNode(GUBP bp)
 {
     var ToolsNode = bp.FindNode(ToolsForCompileNode.StaticGetFullName(UnrealTargetPlatform.Win64));
     AgentSharingGroup = ToolsNode.AgentSharingGroup;
 }
		public SignRocketMonolithicsNode(GUBP.GUBPBranchConfig InBranchConfig, UnrealTargetPlatform InHostPlatform, UnrealTargetPlatform InTargetPlatform, string InSignedDir)
			: base(InBranchConfig, InHostPlatform, InTargetPlatform, InSignedDir)
		{
			Project = InBranchConfig.Branch.BaseEngineProject;
			bIsCodeTargetPlatform = RocketBuild.IsCodeTargetPlatform(InHostPlatform, InTargetPlatform);

			GUBP.GUBPNode Node = InBranchConfig.FindNode(GUBP.GamePlatformMonolithicsNode.StaticGetFullName(HostPlatform, Project, InTargetPlatform, Precompiled: bIsCodeTargetPlatform));
			if (String.IsNullOrEmpty(Node.AgentSharingGroup))
			{
				Node.AgentSharingGroup = BranchConfig.Branch.BaseEngineProject.GameName + "_MonolithicsGroup_" + InTargetPlatform + StaticGetHostPlatformSuffix(InHostPlatform);
			}
			AddNodeToSign(Node.GetFullName());
			string StripNode = StripRocketMonolithicsNode.StaticGetFullName(HostPlatform, BranchConfig.Branch.BaseEngineProject, TargetPlatform, RocketBuild.IsCodeTargetPlatform(HostPlatform, TargetPlatform));
			AddDependency(StripNode);

			AgentSharingGroup = Node.AgentSharingGroup;
		}