예제 #1
0
        void AddDependentBundles()
        {
            foreach (Assembly assy in bm.BundleAssemblies)
            {
                DependentItemInfo dii = new DependentItemInfo();
                dii.Name        = assy.GetName().Name;
                dii.Fingerprint = Fingerprint.FromFile(assy.Location);;

                dep_bundles.Add(dii);
            }
        }
예제 #2
0
        // returns the reason why we need to recompile or null if no need
        string GraphNeedsRebuild(IGraphState gs)
        {
            foreach (DependentItemInfo dii in gs.GetDependentFiles())
            {
                string f = ss.PathToSourceRelative(dii.Name);

                Fingerprint fp = Fingerprint.FromFile(f);

                if (fp != dii.Fingerprint)
                {
                    return(f);
                }
            }

            // This is a bit gross, but it's called once.
            // We've just loaded the bundles straight from the graph's
            // ProjectInfo, but the pinfo may not be in sync with the
            // DII list.

            Dictionary <string, Assembly> namemap = new Dictionary <string, Assembly> ();
            int num_pinfo = 0, num_dii = 0;

            foreach (Assembly assy in bm.BundleAssemblies)
            {
                namemap[assy.GetName().Name] = assy;
                num_pinfo++;
            }

            foreach (DependentItemInfo dii in gs.GetDependentBundles())
            {
                if (!namemap.ContainsKey(dii.Name))
                {
                    return(dii.Name);
                }

                Fingerprint fp = Fingerprint.FromFile(namemap[dii.Name].Location);

                if (fp != dii.Fingerprint)
                {
                    return(dii.Name);
                }

                num_dii++;
            }

            if (num_pinfo != num_dii)
            {
                return("[mismatch in number of referenced bundles]");
            }

            return(null);
        }
예제 #3
0
 public void AddDependentFile(string fname, string pathto)
 {
     AddDependentFile(fname, Fingerprint.FromFile(pathto));
 }