Example #1
0
        public string getKnownObjectHash(BuildObject obj)
        {
            string hash;
            bool   present = knownObjectHash.TryGetValue(obj, out hash);

            if (!present)
            {
                NuObjValue value = nuObjectContents.getValue(obj);
                if (value != null)
                {
                    if (value.disp is Failed)
                    {
                        return(null);
                    }
                    else if (obj is VirtualBuildObject)
                    {
                        hash = "virtual";
                    }
                    else
                    {
                        hash = hasher.hash(obj.getFilesystemPath());
                    }
                    knownObjectHash[obj] = hash;
                }
            }
            return(hash);
        }
Example #2
0
        void blessInternal(BuildObject obj, string hashIfKnown, Disposition disp, VirtualContents contents)
        {
            Util.Assert(!theCache.ContainsKey(obj));    //- I don't think we should ever write the same file twice in one run.
            string hash = hashIfKnown;

            if (hash == null && disp is Fresh && !(obj is VirtualBuildObject))
            {
                hash = _hasher.hash(obj.getFilesystemPath());
            }
            theCache[obj] = new NuObjValue(hash, disp, contents);
        }