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

	    return false;
	}
Esempio n. 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;
        }
Esempio n. 3
0
	// Loading

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

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

                return(proj.ss.PathToStateItem(SourceSettings.BasisToFileToken(basis) +
                                               StateSuffix));
            }
Esempio n. 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);
        }
Esempio n. 6
0
	public WrenchProject (SourceSettings ss, IGraphState graph, 
			      ActionLog log) 
	{
	    this.ss = ss;
	    this.log = log;
	    this.graph = graph;
	    this.manager = WrenchOperations.MakeManager (this);
	}
Esempio n. 7
0
 public WrenchProject(SourceSettings ss, IGraphState graph,
                      ActionLog log)
 {
     this.ss      = ss;
     this.log     = log;
     this.graph   = graph;
     this.manager = WrenchOperations.MakeManager(this);
 }
Esempio n. 8
0
        // Loading

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

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

            return(false);
        }
Esempio n. 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);
        }
Esempio n. 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);
        }
Esempio n. 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;
	}
Esempio n. 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;
	}
Esempio n. 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;
	}
Esempio n. 15
0
	public bool Save (SourceSettings ss)
	{
	    return SafeFileSerializer.Save (ss.PathToStateItem (LogName), this, uilog);
	}
Esempio n. 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;
	}
Esempio n. 17
0
 public bool Save(SourceSettings ss)
 {
     return(SafeFileSerializer.Save(ss.PathToStateItem(LogName), this, uilog));
 }