예제 #1
0
        /// <summary>
        /// Gets the latest write time of any of the UnrealHeaderTool binaries (including DLLs and Plugins) or DateTime.MaxValue if UnrealHeaderTool does not exist
        /// </summary>
        /// <returns>
        /// Latest timestamp of UHT binaries or DateTime.MaxValue if UnrealHeaderTool is out of date and needs to be rebuilt.
        /// </returns>
        static bool GetHeaderToolTimestamp(out DateTime Timestamp)
        {
            using (var TimestampTimer = new ScopedTimer("GetHeaderToolTimestamp"))
            {
                // Try to read the receipt for UHT.
                string ReceiptPath = BuildReceipt.GetDefaultPath(BuildConfiguration.RelativeEnginePath, "UnrealHeaderTool", BuildHostPlatform.Current.Platform, UnrealTargetConfiguration.Development, null);
                if (!File.Exists(ReceiptPath))
                {
                    Timestamp = DateTime.MaxValue;
                    return(false);
                }

                BuildReceipt Receipt;
                try
                {
                    Receipt = BuildReceipt.Read(ReceiptPath);
                }
                catch (Exception)
                {
                    Timestamp = DateTime.MaxValue;
                    return(false);
                }
                Receipt.ExpandPathVariables(BuildConfiguration.RelativeEnginePath, BuildConfiguration.RelativeEnginePath);

                // Check all the binaries exist, and that all the DLLs are built against the right version
                if (!CheckBinariesExist(Receipt) || !CheckDynamicLibaryVersionsMatch(Receipt))
                {
                    Timestamp = DateTime.MaxValue;
                    return(false);
                }

                // Return the timestamp for all the binaries
                Timestamp = GetTimestampFromBinaries(Receipt);
                return(true);
            }
        }