示例#1
0
            TempStorageFileInfo LoadFile(XmlNode FileNode)
            {
                TempStorageFileInfo Info = new TempStorageFileInfo();

                long   Timestamp;
                string TimestampAttribute;

                if (TryGetAttribute(FileNode, TimestampAttributeName, out TimestampAttribute) == false)
                {
                    throw new AutomationException("Unable to get timestamp attribute.");
                }
                if (Int64.TryParse(TimestampAttribute, out Timestamp) == false)
                {
                    throw new AutomationException("Unable to parse timestamp attribute ({0}).", TimestampAttribute);
                }
                Info.Timestamp = new DateTime(Timestamp);

                string SizeAttribute;

                if (TryGetAttribute(FileNode, SizeAttributeName, out SizeAttribute) == false)
                {
                    throw new AutomationException("Unable to get size attribute.");
                }
                if (Int64.TryParse(SizeAttribute, out Info.Size) == false)
                {
                    throw new AutomationException("Unable to parse size attribute ({0}).", SizeAttribute);
                }

                Info.Name = FileNode.InnerText;

                return(Info);
            }
示例#2
0
            void LoadDirectory(XmlNode DirectoryNode)
            {
                string DirectoryName;

                if (TryGetAttribute(DirectoryNode, NameAttributeName, out DirectoryName) == false)
                {
                    throw new AutomationException("Unable to get directory name attribute.");
                }

                List <TempStorageFileInfo> Files = new List <TempStorageFileInfo>();

                for (XmlNode ChildNode = DirectoryNode.FirstChild; ChildNode != null; ChildNode = ChildNode.NextSibling)
                {
                    if (ChildNode.Name == FileElementName)
                    {
                        TempStorageFileInfo Info = LoadFile(ChildNode);
                        if (Info != null)
                        {
                            Files.Add(Info);
                        }
                        else
                        {
                            throw new AutomationException("Error reading file entry in the manifest file ({0})", ChildNode.InnerXml);
                        }
                    }
                    else
                    {
                        throw new AutomationException("Unexpected node {0} while reading file nodes.", ChildNode.Name);
                    }
                }
                Directories.Add(DirectoryName, Files);
            }
示例#3
0
            public bool Compare(TempStorageFileInfo Other)
            {
                bool bOk = true;
                if (!Name.Equals(Other.Name, StringComparison.InvariantCultureIgnoreCase))
                {
                    CommandUtils.Log(System.Diagnostics.TraceEventType.Error, "File name mismatch {0} {1}", Name, Other.Name);
                    bOk = false;
                }
                else
                {
                    // this is a bit of a hack, but UAT itself creates these, so we need to allow them to be 
                    bool bOkToBeDifferent = Name.Contains("Engine/Binaries/DotNET/");
                    // this is a problem with mac compiles
                    bOkToBeDifferent = bOkToBeDifferent || Name.EndsWith("MacOS/libogg.dylib");
                    bOkToBeDifferent = bOkToBeDifferent || Name.EndsWith("MacOS/libvorbis.dylib");
                    bOkToBeDifferent = bOkToBeDifferent || Name.EndsWith("Contents/MacOS/UE4Editor");

                    //temp hack until the mac build products work correctly
                    bOkToBeDifferent = bOkToBeDifferent || Name.Contains("Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/");


                    // DotNETUtilities.dll is built by a tons of other things
                    bool bSilentOkToBeDifferent = (Name == "Engine/Binaries/DotNET/DotNETUtilities.dll");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/DotNETUtilities.pdb");
                    // RPCUtility is build by IPP and maybe other things
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/RPCUtility.exe");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/RPCUtility.pdb");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/AutomationTool.exe");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/AutomationTool.exe.config");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/AutomationUtils.Automation.dll");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/AutomationUtils.Automation.pdb");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/UnrealBuildTool.exe");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/UnrealBuildTool.exe.config");					
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/EnvVarsToXML.exe");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/EnvVarsToXML.exe.config");					

                    // Lets just allow all mac warnings to be silent
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || Name.Contains("Engine/Binaries/Mac");

                    System.Diagnostics.TraceEventType LogType = bOkToBeDifferent ? System.Diagnostics.TraceEventType.Warning : System.Diagnostics.TraceEventType.Error;
                    if (bSilentOkToBeDifferent)
                    {
                        LogType = System.Diagnostics.TraceEventType.Information;
                    }

                    // on FAT filesystems writetime has a two seconds resolution
                    // cf. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724290%28v=vs.85%29.aspx
                    if (!((Timestamp - Other.Timestamp).TotalSeconds < 2 && (Timestamp - Other.Timestamp).TotalSeconds > -2))
                    {
                        CommandUtils.Log(LogType, "File date mismatch {0} {1} {2} {3}", Name, Timestamp.ToString(), Other.Name, Other.Timestamp.ToString());
                        bOk = bOkToBeDifferent || bSilentOkToBeDifferent;
                    }
                    if (!(Size == Other.Size))
                    {
                        CommandUtils.Log(LogType, "File size mismatch {0} {1} {2} {3}", Name, Size, Other.Name, Other.Size);
                        bOk = bOkToBeDifferent;
                    }
                }
                return bOk;
            }
示例#4
0
            public bool Compare(TempStorageFileInfo Other)
            {
                bool bOk = true;

                if (!Name.Equals(Other.Name, StringComparison.InvariantCultureIgnoreCase))
                {
                    Log(System.Diagnostics.TraceEventType.Error, "File name mismatch {0} {1}", Name, Other.Name);
                    bOk = false;
                }
                else
                {
                    // this is a bit of a hack, but UAT itself creates these, so we need to allow them to be
                    bool bOkToBeDifferent = Name.Contains("Engine/Binaries/DotNET/");
                    // this is a problem with mac compiles
                    bOkToBeDifferent = bOkToBeDifferent || Name.EndsWith("MacOS/libogg.dylib");
                    bOkToBeDifferent = bOkToBeDifferent || Name.EndsWith("MacOS/libvorbis.dylib");
                    bOkToBeDifferent = bOkToBeDifferent || Name.EndsWith("Contents/MacOS/UE4Editor");

                    //temp hack until the mac build products work correctly
                    bOkToBeDifferent = bOkToBeDifferent || Name.Contains("Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/");


                    // DotNETUtilities.dll is built by a tons of other things
                    bool bSilentOkToBeDifferent = (Name == "Engine/Binaries/DotNET/DotNETUtilities.dll");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/DotNETUtilities.pdb");
                    // RPCUtility is build by IPP and maybe other things
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/RPCUtility.exe");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/RPCUtility.pdb");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/AutomationTool.exe");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/UnrealBuildTool.exe");
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || (Name == "Engine/Binaries/DotNET/UnrealBuildTool.exe.config");

                    // Lets just allow all mac warnings to be slient
                    bSilentOkToBeDifferent = bSilentOkToBeDifferent || Name.Contains("Engine/Binaries/Mac");

                    System.Diagnostics.TraceEventType LogType = bOkToBeDifferent ? System.Diagnostics.TraceEventType.Warning : System.Diagnostics.TraceEventType.Error;
                    if (bSilentOkToBeDifferent)
                    {
                        LogType = System.Diagnostics.TraceEventType.Information;
                    }

                    // on FAT filesystems writetime has a two seconds resolution
                    // cf. http://msdn.microsoft.com/en-us/library/windows/desktop/ms724290%28v=vs.85%29.aspx
                    if (!((Timestamp - Other.Timestamp).TotalSeconds < 2 && (Timestamp - Other.Timestamp).TotalSeconds > -2))
                    {
                        CommandUtils.Log(LogType, "File date mismatch {0} {1} {2} {3}", Name, Timestamp.ToString(), Other.Name, Other.Timestamp.ToString());
                        bOk = bOkToBeDifferent || bSilentOkToBeDifferent;
                    }
                    if (!(Size == Other.Size))
                    {
                        CommandUtils.Log(LogType, "File size mismatch {0} {1} {2} {3}", Name, Size, Other.Name, Other.Size);
                        bOk = bOkToBeDifferent;
                    }
                }
                return(bOk);
            }
示例#5
0
            TempStorageFileInfo LoadFile(XmlNode FileNode)
            {
                TempStorageFileInfo Info = new TempStorageFileInfo();

                long Timestamp;
                string TimestampAttribute;
                if (TryGetAttribute(FileNode, TimestampAttributeName, out TimestampAttribute) == false)
                {
                   throw new AutomationException("Unable to get timestamp attribute.");
                }
                if (Int64.TryParse(TimestampAttribute, out Timestamp) == false)
                {
                    throw new AutomationException("Unable to parse timestamp attribute ({0}).", TimestampAttribute);
                }
                Info.Timestamp = new DateTime(Timestamp);

                string SizeAttribute;
                if (TryGetAttribute(FileNode, SizeAttributeName, out SizeAttribute) == false)
                {
                    throw new AutomationException("Unable to get size attribute.");
                }
                if (Int64.TryParse(SizeAttribute, out Info.Size) == false)
                {
                    throw new AutomationException("Unable to parse size attribute ({0}).", SizeAttribute);
                }

                Info.Name = FileNode.InnerText;

                return Info;
            }
示例#6
0
            public bool Compare(TempStorageManifest Other)
            {
                if (Directories.Count != Other.Directories.Count)
                {
                    Log(System.Diagnostics.TraceEventType.Error, "Directory count mismatch {0} {1}", Directories.Count, Other.Directories.Count);
                    foreach (KeyValuePair <string, List <TempStorageFileInfo> > Directory in Directories)
                    {
                        List <TempStorageFileInfo> OtherDirectory;
                        if (Other.Directories.TryGetValue(Directory.Key, out OtherDirectory) == false)
                        {
                            Log(System.Diagnostics.TraceEventType.Error, "Missing Directory {0}", Directory.Key);
                            return(false);
                        }
                    }
                    foreach (KeyValuePair <string, List <TempStorageFileInfo> > Directory in Other.Directories)
                    {
                        List <TempStorageFileInfo> OtherDirectory;
                        if (Directories.TryGetValue(Directory.Key, out OtherDirectory) == false)
                        {
                            Log(System.Diagnostics.TraceEventType.Error, "Missing Other Directory {0}", Directory.Key);
                            return(false);
                        }
                    }
                    return(false);
                }

                foreach (KeyValuePair <string, List <TempStorageFileInfo> > Directory in Directories)
                {
                    List <TempStorageFileInfo> OtherDirectory;
                    if (Other.Directories.TryGetValue(Directory.Key, out OtherDirectory) == false)
                    {
                        Log(System.Diagnostics.TraceEventType.Error, "Missing Directory {0}", Directory.Key);
                        return(false);
                    }
                    if (OtherDirectory.Count != Directory.Value.Count)
                    {
                        Log(System.Diagnostics.TraceEventType.Error, "File count mismatch {0} {1} {2}", Directory.Key, OtherDirectory.Count, Directory.Value.Count);
                        for (int FileIndex = 0; FileIndex < Directory.Value.Count; ++FileIndex)
                        {
                            Log("Manifest1: {0}", Directory.Value[FileIndex].Name);
                        }
                        for (int FileIndex = 0; FileIndex < OtherDirectory.Count; ++FileIndex)
                        {
                            Log("Manifest2: {0}", OtherDirectory[FileIndex].Name);
                        }
                        return(false);
                    }
                    bool bResult = true;
                    for (int FileIndex = 0; FileIndex < Directory.Value.Count; ++FileIndex)
                    {
                        TempStorageFileInfo File      = Directory.Value[FileIndex];
                        TempStorageFileInfo OtherFile = OtherDirectory[FileIndex];
                        if (File.Compare(OtherFile) == false)
                        {
                            bResult = false;
                        }
                    }
                    return(bResult);
                }

                return(true);
            }
示例#7
0
            public bool Compare(TempStorageFileInfo Other)
            {
                bool bOk = true;
                if (!Name.Equals(Other.Name, StringComparison.InvariantCultureIgnoreCase))
                {
                    Log(System.Diagnostics.TraceEventType.Error, "File name mismatch {0} {1}", Name, Other.Name);
                    bOk = false;
                }
                else
                {
                    // this is a bit of a hack, but UAT itself creates these, so we need to allow them to be
                    bool bOkToBeDifferent = Name.Contains(@"Engine\Binaries\DotNET\");

                    if (!((Timestamp - Other.Timestamp).TotalSeconds < 1 && (Timestamp - Other.Timestamp).TotalSeconds > -1))
                    {
                        CommandUtils.Log(bOkToBeDifferent ? System.Diagnostics.TraceEventType.Information : System.Diagnostics.TraceEventType.Error, "File date mismatch {0} {1} {2} {3}", Name, Timestamp.ToString(), Other.Name, Other.Timestamp.ToString());
                        bOk = bOkToBeDifferent;
                    }
                    if (!(Size == Other.Size))
                    {
                        CommandUtils.Log(bOkToBeDifferent ? System.Diagnostics.TraceEventType.Information : System.Diagnostics.TraceEventType.Error, "File size mismatch {0} {1} {2} {3}", Name, Size, Other.Name, Other.Size);
                        bOk = bOkToBeDifferent;
                    }
                }
                return bOk;
            }