store pointer to Backend in the Project class so properties of the
Backend object can eventually be queried from the generic rbuild code
Modified: trunk/reactos/tools/rbuild/project.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.h
  _____
Modified: trunk/reactos/tools/rbuild/project.cpp
--- trunk/reactos/tools/rbuild/project.cpp      2005-12-02 12:47:42 UTC
(rev 19826)
+++ trunk/reactos/tools/rbuild/project.cpp      2005-12-02 13:59:35 UTC
(rev 19827)
@@ -19,6 +19,7 @@
 #include <assert.h>
 #include "rbuild.h"
+#include "backend/backend.h"
 using std::string;
 using std::vector;
@@ -87,13 +88,15 @@
          node (NULL),
          head (NULL),
          configuration (configuration)
-{
+{
        ReadXml();
 }
 Project::~Project ()
 {
        size_t i;
+       if ( _backend )
+               delete _backend;
        for ( i = 0; i < modules.size (); i++ )
                delete modules[i];
        for ( i = 0; i < linkerFlags.size (); i++ )
  _____
Modified: trunk/reactos/tools/rbuild/rbuild.cpp
--- trunk/reactos/tools/rbuild/rbuild.cpp       2005-12-02 12:47:42 UTC
(rev 19826)
+++ trunk/reactos/tools/rbuild/rbuild.cpp       2005-12-02 13:59:35 UTC
(rev 19827)
@@ -243,18 +243,20 @@
        try
        {
                string projectFilename ( RootXmlFile );
+
                printf ( "Reading build files..." );
                Project project ( configuration, projectFilename );
                printf ( "done\n" );
-               project.WriteConfigurationFile ();
-               project.ExecuteInvocations ();
-               Backend* backend = Backend::Factory::Create (
+
+               project.SetBackend ( Backend::Factory::Create (
                        BuildSystem,
                        project,
-                       configuration );
-               backend->Process ();
-               delete backend;
+                       configuration ) );
+               project.WriteConfigurationFile ();
+               project.ExecuteInvocations ();
+               project.GetBackend().Process();
+
                return 0;
        }
        catch ( Exception& ex )
  _____
Modified: trunk/reactos/tools/rbuild/rbuild.h
--- trunk/reactos/tools/rbuild/rbuild.h 2005-12-02 12:47:42 UTC (rev
19826)
+++ trunk/reactos/tools/rbuild/rbuild.h 2005-12-02 13:59:35 UTC (rev
19827)
@@ -35,11 +35,14 @@
 #endif/*WIN32*/
 #endif/*_MSC_VER*/
+#include <infhost.h>
+
 #include "ssprintf.h"
 #include "exception.h"
 #include "xml.h"
-#include <infhost.h>
+class Backend; // forward declaration
+
 typedef std::vector<std::string> string_list;
 extern std::string ExePrefix;
@@ -191,6 +194,7 @@
 {
        std::string xmlfile;
        XMLElement *node, *head;
+       Backend* _backend;
 public:
        const Configuration& configuration;
        std::string name;
@@ -205,8 +209,11 @@
        Project ( const Configuration& configuration,
                  const std::string& filename );
        ~Project ();
+       void SetBackend ( Backend* backend ) { _backend = backend; }
+       Backend& GetBackend() { return *_backend; }
        void WriteConfigurationFile ();
        void ExecuteInvocations ();
+
        void ProcessXML ( const std::string& path );
        Module* LocateModule ( const std::string& name );
        const Module* LocateModule ( const std::string& name ) const;