Example #1
0
	public bool CreateToplevel (string topsrc, string bfname, IWarningLogger uilog) 
	{
	    if ((ss = SourceSettings.CreateToplevel (topsrc, bfname, uilog)) == null)
		return true;

	    return false;
	}
Example #2
0
        public void Dispose()
        {
            if (disposed)
            {
                return;
            }

            if (proj != null)
            {
                proj.Dispose();
                proj = null;
            }

            if (log != null)
            {
                log.Save(ss);
                log = null;
            }

            if (ProfileStateUsage)
            {
                Console.Error.WriteLine("GRAPH STATE USAGE PROFILE:");
                Console.Error.WriteLine("{0}", graph);
            }

            graph = null;
            ss    = null;
            bm    = null;

            disposed = true;
        }
Example #3
0
	// Loading

	public bool LoadSource (IWarningLogger uilog) 
	{
	    if ((ss = SourceSettings.Load (uilog)) == null)
		return true;

	    return false;
	}
Example #4
0
            string GetStatePath(WrenchProject proj)
            {
                string basis = proj.Graph.GetProviderBasis(id);

                return(proj.ss.PathToStateItem(SourceSettings.BasisToFileToken(basis) +
                                               StateSuffix));
            }
Example #5
0
        public static ActionLog Load(SourceSettings ss, IWarningLogger uilog)
        {
            ActionLog ld = null;

            if (uilog == null)
            {
                throw new ArgumentNullException();
            }

            string path = ss.PathToStateItem(LogName);

            if (File.Exists(path))
            {
                ld = (ActionLog)SafeFileSerializer.Load(path, uilog);
            }

            if (ld == null)
            {
                // Didn't exist or failed to recover
                ld = new ActionLog();
            }

            ld.uilog = uilog;
            return(ld);
        }
Example #6
0
	public WrenchProject (SourceSettings ss, IGraphState graph, 
			      ActionLog log) 
	{
	    this.ss = ss;
	    this.log = log;
	    this.graph = graph;
	    this.manager = WrenchOperations.MakeManager (this);
	}
Example #7
0
 public WrenchProject(SourceSettings ss, IGraphState graph,
                      ActionLog log)
 {
     this.ss      = ss;
     this.log     = log;
     this.graph   = graph;
     this.manager = WrenchOperations.MakeManager(this);
 }
Example #8
0
        // Loading

        public bool LoadSource(IWarningLogger uilog)
        {
            if ((ss = SourceSettings.Load(uilog)) == null)
            {
                return(true);
            }

            return(false);
        }
Example #9
0
        public bool CreateToplevel(string topsrc, string bfname, IWarningLogger uilog)
        {
            if ((ss = SourceSettings.CreateToplevel(topsrc, bfname, uilog)) == null)
            {
                return(true);
            }

            return(false);
        }
Example #10
0
        public static SourceSettings Load(IWarningLogger log)
        {
            SourceSettings ss = new SourceSettings();

            try {
                XmlTextReader tr = new XmlTextReader(SourceFileName);

                while (!tr.EOF)
                {
                    if (tr.NodeType != XmlNodeType.Element)
                    {
                        tr.Read();
                        continue;
                    }

                    // Yeah this is awesome. Note that topsrc-from-topbuild
                    // must come before subpath-here otherwise nullref.

                    if (tr.Name == "topsrc-from-topbuild")
                    {
                        ss.topsrc_from_topbuild = tr.ReadElementString();
                    }
                    else if (tr.Name == "buildfile-name")
                    {
                        ss.buildfile_name = tr.ReadElementString();
                    }
                    else if (tr.Name == "subpath-here" && ss.topsrc_from_topbuild != null)
                    {
                        ss.SetCurrentSubpath(tr.ReadElementString());
                    }

                    tr.Read();
                }

                tr.Close();
            } catch (Exception e) {
                log.Error(1009, "Cannot load build breadcrumb file " +
                          SourceFileName, e.Message);
                return(null);
            }

            if (ss.topsrc_from_topbuild == null ||
                ss.buildfile_name == null ||
                ss.subpath == null)
            {
                log.Error(1009, "Malformed build breadcrumb file " + SourceFileName,
                          ss.ToString());
                return(null);
            }

            return(ss);
        }
Example #11
0
        public static SourceSettings CreateToplevel(string topsrc, string bfname,
                                                    IWarningLogger log)
        {
            if (File.Exists(SourceFileName))
            {
                log.Error(1009, "Build breadcrumb file " + SourceFileName + " should " +
                          "not exist here, but it does.", null);
                return(null);
            }

            SourceSettings ss = new SourceSettings();

            ss.topsrc_from_topbuild = topsrc;
            ss.buildfile_name       = bfname;
            ss.SetCurrentSubpath(".");

            if (ss.SaveForSubpath(".", log))
            {
                return(null);
            }

            return(ss);
        }
Example #12
0
	public void Dispose () {
	    if (disposed)
		return;
	    
	    if (proj != null) {
		proj.Dispose ();
		proj = null;
	    }

	    if (log != null) {
		log.Save (ss);
		log = null;
	    }

	    if (ProfileStateUsage) {
		Console.Error.WriteLine ("GRAPH STATE USAGE PROFILE:");
		Console.Error.WriteLine ("{0}", graph);
	    }

	    graph = null;
	    ss = null;
	    bm = null;

	    disposed = true;
	}
Example #13
0
	public static SourceSettings CreateToplevel (string topsrc, string bfname, 
						     IWarningLogger log) 
	{
	    if (File.Exists (SourceFileName)) {
		log.Error (1009, "Build breadcrumb file " + SourceFileName + " should " +
			   "not exist here, but it does.", null);
		return null;
	    }

	    SourceSettings ss = new SourceSettings ();
	    ss.topsrc_from_topbuild = topsrc;
	    ss.buildfile_name = bfname;
	    ss.SetCurrentSubpath (".");

	    if (ss.SaveForSubpath (".", log))
		return null;

	    return ss;
	}
Example #14
0
	public static SourceSettings Load (IWarningLogger log) 
	{
	    SourceSettings ss = new SourceSettings ();

	    try {
		XmlTextReader tr = new XmlTextReader (SourceFileName);

		while (!tr.EOF) {
		    if (tr.NodeType != XmlNodeType.Element) {
			tr.Read ();
			continue;
		    }

		    // Yeah this is awesome. Note that topsrc-from-topbuild
		    // must come before subpath-here otherwise nullref.

		    if (tr.Name == "topsrc-from-topbuild")
			ss.topsrc_from_topbuild = tr.ReadElementString ();
		    else if (tr.Name == "buildfile-name")
			ss.buildfile_name = tr.ReadElementString ();
		    else if (tr.Name == "subpath-here" && ss.topsrc_from_topbuild != null)
			ss.SetCurrentSubpath (tr.ReadElementString ());

		    tr.Read ();
		}

		tr.Close ();
	    } catch (Exception e) {
		log.Error (1009, "Cannot load build breadcrumb file " + 
			   SourceFileName, e.Message);
		return null;
	    }

	    if (ss.topsrc_from_topbuild == null ||
		ss.buildfile_name == null ||
		ss.subpath == null) {
		log.Error (1009, "Malformed build breadcrumb file " + SourceFileName, 
			   ss.ToString ());
		return null;
	    }

	    return ss;
	}
Example #15
0
	public bool Save (SourceSettings ss)
	{
	    return SafeFileSerializer.Save (ss.PathToStateItem (LogName), this, uilog);
	}
Example #16
0
	public static ActionLog Load (SourceSettings ss, IWarningLogger uilog)
	{
	    ActionLog ld = null;

	    if (uilog == null)
		throw new ArgumentNullException ();

	    string path = ss.PathToStateItem (LogName);

	    if (File.Exists (path))
		ld = (ActionLog) SafeFileSerializer.Load (path, uilog);

	    if (ld == null)
		// Didn't exist or failed to recover
		ld = new ActionLog ();

	    ld.uilog = uilog;
	    return ld;
	}
Example #17
0
 public bool Save(SourceSettings ss)
 {
     return(SafeFileSerializer.Save(ss.PathToStateItem(LogName), this, uilog));
 }