Beispiel #1
0
        /// <summary>
        /// Adds a build product to the receipt. Does not check whether it already exists.
        /// </summary>
        /// <param name="Path">Path to the build product.</param>
        /// <param name="Type">Type of build product.</param>
        /// <returns>The BuildProduct object that was created</returns>
        public BuildProduct AddBuildProduct(FileReference Path, BuildProductType Type)
        {
            BuildProduct NewBuildProduct = new BuildProduct(Path, Type);

            BuildProducts.Add(NewBuildProduct);
            return(NewBuildProduct);
        }
        /// <summary>
        /// Adds a build product to the receipt. Does not check whether it already exists.
        /// </summary>
        /// <param name="Path">Path to the build product.</param>
        /// <param name="Type">Type of build product.</param>
        /// <returns>The BuildProduct object that was created</returns>
        public BuildProduct AddBuildProduct(string Path, BuildProductType Type)
        {
            BuildProduct NewBuildProduct = new BuildProduct(Path, Type);

            BuildProducts.Add(NewBuildProduct);
            return(NewBuildProduct);
        }
Beispiel #3
0
        /// <summary>
        /// Adds a build product and its associated debug file to a receipt.
        /// </summary>
        /// <param name="OutputFile">Build product to add</param>
        /// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
        /// <param name="Receipt">Receipt to add to</param>
        static void AddBuildProductAndDebugFile(string OutputFile, BuildProductType OutputType, string DebugExtension, BuildReceipt Receipt)
        {
            Receipt.AddBuildProduct(OutputFile, OutputType);

            if (!String.IsNullOrEmpty(DebugExtension))
            {
                Receipt.AddBuildProduct(Path.ChangeExtension(OutputFile, DebugExtension), BuildProductType.SymbolFile);
            }
        }
Beispiel #4
0
        /// <summary>
        /// Adds a build product and its associated debug file to a receipt.
        /// </summary>
        /// <param name="OutputFile">Build product to add</param>
        /// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
        /// <param name="Receipt">Receipt to add to</param>
        static void AddBuildProductAndDebugFile(FileReference OutputFile, BuildProductType OutputType, string DebugExtension, Dictionary <FileReference, BuildProductType> BuildProducts, UEToolChain ToolChain)
        {
            BuildProducts.Add(OutputFile, OutputType);

            if (!String.IsNullOrEmpty(DebugExtension) && ToolChain.ShouldAddDebugFileToReceipt(OutputFile, OutputType))
            {
                BuildProducts.Add(OutputFile.ChangeExtension(DebugExtension), BuildProductType.SymbolFile);
            }
        }
Beispiel #5
0
        /// <summary>
        /// Adds a build product and its associated debug file to a receipt.
        /// </summary>
        /// <param name="OutputFile">Build product to add</param>
        /// <param name="OutputType">The type of built product</param>
        /// <param name="DebugExtensions">Extensions for the matching debug file (may be null).</param>
        /// <param name="BuildProducts">Map of build products to their type</param>
        /// <param name="ToolChain">The toolchain used to build these binaries</param>
        /// <param name="bCreateDebugInfo">Whether creating debug info is enabled</param>
        static void AddBuildProductAndDebugFiles(FileReference OutputFile, BuildProductType OutputType, string[] DebugExtensions, Dictionary <FileReference, BuildProductType> BuildProducts, UEToolChain ToolChain, bool bCreateDebugInfo)
        {
            BuildProducts.Add(OutputFile, OutputType);

            foreach (string DebugExtension in DebugExtensions)
            {
                if (!String.IsNullOrEmpty(DebugExtension) && ToolChain.ShouldAddDebugFileToReceipt(OutputFile, OutputType) && bCreateDebugInfo)
                {
                    BuildProducts.Add(OutputFile.ChangeExtension(DebugExtension), BuildProductType.SymbolFile);
                }
            }
        }
Beispiel #6
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="InParameters">Parameters to select which files to search</param>
        public TagReceiptTask(TagReceiptTaskParameters InParameters)
        {
            Parameters = InParameters;

            if (!String.IsNullOrEmpty(Parameters.BuildProductType))
            {
                BuildProductType = (BuildProductType)Enum.Parse(typeof(BuildProductType), Parameters.BuildProductType);
            }
            if (!String.IsNullOrEmpty(Parameters.StagedFileType))
            {
                StagedFileType = (StagedFileType)Enum.Parse(typeof(StagedFileType), Parameters.StagedFileType);
            }
        }
Beispiel #7
0
        /// <summary>
        /// Adds a build product and its associated debug file to a receipt.
        /// </summary>
        /// <param name="OutputFile">Build product to add</param>
        /// <param name="OutputType">The type of built product</param>
        /// <param name="DebugExtensions">Extensions for the matching debug file (may be null).</param>
        /// <param name="BuildProducts">Map of build products to their type</param>
        /// <param name="ToolChain">The toolchain used to build these binaries</param>
        /// <param name="bCreateDebugInfo">Whether creating debug info is enabled</param>
        static void AddBuildProductAndDebugFiles(FileReference OutputFile, BuildProductType OutputType, string[] DebugExtensions, Dictionary <FileReference, BuildProductType> BuildProducts, UEToolChain ToolChain, bool bCreateDebugInfo)
        {
            BuildProducts.Add(OutputFile, OutputType);

            foreach (string DebugExtension in DebugExtensions)
            {
                if (!String.IsNullOrEmpty(DebugExtension) && ToolChain.ShouldAddDebugFileToReceipt(OutputFile, OutputType) && bCreateDebugInfo)
                {
                    // @todo this could be cleaned up if we replaced Platform.GetDebugExtensions() with ToolChain.GetDebugFiles(OutputFile)
                    // would need care in MacToolchain tho, so too risky for now
                    BuildProducts.Add(ToolChain.GetDebugFile(OutputFile, DebugExtension), BuildProductType.SymbolFile);
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// Gets all build products produced by this binary
        /// </summary>
        /// <param name="Target">The target being built</param>
        /// <param name="ToolChain">The platform toolchain</param>
        /// <param name="BuildProducts">Mapping of produced build product to type</param>
        /// <param name="bCreateDebugInfo">Whether debug info is enabled for this binary</param>
        public void GetBuildProducts(ReadOnlyTargetRules Target, UEToolChain ToolChain, Dictionary <FileReference, BuildProductType> BuildProducts, bool bCreateDebugInfo)
        {
            // Get the type of build products we're creating
            BuildProductType Type = BuildProductType.RequiredResource;

            switch (Config.Type)
            {
            case UEBuildBinaryType.Executable:
                Type = BuildProductType.Executable;
                break;

            case UEBuildBinaryType.DynamicLinkLibrary:
                Type = BuildProductType.DynamicLibrary;
                break;

            case UEBuildBinaryType.StaticLibrary:
                Type = BuildProductType.StaticLibrary;
                break;
            }

            // Add the primary build products
            string DebugExtension = UEBuildPlatform.GetBuildPlatform(Target.Platform).GetDebugInfoExtension(Target, Config.Type);

            foreach (FileReference OutputFilePath in Config.OutputFilePaths)
            {
                AddBuildProductAndDebugFile(OutputFilePath, Type, DebugExtension, BuildProducts, ToolChain, bCreateDebugInfo);
            }

            // Add the console app, if there is one
            if (Config.Type == UEBuildBinaryType.Executable && Config.bBuildAdditionalConsoleApp)
            {
                foreach (FileReference OutputFilePath in Config.OutputFilePaths)
                {
                    AddBuildProductAndDebugFile(GetAdditionalConsoleAppPath(OutputFilePath), Type, DebugExtension, BuildProducts, ToolChain, bCreateDebugInfo);
                }
            }

            // Add any additional build products from the modules in this binary, including additional bundle resources/dylibs on Mac.
            List <string> Libraries = new List <string>();
            List <UEBuildBundleResource> BundleResources = new List <UEBuildBundleResource>();

            GatherAdditionalResources(Libraries, BundleResources);

            // Add any extra files from the toolchain
            ToolChain.ModifyBuildProducts(Target, this, Libraries, BundleResources, BuildProducts);
        }
Beispiel #9
0
        /// <summary>
        /// Creates a receipt for this binary.
        /// </summary>
        /// <param name="ToolChain">Toolchain for the target platform</param>
        /// <param name="BuildPlatform">Platform that we're building for</param>
        public virtual BuildReceipt MakeReceipt(IUEToolChain ToolChain)
        {
            BuildReceipt Receipt = new BuildReceipt();

            // Get the type of build products we're creating
            BuildProductType Type = BuildProductType.RequiredResource;

            switch (Config.Type)
            {
            case UEBuildBinaryType.Executable:
                Type = BuildProductType.Executable;
                break;

            case UEBuildBinaryType.DynamicLinkLibrary:
                Type = BuildProductType.DynamicLibrary;
                break;

            case UEBuildBinaryType.StaticLibrary:
                Type = BuildProductType.StaticLibrary;
                break;
            }

            // Add the primary build products
            string DebugExtension = UEBuildPlatform.GetBuildPlatform(Target.Platform).GetDebugInfoExtension(Config.Type);

            foreach (string OutputFilePath in Config.OutputFilePaths)
            {
                AddBuildProductAndDebugFile(OutputFilePath, Type, DebugExtension, Receipt);
            }

            // Add the console app, if there is one
            if (Config.Type == UEBuildBinaryType.Executable && Config.bBuildAdditionalConsoleApp)
            {
                foreach (string OutputFilePath in Config.OutputFilePaths)
                {
                    AddBuildProductAndDebugFile(GetAdditionalConsoleAppPath(OutputFilePath), Type, DebugExtension, Receipt);
                }
            }

            // Add any extra files from the toolchain
            ToolChain.AddFilesToReceipt(Receipt, this);
            return(Receipt);
        }
Beispiel #10
0
        /// <summary>
        /// Gets all build products produced by this binary
        /// </summary>
        /// <param name="ToolChain">The platform toolchain</param>
        /// <param name="BuildProducts">Mapping of produced build product to type</param>
        public virtual void GetBuildProducts(UEToolChain ToolChain, Dictionary <FileReference, BuildProductType> BuildProducts)
        {
            // Get the type of build products we're creating
            BuildProductType Type = BuildProductType.RequiredResource;

            switch (Config.Type)
            {
            case UEBuildBinaryType.Executable:
                Type = BuildProductType.Executable;
                break;

            case UEBuildBinaryType.DynamicLinkLibrary:
                Type = BuildProductType.DynamicLibrary;
                break;

            case UEBuildBinaryType.StaticLibrary:
                Type = BuildProductType.StaticLibrary;
                break;
            }

            // Add the primary build products
            string DebugExtension = UEBuildPlatform.GetBuildPlatform(Target.Platform).GetDebugInfoExtension(Config.Type);

            foreach (FileReference OutputFilePath in Config.OutputFilePaths)
            {
                AddBuildProductAndDebugFile(OutputFilePath, Type, DebugExtension, BuildProducts, ToolChain);
            }

            // Add the console app, if there is one
            if (Config.Type == UEBuildBinaryType.Executable && Config.bBuildAdditionalConsoleApp)
            {
                foreach (FileReference OutputFilePath in Config.OutputFilePaths)
                {
                    AddBuildProductAndDebugFile(GetAdditionalConsoleAppPath(OutputFilePath), Type, DebugExtension, BuildProducts, ToolChain);
                }
            }

            // Add any extra files from the toolchain
            ToolChain.ModifyBuildProducts(this, BuildProducts);
        }
Beispiel #11
0
 public BuildProduct(BuildProduct Other)
 {
     Path = Other.Path;
     Type = Other.Type;
     IsPrecompiled = Other.IsPrecompiled;
 }
Beispiel #12
0
 public BuildProduct(string InPath, BuildProductType InType)
 {
     Path = InPath;
     Type = InType;
 }
Beispiel #13
0
 public BuildProduct(SerializationInfo Info, StreamingContext Context)
 {
     Path          = Info.GetString("pa");
     Type          = (BuildProductType)Info.GetInt32("ty");
     IsPrecompiled = Info.GetBoolean("ip");
 }
Beispiel #14
0
 /// <summary>
 /// Adds a build product to the receipt. Does not check whether it already exists.
 /// </summary>
 /// <param name="Path">Path to the build product.</param>
 /// <param name="Type">Type of build product.</param>
 /// <returns>The BuildProduct object that was created</returns>
 public BuildProduct AddBuildProduct(string Path, BuildProductType Type)
 {
     BuildProduct NewBuildProduct = new BuildProduct(Path, Type);
     BuildProducts.Add(NewBuildProduct);
     return NewBuildProduct;
 }
		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="InParameters">Parameters to select which files to search</param>
		public TagReceiptTask(TagReceiptTaskParameters InParameters)
		{
			Parameters = InParameters;

			if (!String.IsNullOrEmpty(Parameters.BuildProductType))
			{
				BuildProductType = (BuildProductType)Enum.Parse(typeof(BuildProductType), Parameters.BuildProductType);
			}
			if (!String.IsNullOrEmpty(Parameters.StagedFileType))
			{
				StagedFileType = (StagedFileType)Enum.Parse(typeof(StagedFileType), Parameters.StagedFileType);
			}
		}
Beispiel #16
0
        /// <summary>
        /// Gets all build products produced by this binary
        /// </summary>
        /// <param name="Target">The target being built</param>
        /// <param name="ToolChain">The platform toolchain</param>
        /// <param name="BuildProducts">Mapping of produced build product to type</param>
        /// <param name="bCreateDebugInfo">Whether debug info is enabled for this binary</param>
        public void GetBuildProducts(ReadOnlyTargetRules Target, UEToolChain ToolChain, Dictionary <FileReference, BuildProductType> BuildProducts, bool bCreateDebugInfo)
        {
            // Add all the precompiled outputs
            foreach (UEBuildModuleCPP Module in Modules.OfType <UEBuildModuleCPP>())
            {
                if (Module.Rules.bPrecompile)
                {
                    if (Module.GeneratedCodeDirectory != null && DirectoryReference.Exists(Module.GeneratedCodeDirectory))
                    {
                        foreach (FileReference GeneratedCodeFile in DirectoryReference.EnumerateFiles(Module.GeneratedCodeDirectory))
                        {
                            // Exclude timestamp files, since they're always updated and cause collisions between builds
                            if (!GeneratedCodeFile.GetFileName().Equals("Timestamp", StringComparison.OrdinalIgnoreCase) && !GeneratedCodeFile.HasExtension(".cpp"))
                            {
                                BuildProducts.Add(GeneratedCodeFile, BuildProductType.BuildResource);
                            }
                        }
                    }
                    if (Target.LinkType == TargetLinkType.Monolithic)
                    {
                        FileReference PrecompiledManifestLocation = Module.PrecompiledManifestLocation;
                        BuildProducts.Add(PrecompiledManifestLocation, BuildProductType.BuildResource);

                        PrecompiledManifest ModuleManifest = PrecompiledManifest.Read(PrecompiledManifestLocation);
                        foreach (FileReference OutputFile in ModuleManifest.OutputFiles)
                        {
                            if (!BuildProducts.ContainsKey(OutputFile))
                            {
                                BuildProducts.Add(OutputFile, BuildProductType.BuildResource);
                            }
                        }
                    }
                }
            }

            // Add all the binary outputs
            if (!Target.bDisableLinking)
            {
                // Get the type of build products we're creating
                BuildProductType OutputType = BuildProductType.RequiredResource;
                switch (Type)
                {
                case UEBuildBinaryType.Executable:
                    OutputType = BuildProductType.Executable;
                    break;

                case UEBuildBinaryType.DynamicLinkLibrary:
                    OutputType = BuildProductType.DynamicLibrary;
                    break;

                case UEBuildBinaryType.StaticLibrary:
                    OutputType = BuildProductType.BuildResource;
                    break;
                }

                // Add the primary build products
                string[] DebugExtensions = UEBuildPlatform.GetBuildPlatform(Target.Platform).GetDebugInfoExtensions(Target, Type);
                foreach (FileReference OutputFilePath in OutputFilePaths)
                {
                    AddBuildProductAndDebugFiles(OutputFilePath, OutputType, DebugExtensions, BuildProducts, ToolChain, bCreateDebugInfo);
                }

                // Add the console app, if there is one
                if (Type == UEBuildBinaryType.Executable && bBuildAdditionalConsoleApp)
                {
                    foreach (FileReference OutputFilePath in OutputFilePaths)
                    {
                        AddBuildProductAndDebugFiles(GetAdditionalConsoleAppPath(OutputFilePath), OutputType, DebugExtensions, BuildProducts, ToolChain, bCreateDebugInfo);
                    }
                }

                // Add any additional build products from the modules in this binary, including additional bundle resources/dylibs on Mac.
                List <string> Libraries = new List <string>();
                List <UEBuildBundleResource> BundleResources = new List <UEBuildBundleResource>();
                GatherAdditionalResources(Libraries, BundleResources);

                // Add any extra files from the toolchain
                ToolChain.ModifyBuildProducts(Target, this, Libraries, BundleResources, BuildProducts);
            }
        }
Beispiel #17
0
        /// <summary>
        /// Adds a build product and its associated debug file to a receipt.
        /// </summary>
        /// <param name="OutputFile">Build product to add</param>
        /// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
        /// <param name="Receipt">Receipt to add to</param>
        static void AddBuildProductAndDebugFile(string OutputFile, BuildProductType OutputType, string DebugExtension, BuildReceipt Receipt)
        {
            Receipt.AddBuildProduct(OutputFile, OutputType);

            if(!String.IsNullOrEmpty(DebugExtension))
            {
                Receipt.AddBuildProduct(Path.ChangeExtension(OutputFile, DebugExtension), BuildProductType.SymbolFile);
            }
        }
Beispiel #18
0
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="Other">Build product to copy settings from</param>
 public BuildProduct(BuildProduct Other)
 {
     Path = Other.Path;
     Type = Other.Type;
 }
		/// <summary>
		/// Adds a build product and its associated debug file to a receipt.
		/// </summary>
		/// <param name="OutputFile">Build product to add</param>
		/// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
		/// <param name="Receipt">Receipt to add to</param>
		static void AddBuildProductAndDebugFile(FileReference OutputFile, BuildProductType OutputType, string DebugExtension, Dictionary<FileReference, BuildProductType> BuildProducts, UEToolChain ToolChain)
		{
			BuildProducts.Add(OutputFile, OutputType);

			if (!String.IsNullOrEmpty(DebugExtension) && ToolChain.ShouldAddDebugFileToReceipt(OutputFile, OutputType))
			{
				BuildProducts.Add(OutputFile.ChangeExtension(DebugExtension), BuildProductType.SymbolFile);
			}
		}
Beispiel #20
0
		/// <summary>
		/// Adds a build product and its associated debug file to a receipt.
		/// </summary>
		/// <param name="OutputFile">Build product to add</param>
		/// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
		public override bool ShouldAddDebugFileToReceipt(string OutputFile, BuildProductType OutputType)
		{
			return OutputType == BuildProductType.Executable;
		}
Beispiel #21
0
		/// <summary>
		/// Adds a build product and its associated debug file to a receipt.
		/// </summary>
		/// <param name="OutputFile">Build product to add</param>
		/// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
		/// <param name="Receipt">Receipt to add to</param>
		static void AddBuildProductAndDebugFile(string OutputFile, BuildProductType OutputType, string DebugExtension, TargetReceipt Receipt, IUEToolChain ToolChain)
		{
			Receipt.AddBuildProduct(OutputFile, OutputType);

			if(!String.IsNullOrEmpty(DebugExtension) && ToolChain.ShouldAddDebugFileToReceipt(OutputFile, OutputType))
			{
				Receipt.AddBuildProduct(Path.ChangeExtension(OutputFile, DebugExtension), BuildProductType.SymbolFile);
			}
		}
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="InPath">Path to the build product</param>
 /// <param name="InType">Type of the build product</param>
 public BuildProduct(string InPath, BuildProductType InType)
 {
     Path = InPath;
     Type = InType;
 }
Beispiel #23
0
 /// <summary>
 /// Adds a build product and its associated debug file to a receipt.
 /// </summary>
 /// <param name="OutputFile">Build product to add</param>
 /// <param name="OutputType">The type of build product</param>
 public virtual bool ShouldAddDebugFileToReceipt(FileReference OutputFile, BuildProductType OutputType)
 {
     return(true);
 }
		/// <summary>
		/// Adds a build product and its associated debug file to a receipt.
		/// </summary>
		/// <param name="OutputFile">Build product to add</param>
		/// <param name="DebugExtension">Extension for the matching debug file (may be null).</param>
		public virtual bool ShouldAddDebugFileToReceipt(FileReference OutputFile, BuildProductType OutputType)
		{
			return true;
		}
Beispiel #25
0
 public BuildProduct(SerializationInfo Info, StreamingContext Context)
 {
     Path          = Info.GetString("pa");
     Type          = (BuildProductType)Info.GetInt32("ty");
     IsPrecompiled = Info.GetBoolean("ip");
 }
Beispiel #26
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="InPath">Path to the build product</param>
 /// <param name="InType">Type of the build product</param>
 public BuildProduct(FileReference InPath, BuildProductType InType)
 {
     Path = InPath;
     Type = InType;
 }
 /// <summary>
 /// Copy constructor.
 /// </summary>
 /// <param name="Other">Build product to copy settings from</param>
 public BuildProduct(BuildProduct Other)
 {
     Path          = Other.Path;
     Type          = Other.Type;
     IsPrecompiled = Other.IsPrecompiled;
 }