Esempio n. 1
0
        public static PackageDownloadDescriptor Create(
            string friendlyName,
            List <StringKeyedHash> contents,
            string traceInfo)
        {
            var descriptor = new PackageDownloadDescriptor
            {
                Id           = PipFingerprintEntry.CreateUniqueId(),
                FriendlyName = friendlyName,
                Contents     = contents,
                TraceInfo    = traceInfo,
            };

            return(descriptor);
        }
Esempio n. 2
0
        public static FileDownloadDescriptor Create(
            BondContentHash content,
            string url,
            string traceInfo)
        {
            var descriptor = new FileDownloadDescriptor
            {
                Id        = PipFingerprintEntry.CreateUniqueId(),
                Content   = content,
                Url       = url,
                TraceInfo = traceInfo,
            };

            return(descriptor);
        }
Esempio n. 3
0
 public PipFingerprintEntry ToEntry()
 {
     return(PipFingerprintEntry.CreateFromData(this));
 }
Esempio n. 4
0
        /// <nodoc />
        public static PipGraphCacheDescriptor CreateFromFiles(
            IDictionary <GraphCacheFile, BondContentHash> files,
            string traceInfo)
        {
            var descriptor = new PipGraphCacheDescriptor
            {
                Id        = PipFingerprintEntry.CreateUniqueId(),
                TraceInfo = traceInfo,
            };

            foreach (var kvp in files)
            {
                switch (kvp.Key)
                {
                case GraphCacheFile.PreviousInputs:
                    descriptor.PreviousInputs = kvp.Value;
                    break;

                case GraphCacheFile.PipTable:
                    descriptor.PipTable = kvp.Value;
                    break;

                case GraphCacheFile.PathTable:
                    descriptor.PathTable = kvp.Value;
                    break;

                case GraphCacheFile.StringTable:
                    descriptor.StringTable = kvp.Value;
                    break;

                case GraphCacheFile.SymbolTable:
                    descriptor.SymbolTable = kvp.Value;
                    break;

                case GraphCacheFile.QualifierTable:
                    descriptor.QualifierTable = kvp.Value;
                    break;

                case GraphCacheFile.MountPathExpander:
                    descriptor.MountPathExpander = kvp.Value;
                    break;

                case GraphCacheFile.ConfigState:
                    descriptor.ConfigState = kvp.Value;
                    break;

                case GraphCacheFile.DirectedGraph:
                    descriptor.DirectedGraph = kvp.Value;
                    break;

                case GraphCacheFile.PipGraph:
                    descriptor.PipGraph = kvp.Value;
                    break;

                case GraphCacheFile.PipGraphId:
                    descriptor.PipGraphId = kvp.Value;
                    break;

                case GraphCacheFile.HistoricTableSizes:
                    descriptor.HistoricTableSizes = kvp.Value;
                    break;

                default:
                    throw Contract.AssertFailure("Unhandled GraphCacheFile");
                }
            }

            return(descriptor);
        }