Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
 public IEnumerable <DependentItemInfo> GetDependentBundles()
 {
     n_GetDependentBundles++;
     return(inner.GetDependentBundles());
 }
Exemplo n.º 3
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;
	}