-Add a new module type 'cabinet' to handle .cab files generation
[reactos.git] / reactos / tools / rbuild / bootstrap.cpp
index dddb965..f286bfd 100644 (file)
@@ -46,40 +46,65 @@ Bootstrap::IsSupportedModuleType ( ModuleType type )
                case NativeDLL:
                case NativeCUI:
                case Win32DLL:
+               case Win32OCX:
                case Win32CUI:
+               case Win32SCR:
                case Win32GUI:
                case KernelModeDriver:
                case BootSector:
                case BootLoader:
+               case BootProgram:
+               case Cabinet:
                        return true;
                case BuildTool:
                case StaticLibrary:
+               case HostStaticLibrary:
                case ObjectLibrary:
                case Iso:
                case LiveIso:
+               case IsoRegTest:
+               case LiveIsoRegTest:
                case Test:
                case RpcServer:
                case RpcClient:
+               case RpcProxy:
                case Alias:
+               case IdlHeader:
+               case EmbeddedTypeLib:
+               case ElfExecutable:
                        return false;
+               case TypeDontCare:
+                       break;
        }
        throw InvalidOperationException ( __FILE__,
                                          __LINE__ );
 }
 
+string
+Bootstrap::ReplaceVariable ( const string& name,
+                             const string& value,
+                             string path )
+{
+       size_t i = path.find ( name );
+       if ( i != string::npos )
+               return path.replace ( i, name.length (), value );
+       else
+               return path;
+}
+
 void
 Bootstrap::Initialize ()
 {
        if ( !IsSupportedModuleType ( module->type ) )
        {
-               throw InvalidBuildFileException (
+               throw XMLInvalidBuildFileException (
                        node.location,
                        "<bootstrap> is not applicable for this module type." );
        }
 
-       const XMLAttribute* att = node.GetAttribute ( "base", false );
+       const XMLAttribute* att = node.GetAttribute ( "installbase", false );
        if ( att != NULL )
-               base = att->value;
+               base = ReplaceVariable ( "$(CDOUTPUT)", Environment::GetCdOutputPath (), att->value );
        else
                base = "";
 
@@ -87,7 +112,7 @@ Bootstrap::Initialize ()
        if ( att != NULL )
                nameoncd = att->value;
        else
-               nameoncd = module->GetTargetName ();
+               nameoncd = module->output->name;
 }
 
 void