Add bootstrap tag to specify that files are to be copied to the CD
[reactos.git] / reactos / tools / rbuild / bootstrap.cpp
1 #include "pch.h"
2 #include <assert.h>
3
4 #include "rbuild.h"
5
6 using std::string;
7
8 Bootstrap::Bootstrap ( const Project& project_,
9 const Module* module_,
10 const XMLElement& bootstrapNode )
11 : project(project_),
12 module(module_),
13 node(bootstrapNode)
14 {
15 Initialize();
16 }
17
18 Bootstrap::~Bootstrap ()
19 {
20 }
21
22 bool
23 Bootstrap::IsSupportedModuleType ( ModuleType type )
24 {
25 switch ( type )
26 {
27 case Kernel:
28 case KernelModeDLL:
29 case NativeDLL:
30 case NativeCUI:
31 case Win32DLL:
32 case Win32CUI:
33 case Win32GUI:
34 case KernelModeDriver:
35 return true;
36 case BuildTool:
37 case StaticLibrary:
38 case ObjectLibrary:
39 case BootLoader:
40 case BootSector:
41 case Iso:
42 return false;
43 }
44 throw InvalidOperationException ( __FILE__,
45 __LINE__ );
46 }
47
48 void
49 Bootstrap::Initialize ()
50 {
51 if ( !IsSupportedModuleType ( module->type ) )
52 {
53 throw InvalidBuildFileException (
54 node.location,
55 "<bootstrap> is not applicable for this module type." );
56 }
57
58 const XMLAttribute* att = node.GetAttribute ( "base", false );
59 if ( att != NULL )
60 base = att->value;
61 else
62 base = "";
63
64 att = node.GetAttribute ( "nameoncd", false );
65 if ( att != NULL )
66 nameoncd = att->value;
67 else
68 nameoncd = module->GetTargetName ();
69 }
70
71 void
72 Bootstrap::ProcessXML()
73 {
74 }