Author: mpiulachs Date: Fri Feb 22 02:24:44 2008 New Revision: 32445
URL: http://svn.reactos.org/svn/reactos?rev=32445&view=rev Log: - Add support to modules for handling <InstallFile> elements. That instructs rbuild on what files the module must also copy if installed. - Introduced a new module type (Package). Allows us to apply logic like manipulate or conditional include/exclude a group of files that represent altogether an entity. (It will be used when auto generating packages file)
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h branches/rbuild/reactos/tools/rbuild/bootstrap.cpp branches/rbuild/reactos/tools/rbuild/module.cpp branches/rbuild/reactos/tools/rbuild/rbuild.h
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/back... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp Fri Feb 22 02:24:44 2008 @@ -556,6 +556,8 @@ return false; if ( module.type == Alias ) return false; + if ( module.type == Package ) + return false; return true; }
@@ -1210,10 +1212,21 @@ MingwBackend::GetNonModuleInstallTargetFiles ( vector<FileLocation>& out ) const { + /* Project install files */ for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) { const InstallFile& installfile = *ProjectNode.installfiles[i]; out.push_back ( *installfile.target ); + } + + for ( size_t i = 0; i < ProjectNode.modules.size (); i++ ) + { + const Module& module = *ProjectNode.modules[i]; + for ( size_t j = 0; j < module.installfiles.size (); j++ ) + { + const InstallFile& installfile = *module.installfiles[j]; + out.push_back ( *installfile.target ); + } } }
@@ -1263,6 +1276,16 @@ { const InstallFile& installfile = *ProjectNode.installfiles[i]; OutputInstallTarget ( *installfile.source, *installfile.target ); + } + + for ( size_t i = 0; i < ProjectNode.modules.size (); i++ ) + { + const Module& module = *ProjectNode.modules[i]; + for ( size_t j = 0; j < module.installfiles.size (); j++ ) + { + const InstallFile& installfile = *module.installfiles[j]; + OutputInstallTarget ( *installfile.source, *installfile.target ); + } } }
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/back... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Fri Feb 22 02:24:44 2008 @@ -237,6 +237,9 @@ case ElfExecutable: handler = new MingwElfExecutableModuleHandler ( module ); break; + case Package: + handler = new MingwAliasModuleHandler ( module ); + break; default: throw UnknownModuleTypeException ( module.node.location, @@ -3654,6 +3657,21 @@ installfile.target->name ); OutputCopyCommand ( *installfile.source, target ); } + + for ( size_t j = 0; j < module.project.modules.size (); j++ ) + { + const Module& mdl = *module.project.modules[j]; + for ( size_t i = 0; i < mdl.installfiles.size (); i++ ) + { + const InstallFile& installfile = *mdl.installfiles[i]; + FileLocation target ( OutputDirectory, + installfile.target->relative_path.length () > 0 + ? livecdReactosDirectory + sSep + installfile.target->relative_path + : livecdReactosDirectory, + installfile.target->name ); + OutputCopyCommand ( *installfile.source, target ); + } + } }
void @@ -3846,6 +3864,18 @@ { }
+MingwPackageModuleHandler::MingwPackageModuleHandler ( + const Module& module_ ) + + : MingwModuleHandler ( module_ ) +{ +} + +void +MingwPackageModuleHandler::Process () +{ +} + MingwIdlHeaderModuleHandler::MingwIdlHeaderModuleHandler ( const Module& module_ )
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/back... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h (original) +++ branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h Fri Feb 22 02:24:44 2008 @@ -488,6 +488,14 @@ virtual void Process (); };
+class MingwPackageModuleHandler : public MingwModuleHandler +{ +public: + MingwPackageModuleHandler ( const Module& module ); + virtual HostType DefaultHost() { return HostFalse; } + virtual void Process (); +}; + class MingwAliasModuleHandler : public MingwModuleHandler { public:
Modified: branches/rbuild/reactos/tools/rbuild/bootstrap.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/boot... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/bootstrap.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/bootstrap.cpp Fri Feb 22 02:24:44 2008 @@ -68,7 +68,8 @@ case IdlHeader: case EmbeddedTypeLib: case ElfExecutable: - return false; + case Package: + return false; } throw InvalidOperationException ( __FILE__, __LINE__ );
Modified: branches/rbuild/reactos/tools/rbuild/module.cpp URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/modu... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/module.cpp (original) +++ branches/rbuild/reactos/tools/rbuild/module.cpp Fri Feb 22 02:24:44 2008 @@ -686,6 +686,12 @@ parseContext.ifData->data.defines.push_back ( pDefine ); else non_if_data.defines.push_back ( pDefine ); + subs_invalid = true; + } + else if ( e.name == "installfile" ) + { + InstallFile* installfile = new InstallFile ( project, e, relative_path ); + installfiles.push_back ( installfile ); /* add the file to project for now */ subs_invalid = true; } else if ( e.name == "family" ) @@ -1073,6 +1079,8 @@ return EmbeddedTypeLib; if ( attribute.value == "elfexecutable" ) return ElfExecutable; + if ( attribute.value == "package" ) + return Package; throw InvalidAttributeValueException ( location, attribute.name, attribute.value ); @@ -1110,6 +1118,7 @@ case RpcServer: case RpcClient: case Alias: + case Package: case IdlHeader: return IntermediateDirectory; } @@ -1161,6 +1170,7 @@ return ".o"; case RpcClient: return ".o"; + case Package: case Alias: case ElfExecutable: case IdlHeader: @@ -1213,6 +1223,7 @@ case RpcServer: case RpcClient: case Alias: + case Package: case BootProgram: case IdlHeader: case ElfExecutable: @@ -1258,6 +1269,7 @@ case RpcServer: case RpcClient: case Alias: + case Package: case BootProgram: case IdlHeader: case EmbeddedTypeLib: @@ -1303,6 +1315,7 @@ case RpcServer: case RpcClient: case Alias: + case Package: case IdlHeader: case EmbeddedTypeLib: case ElfExecutable:
Modified: branches/rbuild/reactos/tools/rbuild/rbuild.h URL: http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/rbui... ============================================================================== --- branches/rbuild/reactos/tools/rbuild/rbuild.h (original) +++ branches/rbuild/reactos/tools/rbuild/rbuild.h Fri Feb 22 02:24:44 2008 @@ -359,7 +359,8 @@ IsoRegTest = 24, LiveIsoRegTest = 25, EmbeddedTypeLib = 26, - ElfExecutable = 27 + ElfExecutable = 27, + Package = 28 };
enum HostType @@ -427,6 +428,7 @@ std::vector<CompilerFlag*> compilerFlags; std::vector<LinkerFlag*> linkerFlags; std::vector<StubbedComponent*> stubbedComponents; + std::vector<InstallFile*> installfiles; LinkerScript* linkerScript; PchFile* pch; bool cplusplus;