From 5e6a2214be6effb3cdd42d46584b3638ba6903e9 Mon Sep 17 00:00:00 2001 From: Royce Mitchell III Date: Fri, 2 Dec 2005 13:59:35 +0000 Subject: [PATCH 1/1] store pointer to Backend in the Project class so properties of the Backend object can eventually be queried from the generic rbuild code svn path=/trunk/; revision=19827 --- reactos/tools/rbuild/project.cpp | 5 ++++- reactos/tools/rbuild/rbuild.cpp | 14 ++++++++------ reactos/tools/rbuild/rbuild.h | 9 ++++++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index 4e398fa41eb..be314f8431c 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -19,6 +19,7 @@ #include #include "rbuild.h" +#include "backend/backend.h" using std::string; using std::vector; @@ -87,13 +88,15 @@ Project::Project ( const Configuration& configuration, 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++ ) diff --git a/reactos/tools/rbuild/rbuild.cpp b/reactos/tools/rbuild/rbuild.cpp index e8f96363e4c..e838e86a1e4 100644 --- a/reactos/tools/rbuild/rbuild.cpp +++ b/reactos/tools/rbuild/rbuild.cpp @@ -243,17 +243,19 @@ main ( int argc, char** argv ) 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; } diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index e45b2068623..4cdb08d6d5c 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -35,10 +35,13 @@ #endif/*WIN32*/ #endif/*_MSC_VER*/ +#include + #include "ssprintf.h" #include "exception.h" #include "xml.h" -#include + +class Backend; // forward declaration typedef std::vector string_list; @@ -191,6 +194,7 @@ class Project { std::string xmlfile; XMLElement *node, *head; + Backend* _backend; public: const Configuration& configuration; std::string name; @@ -205,8 +209,11 @@ public: 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; -- 2.17.1