예제 #1
0
        internal CommandResultEntry FindMatchingResult(IPrepareContext prepareContext, CommandResultEntry[] commandResultCollection)
        {
            if (commandResultCollection == null)
            {
                return(null);
            }

            // Then check input dependencies and output versions
            //builderContext.AssetIndexMap.LoadNewValues();

            foreach (CommandResultEntry entry in commandResultCollection)
            {
                bool entryMatch = true;

                foreach (var inputDepVersion in entry.InputDependencyVersions)
                {
                    var hash = prepareContext.ComputeInputHash(inputDepVersion.Key.Type, inputDepVersion.Key.Path);
                    if (hash != inputDepVersion.Value)
                    {
                        entryMatch = false;
                        break;
                    }
                }

                if (!entryMatch)
                {
                    continue;
                }

                if (entry.OutputObjects.Any(outputObject => !VirtualFileSystem.FileExists(FileOdbBackend.BuildUrl(VirtualFileSystem.ApplicationDatabasePath, outputObject.Value))))
                {
                    entryMatch = false;
                }

                if (!entryMatch)
                {
                    continue;
                }

                // TODO/Benlitz: check matching spawned commands if needed

                return(entry);
            }

            return(null);
        }
예제 #2
0
        protected void ComputeInputFilesHash(BinarySerializationWriter writer, IPrepareContext prepareContext)
        {
            var inputFiles = GetInputFiles();

            if (inputFiles == null)
            {
                return;
            }

            foreach (var inputFile in inputFiles)
            {
                var hash = prepareContext.ComputeInputHash(inputFile.Type, inputFile.Path);
                if (hash == ObjectId.Empty)
                {
                    writer.NativeStream.WriteByte(0);
                }
                else
                {
                    writer.NativeStream.Write((byte[])hash, 0, ObjectId.HashSize);
                }
            }
        }
예제 #3
0
        protected void ComputeInputFilesHash(BinarySerializationWriter writer, IPrepareContext prepareContext)
        {
            var inputFiles = GetInputFiles();
            if (inputFiles == null)
                return;

            foreach (var inputFile in inputFiles)
            {
                var hash = prepareContext.ComputeInputHash(inputFile.Type, inputFile.Path);
                if (hash == ObjectId.Empty)
                {
                    writer.NativeStream.WriteByte(0);
                }
                else
                {
                    writer.NativeStream.Write((byte[])hash, 0, ObjectId.HashSize);
                }
            }
        }
예제 #4
0
        internal CommandResultEntry FindMatchingResult(IPrepareContext prepareContext, CommandResultEntry[] commandResultCollection)
        {
            if (commandResultCollection == null)
                return null;

            // Then check input dependencies and output versions
            //builderContext.AssetIndexMap.LoadNewValues();

            foreach (CommandResultEntry entry in commandResultCollection)
            {
                bool entryMatch = true;

                foreach (var inputDepVersion in entry.InputDependencyVersions)
                {
                    var hash = prepareContext.ComputeInputHash(inputDepVersion.Key.Type, inputDepVersion.Key.Path);
                    if (hash != inputDepVersion.Value)
                    {
                        entryMatch = false;
                        break;
                    }
                }

                if (!entryMatch)
                    continue;

                if (entry.OutputObjects.Any(outputObject => !VirtualFileSystem.FileExists(FileOdbBackend.BuildUrl(VirtualFileSystem.ApplicationDatabasePath, outputObject.Value))))
                {
                    entryMatch = false;
                }

                if (!entryMatch)
                    continue;

                // TODO/Benlitz: check matching spawned commands if needed

                return entry;
            }

            return null;
        }