/// <nodoc />
        public SnapshotBasedSpecProvider(IWorkspaceBindingSnapshot snapshot)
        {
            Contract.Requires(snapshot != null, "snapshot != null");

            m_snapshot = snapshot;

            // Need to materialize all the file names.
            snapshot.MaterializeDependencies();
        }
Example #2
0
        /// <summary>
        /// Serializes the front end snapshot to the given writer.
        /// </summary>
        public static void SerializeWorkspaceBindingSnapshot([NotNull] IWorkspaceBindingSnapshot snapshot, [NotNull] BuildXLWriter writer, PathTable pathTable)
        {
            // File format:
            // 1. # specs
            // 2. spec info for each spec in the workspace
            //   * spec path
            //   * bit vector of spec dependencies
            //   * bit vector of spec dependents
            //   * binding fingerprint
            snapshot.MaterializeDependencies();

            // 1. # specs
            writer.WriteCompact(snapshot.SourcesCount);

            // 2. spec info
            foreach (var source in snapshot.Sources)
            {
                // There is no perf issues right now, but we can consider to compute all the fingerprints in parallel.
                SerializeSpecBindingState(source, writer, pathTable);
            }
        }