NPL;}jK9&ZX=lbcdYSfRoToq2>!3ASPn#8u
z^5_H5<0%vLR4N9}qQ$`Zh^$7XR0mux@nJd(I!OC~-=*IJ!;-UI&T=Kai#`PZNxBT&
zOIH;?y#RZey+d~b$L>D*2U4BLHo7PZt&wf=(v$RGXdorBqSlVYO|go)+z#9IG|?@n
z%JQ6^2HUVasx`un?b_|0)?&DE-3)s1h+%8%Ad2nU;Mif|y42~0ZO1f16zp+5(Mk28
zEh6lZ7WQn1YIVa(4rq;W%QHHKR%v&}3{yBk;dB{LLCFE;>z)xZOvCFb_i!dcaZe1+
z7VReV8n#8{t}8l2X3u)jvj&QWL{kF+Vd_0WBWeu|C7jb5g=@zhHd-g*o}-(Cj2hjF
z#`S2LwxI3_6TXN_8!^$tUW;&C*dJ1wvR7@j+fFBZw=LZqR*HQcc5v8%N;}r$7|{;z
zRXI0nx6BteC@kn?
zx7}3wC`~t$^_JixeXZ}r;oYm_b%)++Tlw0>+HX%C`+@-Ake_bp%{*%iWKZ&%~jNE(TX9o*6g%-Rh7EHhP*OlHTd*KJ4?D*a4-;jvD#}$T
zOIQn=@p>DHr7y*I8$Y743XSBB{D^C1B}AnPX@5AP4(=bd(sp9DBln=DmYb$353H*?
z$g9&OB6vF%DKvX%LSbW(nz&Qd#HFe-r=+-e5z#jlnlL1prkZH9Lb+*IH9O7$Qj&K*
zi1dqo@D0qF`iTGURq
zl$y==AvIxC2iL{8P9EfJ^b+N0<`}+a;gbg`1N`W1H1*>kDp+;uS4JU@0csxjmC)CT
zpTKMnR`9n2umfBdeGU9>R4z4m@TcTs(x)CoK$mlQycQmW;RnyOu?i1|k+nM%lbG(k
zU)oNsIsglXDI;B4QqNAHkZxdK@%Jm&3M+mh+d;;>sRJgjdxC
zjKDHcB4+hTNzOL=or(eXIE%yQ&!joDM74@5pgblnV%bN-JGR6=O_ohmcu4Tp%XjSM5Nh|8#A5K!MWx={dKuZ
TBcLY!&!}P9UAq3eeA)j4ZC9R*
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/FileSystemTreeView/icons/folder.ico b/reactos/tools/sysgen/FileSystemTreeView/icons/folder.ico
new file mode 100644
index 0000000000000000000000000000000000000000..c9e4b0b4a38001b92f3820c44b00a942347f8889
GIT binary patch
literal 1406
zcmeH{Jr2S!4255u{$}dL%*ZWZgW
zSJ~0$)`{av1{9yF0)2s13XA|uXbfRYb8)Ac@=NTNN7U=u$4*a+#n}Se3ozf{@UUoZ
z4el=sYZ)IjbYSSfUv)sFh$Jdf7#zHD<^)wB@1^t1vDUhzxU}rZspSC9hxdVv>DXtN
z#+W$&!(aRN=jYr{x}Op16AASttW3PXx^$BA%a%hzhjJzFL+rPA^HbBNv>lBj@eN@5
B9CiQz
literal 0
HcmV?d00001
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/CatalogTriStateTreeView.cs b/reactos/tools/sysgen/RosBuilder/Controls/CatalogTriStateTreeView.cs
new file mode 100644
index 00000000000..c4309b01166
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/CatalogTriStateTreeView.cs
@@ -0,0 +1,220 @@
+using System;
+using System.Drawing;
+using System.Text;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows.Forms;
+
+using SIL.FieldWorks.Common.Controls;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class CatalogTriStateTreeView : TriStateTreeView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private TreeNode m_PlatformNode = null;
+
+ public CatalogTriStateTreeView()
+ {
+ }
+
+ private void CatalogTriStateTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e)
+ {
+ if (m_SysGenDesigner.SysGenEngine.Project != null)
+ {
+ if (e.Node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
+
+ if (GetChecked(e.Node) == CheckState.Unchecked)
+ {
+ //Add the selected node and dependencies
+ m_SysGenDesigner.PlatformController.Add(moduleNode.Module);
+ }
+ else
+ {
+ //Remove the module from our platform
+ m_SysGenDesigner.PlatformController.Remove(moduleNode.Module);
+ }
+
+ //Update current module status
+ UpdateCatalogTree();
+ }
+ else if (e.Node is FolderTreeNode)
+ {
+ if (m_AutoUpdatingParents == false)
+ {
+ //e.Cancel = (AddTreeNodeModules(e.Node) == false);
+ }
+ }
+ }
+ else
+ {
+ MessageBox.Show("Cannot modify a catalog tree without platform associated");
+ }
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+
+ //Load the platform tree catalog
+ LoadCatalogTree();
+ UpdateCatalogTree();
+
+ NodeMouseClick += new TreeNodeMouseClickEventHandler(CatalogTriStateTreeView_NodeMouseClick);
+ }
+
+ void CatalogTriStateTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
+ {
+ ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
+
+ if (moduleNode != null)
+ m_SysGenDesigner.InspectedObject = moduleNode.Module;
+ }
+
+ private void LoadCatalogTree()
+ {
+ m_PlatformNode = new TreeNode();
+
+ LoadPlatformModules(m_PlatformNode, m_SysGenDesigner.SysGenEngine.ProjectTask);
+
+ Nodes.Clear();
+ Nodes.Add(m_PlatformNode);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+ }
+
+ private void UpdateCatalogTree()
+ {
+ BeginUpdate();
+ BeforeCheck -= new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+
+ UpdatePlatformModules(m_PlatformNode);
+
+ EndUpdate();
+ BeforeCheck += new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+ }
+
+ private string RootNodeText
+ {
+ get
+ {
+ return string.Format("Catalog ({0} Modules-{1} Available)",
+ m_SysGenDesigner.PlatformController.Project.Platform.Modules.Count,
+ m_SysGenDesigner.PlatformController.Project.Modules.Count);
+ }
+ }
+
+ private void UpdatePlatformModules(TreeNode node)
+ {
+ if (node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = node as ModuleTreeNode;
+
+ if (moduleNode != null)
+ {
+ if (m_SysGenDesigner.PlatformController.Project.Platform.Modules.Contains(moduleNode.Module))
+ {
+ SetChecked(moduleNode, CheckState.Checked);
+ }
+ else
+ {
+ SetChecked(moduleNode, CheckState.Unchecked);
+ }
+ }
+ }
+ else
+ {
+ foreach (TreeNode subNode in node.Nodes)
+ {
+ UpdatePlatformModules(subNode);
+ }
+ }
+ }
+
+ private void LoadPlatformModules(TreeNode node, Task task)
+ {
+ if (task is ModuleTask)
+ {
+ RBuildModule module = ((ModuleTask)task).Module;
+
+ node.Nodes.Add(new ModuleTreeNode(module));
+ }
+ else if (task is ITaskContainer)
+ {
+ if (task is DirectoryTask)
+ {
+ FolderTreeNode taskNode = new FolderTreeNode(((DirectoryTask)task).Name);
+
+ node.Nodes.Add(taskNode);
+
+ foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ {
+ LoadPlatformModules(taskNode, innerTask);
+ }
+ }
+ else
+ {
+ foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ {
+ LoadPlatformModules(node, innerTask);
+ }
+ }
+ }
+ }
+
+ public abstract class CatalogTreeNode : TreeNode
+ {
+ public abstract string NodeName { get; }
+ }
+
+ public class ModuleTreeNode : CatalogTreeNode
+ {
+ RBuildModule m_Module = null;
+
+ public ModuleTreeNode(RBuildModule module)
+ {
+ m_Module = module;
+ Text = module.Name;
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public override string NodeName
+ {
+ get { return Module.Name; }
+ }
+ }
+
+ public class FolderTreeNode : CatalogTreeNode
+ {
+ private string m_FolderName = null;
+
+ public FolderTreeNode(string name)
+ {
+ m_FolderName = name;
+ Text = name;
+ }
+
+ public override string NodeName
+ {
+ get { return m_FolderName; }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/ModuleFiltersListView.cs b/reactos/tools/sysgen/RosBuilder/Controls/ModuleFiltersListView.cs
new file mode 100644
index 00000000000..2228f2b729d
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/ModuleFiltersListView.cs
@@ -0,0 +1,91 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class ModuleFiltersListViewItem : ListViewItem
+ {
+ private ModuleFilter m_ModuleFilter = null;
+
+ public ModuleFiltersListViewItem(ModuleFilter filter)
+ {
+ m_ModuleFilter = filter;
+
+ Text = filter.Name;
+ SubItems.Add(filter.Modules.Count.ToString());
+ }
+
+ public ModuleFilter Filter
+ {
+ get { return m_ModuleFilter; }
+ }
+ }
+
+ public class ModuleFiltersListView : ListView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+
+ public ModuleFiltersListView()
+ {
+ View = View.Details;
+
+ FullRowSelect = true;
+ CheckBoxes = true;
+
+ Columns.Add("Name", 200);
+ Columns.Add("Modules", 100);
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+ //m_SysGenDesigner.PlatformController.PlatformModulesUpdated += new EventHandler(PlatformController_PlatformModulesUpdated);
+
+ foreach (ModuleFilter filter in sysGenDesigner.ModuleFilterController.ModuleFilters)
+ {
+ Items.Add(new ModuleFiltersListViewItem(filter));
+ }
+ }
+
+ //protected override void OnItemCheck(ItemCheckEventArgs ice)
+ //{
+ // base.OnItemCheck(ice);
+ //}
+
+ //protected override void OnItemChecked(ItemCheckedEventArgs e)
+ //{
+ // base.OnItemChecked(e);
+ //}
+
+ private void PlatformController_PlatformModulesUpdated(object sender, EventArgs e)
+ {
+ BeginUpdate();
+
+ foreach (ModuleFiltersListViewItem filterItem in Items)
+ {
+ foreach (RBuildModule module in m_SysGenDesigner.ProjectController.Project.Platform.Modules)
+ {
+ if (!filterItem.Filter.Modules.Contains(module))
+ {
+ filterItem.Checked = false;
+ break;
+ }
+ }
+
+ filterItem.Checked = true;
+ }
+
+ EndUpdate();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/NewItemListView.cs b/reactos/tools/sysgen/RosBuilder/Controls/NewItemListView.cs
new file mode 100644
index 00000000000..e2e28dc11f5
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/NewItemListView.cs
@@ -0,0 +1,114 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public abstract class NewItemListViewItem : ListViewItem
+ {
+ protected ISysGenDesigner m_SysGenDesigner = null;
+
+ public NewItemListViewItem(ISysGenDesigner designer)
+ {
+ m_SysGenDesigner = designer;
+ }
+
+ public abstract string Description { get; }
+ public abstract string DefaultFileName { get; }
+
+ public virtual void Apply()
+ {
+ }
+ }
+
+ public class ModuleFiltersNewItemListViewItem : NewItemListViewItem
+ {
+ private ModuleFilter m_ModuleFilter = null;
+
+ public ModuleFiltersNewItemListViewItem(ISysGenDesigner designer ,ModuleFilter filter): base(designer)
+ {
+ m_ModuleFilter = filter;
+
+ Text = filter.Name;
+ }
+
+ public override string Description
+ {
+ get { return m_ModuleFilter.Name; }
+ }
+
+ public override string DefaultFileName
+ {
+ get { return null; }
+ }
+
+ public override void Apply()
+ {
+ m_SysGenDesigner.ModuleFilterController.Apply(m_ModuleFilter);
+ }
+ }
+
+ public class LanguageNewItemListViewItem : NewItemListViewItem
+ {
+ private RBuildLanguage m_Language = null;
+
+ public LanguageNewItemListViewItem(ISysGenDesigner designer, RBuildLanguage language)
+ : base(designer)
+ {
+ m_Language = language;
+
+ Text = language.Name;
+ }
+
+ public override string Description
+ {
+ get { return m_Language.Name; }
+ }
+
+ public override string DefaultFileName
+ {
+ get { return null; }
+ }
+
+ public override void Apply()
+ {
+ m_SysGenDesigner.ProjectController.AddLanguage(m_Language);
+ }
+ }
+
+ public class DebugChannelNewItemListViewItem : NewItemListViewItem
+ {
+ private RBuildDebugChannel m_DebugChannel = null;
+
+ public DebugChannelNewItemListViewItem(ISysGenDesigner designer, RBuildDebugChannel channel)
+ : base(designer)
+ {
+ m_DebugChannel = channel;
+
+ Text = channel.Name;
+ }
+
+ public override string Description
+ {
+ get { return m_DebugChannel.Name; }
+ }
+
+ public override string DefaultFileName
+ {
+ get { return null; }
+ }
+
+ public override void Apply()
+ {
+ m_SysGenDesigner.ProjectController.AddDebugChannel(m_DebugChannel);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/PlatformTreeView.cs b/reactos/tools/sysgen/RosBuilder/Controls/PlatformTreeView.cs
new file mode 100644
index 00000000000..1f12d95df50
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/PlatformTreeView.cs
@@ -0,0 +1,306 @@
+using System;
+using System.Drawing;
+using System.Text;
+using System.Collections.Generic;
+using System.IO;
+using System.Windows.Forms;
+
+using SIL.FieldWorks.Common.Controls;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class PlatformTreeView : TriStateTreeView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private PlatformTreeNode m_PlatformNode = null;
+
+ public PlatformTreeView()
+ {
+ }
+
+ private void CatalogTriStateTreeView_BeforeCheck(object sender, TreeViewCancelEventArgs e)
+ {
+ if (m_SysGenDesigner.ProjectController.Project != null)
+ {
+ if (e.Node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = e.Node as ModuleTreeNode;
+
+ if (GetChecked(e.Node) == CheckState.Unchecked)
+ {
+ //Add the selected node and dependencies
+ m_SysGenDesigner.ProjectController.Add(moduleNode.Module);
+ }
+ else
+ {
+ //Remove the module from our platform
+ m_SysGenDesigner.ProjectController.Remove(moduleNode.Module);
+ }
+
+ }
+ else if (e.Node is FolderTreeNode)
+ {
+ }
+ }
+ else
+ {
+ MessageBox.Show("Cannot modify a catalog tree without platform associated");
+ }
+
+ /* cancel the paint event*/
+ e.Cancel = true;
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+
+ m_SysGenDesigner.ProjectController.PlatformModulesUpdated += new EventHandler(PlatformController_PlatformModulesUpdated);
+
+ //Load the platform tree catalog
+ LoadCatalogTree();
+ UpdateCatalogTree();
+
+ NodeMouseClick += new TreeNodeMouseClickEventHandler(CatalogTriStateTreeView_NodeMouseClick);
+ }
+
+ void PlatformController_PlatformModulesUpdated(object sender, EventArgs e)
+ {
+ //Update current module status
+ UpdateCatalogTree();
+ }
+
+ void CatalogTriStateTreeView_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
+ {
+ CatalogTreeNode catalogNode = e.Node as CatalogTreeNode;
+
+ if (catalogNode != null)
+ m_SysGenDesigner.InspectedObject = catalogNode.NodeObject;
+ }
+
+ private void LoadCatalogTree()
+ {
+ m_PlatformNode = new PlatformTreeNode(m_SysGenDesigner.ProjectController.Project.Platform);
+
+ LoadPlatformModules(m_PlatformNode);
+ //LoadPlatformModules(m_PlatformNode, m_SysGenDesigner.SysGenEngine.ProjectTask);
+
+ Nodes.Clear();
+ Nodes.Add(m_PlatformNode);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+ }
+
+ private void UpdateCatalogTree()
+ {
+ BeginUpdate();
+ BeforeCheck -= new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+
+ m_PlatformNode.Text = RootNodeText;
+ m_PlatformNode.Expand();
+
+ UpdatePlatformModules(m_PlatformNode);
+
+ EndUpdate();
+ BeforeCheck += new TreeViewCancelEventHandler(CatalogTriStateTreeView_BeforeCheck);
+ }
+
+ private string RootNodeText
+ {
+ get
+ {
+ return string.Format("Catalog ({0} Modules-{1} Available)",
+ m_SysGenDesigner.ProjectController.Project.Platform.Modules.Count,
+ m_SysGenDesigner.ProjectController.Project.Modules.Count);
+ }
+ }
+
+ private void UpdatePlatformModules(TreeNode node)
+ {
+ if (node is ModuleTreeNode)
+ {
+ //Get the underlying module
+ ModuleTreeNode moduleNode = node as ModuleTreeNode;
+
+ if (moduleNode != null)
+ {
+ if (m_SysGenDesigner.ProjectController.Project.Platform.Modules.Contains(moduleNode.Module))
+ {
+ SetChecked(moduleNode, CheckState.Checked);
+ }
+ else
+ {
+ SetChecked(moduleNode, CheckState.Unchecked);
+ }
+ }
+ }
+ else
+ {
+ foreach (TreeNode subNode in node.Nodes)
+ {
+ UpdatePlatformModules(subNode);
+ }
+ }
+ }
+
+ private void LoadPlatformModules(TreeNode node)
+ {
+ foreach (RBuildModule module in m_SysGenDesigner.ProjectController.AvailableModules)
+ {
+ TreeNode parent = node;
+
+ foreach (string part in module.CatalogPath.Split(new char[] { '\\' }))
+ {
+ if (part.Length > 0)
+ {
+ parent = GetFolderNode(parent, part);
+ }
+ }
+
+ parent.Nodes.Add(new ModuleTreeNode(module));
+ }
+ }
+
+ private TreeNode GetFolderNode(TreeNode parent, string name)
+ {
+ foreach (TreeNode node in parent.Nodes)
+ {
+ CatalogTreeNode folderNode = node as CatalogTreeNode;
+
+ if (folderNode != null)
+ {
+ if (folderNode.NodeName == name)
+ {
+ return folderNode;
+ }
+ }
+ }
+
+ FolderTreeNode newNode = new FolderTreeNode(name);
+
+ parent.Nodes.Add(newNode);
+
+ return newNode;
+ }
+
+ //private void LoadPlatformModules(TreeNode node, Task task)
+ //{
+ // foreach (string path in
+ // /*
+ // if (task is ModuleTask)
+ // {
+ // RBuildModule module = ((ModuleTask)task).Module;
+
+ // node.Nodes.Add(new ModuleTreeNode(module));
+ // }
+ // else if (task is ITaskContainer)
+ // {
+ // if (task is DirectoryTask)
+ // {
+ // FolderTreeNode taskNode = new FolderTreeNode(((DirectoryTask)task).Name);
+
+ // node.Nodes.Add(taskNode);
+
+ // foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ // {
+ // LoadPlatformModules(taskNode, innerTask);
+ // }
+ // }
+ // else
+ // {
+ // foreach (Task innerTask in ((ITaskContainer)task).ChildTasks)
+ // {
+ // LoadPlatformModules(node, innerTask);
+ // }
+ // }
+ // }
+ // */
+ //}
+
+ public abstract class CatalogTreeNode : TreeNode
+ {
+ public abstract string NodeName { get; }
+ public abstract object NodeObject { get;}
+ }
+
+ public class PlatformTreeNode : CatalogTreeNode
+ {
+ RBuildPlatform m_Platform = null;
+
+ public PlatformTreeNode(RBuildPlatform platform)
+ {
+ m_Platform = platform;
+ Text = platform.Name;
+ }
+
+ public RBuildPlatform Platform
+ {
+ get { return m_Platform; }
+ }
+
+ public override string NodeName
+ {
+ get { return m_Platform.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Platform; }
+ }
+ }
+
+ public class ModuleTreeNode : CatalogTreeNode
+ {
+ RBuildModule m_Module = null;
+
+ public ModuleTreeNode(RBuildModule module)
+ {
+ m_Module = module;
+ Text = module.Name;
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public override string NodeName
+ {
+ get { return Module.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Module; }
+ }
+ }
+
+ public class FolderTreeNode : CatalogTreeNode
+ {
+ private string m_FolderName = null;
+
+ public FolderTreeNode(string name)
+ {
+ m_FolderName = name;
+ Text = name;
+ }
+
+ public override string NodeName
+ {
+ get { return m_FolderName; }
+ }
+
+ public override object NodeObject
+ {
+ get { return NodeName; }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/ProjectTreeView.cs b/reactos/tools/sysgen/RosBuilder/Controls/ProjectTreeView.cs
new file mode 100644
index 00000000000..35f827319a4
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/ProjectTreeView.cs
@@ -0,0 +1,161 @@
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectTreeView : TreeView
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private TreeNode m_Project = new TreeNode("Project");
+ private TreeNode m_Platforms = new TreeNode("Platform");
+ private TreeNode m_Languages = new TreeNode("Languages");
+ private TreeNode m_DebugChannels = new TreeNode("Debug Channels");
+ //private TreeNode m_Filters = new TreeNode("Filters");
+ private TreeNode m_Files = new TreeNode("Files");
+ private TreeNode m_Registry = new TreeNode("Registry");
+ //private TreeNode m_Filters = new TreeNode("Filters");
+
+ public ProjectTreeView()
+ {
+ }
+
+ public void SetCatalog(ISysGenDesigner sysGenDesigner)
+ {
+ //Set the software catalog
+ m_SysGenDesigner = sysGenDesigner;
+ m_SysGenDesigner.ProjectController.ProjectLoaded += new EventHandler(PlatformController_ProjectLoaded);
+ m_SysGenDesigner.ProjectController.ProjectUpdated += new EventHandler(PlatformController_ProjectUpdated);
+
+
+ LoadProject();
+ }
+
+ void PlatformController_ProjectLoaded(object sender, EventArgs e)
+ {
+ LoadProject();
+ UpdateProject();
+ }
+
+ void PlatformController_ProjectUpdated(object sender, EventArgs e)
+ {
+ UpdateProject();
+ }
+
+ private void LoadProject()
+ {
+ Nodes.Clear();
+
+ m_Project = new ProjectTreeNode(m_SysGenDesigner.ProjectController.SysGenProject);
+ m_Project.Nodes.Add(m_Platforms);
+ m_Project.Nodes.Add(m_Languages);
+ m_Project.Nodes.Add(m_DebugChannels);
+// m_Project.Nodes.Add(m_Filters);
+ m_Project.Nodes.Add(m_Files);
+ m_Project.Nodes.Add(m_Registry);
+ m_Project.Expand();
+
+ Nodes.Add(m_Project);
+ }
+
+ private void UpdateProject()
+ {
+ m_Languages.Nodes.Clear();
+ m_DebugChannels.Nodes.Clear();
+
+ foreach (RBuildLanguage language in m_SysGenDesigner.ProjectController.Project.Platform.Languages)
+ {
+ m_Languages.Nodes.Add(language.Name);
+ }
+
+ foreach (RBuildDebugChannel channel in m_SysGenDesigner.ProjectController.Project.Platform.DebugChannels)
+ {
+ m_DebugChannels.Nodes.Add(channel.Name);
+ }
+ }
+
+ public abstract class CatalogTreeNode : TreeNode
+ {
+ public abstract string NodeName { get; }
+ public abstract object NodeObject { get;}
+ }
+
+ public class ProjectTreeNode : CatalogTreeNode
+ {
+ Project m_Platform = null;
+
+ public ProjectTreeNode(Project platform)
+ {
+ m_Platform = platform;
+ Text = platform.FileName;
+ }
+
+ public Project Platform
+ {
+ get { return m_Platform; }
+ }
+
+ public override string NodeName
+ {
+ get { return m_Platform.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Platform; }
+ }
+ }
+
+ public class ModuleTreeNode : CatalogTreeNode
+ {
+ RBuildModule m_Module = null;
+
+ public ModuleTreeNode(RBuildModule module)
+ {
+ m_Module = module;
+ Text = module.Name;
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public override string NodeName
+ {
+ get { return Module.Name; }
+ }
+
+ public override object NodeObject
+ {
+ get { return Module; }
+ }
+ }
+
+ public class FolderTreeNode : CatalogTreeNode
+ {
+ private string m_FolderName = null;
+
+ public FolderTreeNode(string name)
+ {
+ m_FolderName = name;
+ Text = name;
+ }
+
+ public override string NodeName
+ {
+ get { return m_FolderName; }
+ }
+
+ public override object NodeObject
+ {
+ get { return NodeName; }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.Designer.cs b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.Designer.cs
new file mode 100644
index 00000000000..1c20f5713ba
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.Designer.cs
@@ -0,0 +1,118 @@
+namespace RosBuilder.Controls
+{
+ partial class RegistryEditor
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Component Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.listView1 = new System.Windows.Forms.ListView();
+ this.treeView1 = new System.Windows.Forms.TreeView();
+ this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader2 = new System.Windows.Forms.ColumnHeader();
+ this.columnHeader3 = new System.Windows.Forms.ColumnHeader();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.treeView1);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.listView1);
+ this.splitContainer1.Size = new System.Drawing.Size(623, 542);
+ this.splitContainer1.SplitterDistance = 207;
+ this.splitContainer1.TabIndex = 0;
+ //
+ // listView1
+ //
+ this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
+ this.columnHeader1,
+ this.columnHeader2,
+ this.columnHeader3});
+ this.listView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.listView1.Location = new System.Drawing.Point(0, 0);
+ this.listView1.Name = "listView1";
+ this.listView1.Size = new System.Drawing.Size(412, 542);
+ this.listView1.TabIndex = 0;
+ this.listView1.UseCompatibleStateImageBehavior = false;
+ this.listView1.View = System.Windows.Forms.View.Details;
+ //
+ // treeView1
+ //
+ this.treeView1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.treeView1.Location = new System.Drawing.Point(0, 0);
+ this.treeView1.Name = "treeView1";
+ this.treeView1.Size = new System.Drawing.Size(207, 542);
+ this.treeView1.TabIndex = 0;
+ //
+ // columnHeader1
+ //
+ this.columnHeader1.Text = "Name";
+ this.columnHeader1.Width = 159;
+ //
+ // columnHeader2
+ //
+ this.columnHeader2.Text = "Type";
+ this.columnHeader2.Width = 130;
+ //
+ // columnHeader3
+ //
+ this.columnHeader3.Text = "Data";
+ //
+ // RegistryEditor
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.splitContainer1);
+ this.Name = "RegistryEditor";
+ this.Size = new System.Drawing.Size(623, 542);
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ this.splitContainer1.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.TreeView treeView1;
+ private System.Windows.Forms.ListView listView1;
+ private System.Windows.Forms.ColumnHeader columnHeader1;
+ private System.Windows.Forms.ColumnHeader columnHeader2;
+ private System.Windows.Forms.ColumnHeader columnHeader3;
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.cs b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.cs
new file mode 100644
index 00000000000..738adfbefc0
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Drawing;
+using System.Data;
+using System.Text;
+using System.Windows.Forms;
+
+namespace RosBuilder.Controls
+{
+ public partial class RegistryEditor : UserControl
+ {
+ public RegistryEditor()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.resx b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.resx
new file mode 100644
index 00000000000..19dc0dd8b39
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Controls/RegistryEditor.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Form1.Designer.cs b/reactos/tools/sysgen/RosBuilder/Form1.Designer.cs
new file mode 100644
index 00000000000..04418fb8104
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Form1.Designer.cs
@@ -0,0 +1,38 @@
+namespace RosBuilder
+{
+ partial class Form1
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Text = "Form1";
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Form1.cs b/reactos/tools/sysgen/RosBuilder/Form1.cs
new file mode 100644
index 00000000000..a11fbad5119
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Form1.cs
@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace RosBuilder
+{
+ public partial class Form1 : Form
+ {
+ public Form1()
+ {
+ InitializeComponent();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Form1.resx b/reactos/tools/sysgen/RosBuilder/Form1.resx
new file mode 100644
index 00000000000..19dc0dd8b39
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Form1.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Inspectors/PlatformInspector.cs b/reactos/tools/sysgen/RosBuilder/Inspectors/PlatformInspector.cs
new file mode 100644
index 00000000000..7d798289853
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Inspectors/PlatformInspector.cs
@@ -0,0 +1,155 @@
+using System;
+using System.Windows.Forms;
+using System.ComponentModel;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class PlatformInspector
+ {
+ private RBuildPlatform m_Platform = null;
+
+ public PlatformInspector(RBuildPlatform platform)
+ {
+ m_Platform = platform;
+ }
+
+ [Category("Info")]
+ public string Name
+ {
+ get { return m_Platform.Name; }
+ set { m_Platform.Name = value; }
+ }
+
+ [Category("Info")]
+ public string Description
+ {
+ get { return m_Platform.Description; }
+ set { m_Platform.Description = value; }
+ }
+
+ [Category("Applications")]
+ [Description("The module to be used as a shell for the platform")]
+ public string Shell
+ {
+ set
+ {
+ if (value != string.Empty)
+ {
+ try
+ {
+ RBuildModule module = m_Platform.Modules.GetByName(value);
+
+ if (module == null)
+ throw new ArgumentException("Unknown '" + value + "' shell module");
+
+ if (module.Type != ModuleType.Win32CUI &&
+ module.Type != ModuleType.Win32GUI)
+ throw new ArgumentException("Only Win32 GUI and CUI applications can be set as shell");
+
+ /* set the shell to use */
+ m_Platform.Shell = module;
+ }
+ catch (ArgumentException e)
+ {
+ MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+ get
+ {
+ if (m_Platform.Shell != null)
+ return m_Platform.Shell.Name;
+
+ return string.Empty;
+ }
+ }
+
+ [Category("Applications")]
+ [Description("The module to be used as a screensaver for the platform")]
+ public string Screensaver
+ {
+ set
+ {
+ if (value != string.Empty)
+ {
+ try
+ {
+ RBuildModule module = m_Platform.Modules.GetByName(value);
+
+ if (module == null)
+ throw new ArgumentException("Unknown '" + value + "' screen saver module");
+
+ if (module.Type != ModuleType.Win32SCR)
+ throw new ArgumentException("Only Win32 SCR applications can be set as shell");
+
+ /* set the shell to use */
+ m_Platform.Screensaver = module;
+ }
+ catch (ArgumentException e)
+ {
+ MessageBox.Show(e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ }
+ }
+ get
+ {
+ if (m_Platform.Screensaver != null)
+ return m_Platform.Screensaver.Name;
+
+ return string.Empty;
+ }
+ }
+
+ //public IList DebugChannels
+ //{
+ // get { return m_Platform.DebugChannels; }
+ //}
+
+ [Category("Appareance")]
+ [Description("The module to be used as a screensaver for the platform")]
+ public string Wallpaper
+ {
+ set
+ {
+ if (value != string.Empty)
+ {
+ RBuildWallpaperFile iW = new RBuildWallpaperFile();
+
+ iW.Name = value;
+
+ m_Platform.Wallpaper = iW;
+
+ //foreach (RBuildModule module in m_Platform.Modules)
+ //{
+ // foreach (RBuildFile file in module.Files)
+ // {
+ // RBuildInstallWallpaperFile wallpaper = file as RBuildInstallWallpaperFile;
+
+ // if (wallpaper != null)
+ // {
+ // if (wallpaper.ID.ToLower() == value.ToLower())
+ // {
+ // m_Platform.Wallpaper = wallpaper;
+ // }
+ // }
+ // }
+ //}
+
+ // specified wallpaper not found
+ //throw new ArgumentException();
+ }
+ }
+ get
+ {
+ if (m_Platform.Wallpaper != null)
+ return m_Platform.Wallpaper.ID;
+
+ return string.Empty;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/MainForm.Designer.cs b/reactos/tools/sysgen/RosBuilder/MainForm.Designer.cs
new file mode 100644
index 00000000000..9ebe4ebeefd
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/MainForm.Designer.cs
@@ -0,0 +1,654 @@
+namespace TriStateTreeViewDemo
+{
+ partial class MainForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.components = new System.ComponentModel.Container();
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
+ this.statusStrip1 = new System.Windows.Forms.StatusStrip();
+ this.toolStrip1 = new System.Windows.Forms.ToolStrip();
+ this.newToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.openToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.saveToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator = new System.Windows.Forms.ToolStripSeparator();
+ this.cutToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.copyToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
+ this.saveConfigToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.cmbArchitecture = new System.Windows.Forms.ToolStripComboBox();
+ this.cmbDebug = new System.Windows.Forms.ToolStripComboBox();
+ this.cmbOptimization = new System.Windows.Forms.ToolStripComboBox();
+ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
+ this.helpToolStripButton = new System.Windows.Forms.ToolStripButton();
+ this.menuStrip1 = new System.Windows.Forms.MenuStrip();
+ this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
+ this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
+ this.printToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.printPreviewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
+ this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.platformToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addFiltersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addLanguagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.addDebToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.redoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator();
+ this.cutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator();
+ this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.customizeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.contentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.indexToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.searchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator();
+ this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.pgProperties = new System.Windows.Forms.PropertyGrid();
+ this.splitContainer1 = new System.Windows.Forms.SplitContainer();
+ this.splitContainer2 = new System.Windows.Forms.SplitContainer();
+ this.tvPlatform = new TriStateTreeViewDemo.PlatformTreeView();
+ this.tvProject = new TriStateTreeViewDemo.ProjectTreeView();
+ this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel();
+ this.statusStrip1.SuspendLayout();
+ this.toolStrip1.SuspendLayout();
+ this.menuStrip1.SuspendLayout();
+ this.splitContainer1.Panel1.SuspendLayout();
+ this.splitContainer1.Panel2.SuspendLayout();
+ this.splitContainer1.SuspendLayout();
+ this.splitContainer2.Panel1.SuspendLayout();
+ this.splitContainer2.Panel2.SuspendLayout();
+ this.splitContainer2.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // statusStrip1
+ //
+ this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.toolStripStatusLabel1});
+ this.statusStrip1.Location = new System.Drawing.Point(0, 601);
+ this.statusStrip1.Name = "statusStrip1";
+ this.statusStrip1.Size = new System.Drawing.Size(820, 22);
+ this.statusStrip1.TabIndex = 5;
+ this.statusStrip1.Text = "statusStrip1";
+ //
+ // toolStrip1
+ //
+ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newToolStripButton,
+ this.openToolStripButton,
+ this.saveToolStripButton,
+ this.toolStripSeparator,
+ this.cutToolStripButton,
+ this.copyToolStripButton,
+ this.toolStripSeparator8,
+ this.saveConfigToolStripButton,
+ this.cmbArchitecture,
+ this.cmbDebug,
+ this.cmbOptimization,
+ this.toolStripSeparator1,
+ this.helpToolStripButton});
+ this.toolStrip1.Location = new System.Drawing.Point(0, 24);
+ this.toolStrip1.Name = "toolStrip1";
+ this.toolStrip1.Size = new System.Drawing.Size(820, 25);
+ this.toolStrip1.TabIndex = 6;
+ this.toolStrip1.Text = "toolStrip1";
+ //
+ // newToolStripButton
+ //
+ this.newToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.newToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripButton.Image")));
+ this.newToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.newToolStripButton.Name = "newToolStripButton";
+ this.newToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.newToolStripButton.Text = "&New";
+ this.newToolStripButton.Click += new System.EventHandler(this.newToolStripButton_Click);
+ //
+ // openToolStripButton
+ //
+ this.openToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.openToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripButton.Image")));
+ this.openToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.openToolStripButton.Name = "openToolStripButton";
+ this.openToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.openToolStripButton.Text = "&Open";
+ this.openToolStripButton.Click += new System.EventHandler(this.openToolStripButton_Click);
+ //
+ // saveToolStripButton
+ //
+ this.saveToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.saveToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripButton.Image")));
+ this.saveToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.saveToolStripButton.Name = "saveToolStripButton";
+ this.saveToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.saveToolStripButton.Text = "&Save";
+ this.saveToolStripButton.Click += new System.EventHandler(this.saveToolStripButton_Click);
+ //
+ // toolStripSeparator
+ //
+ this.toolStripSeparator.Name = "toolStripSeparator";
+ this.toolStripSeparator.Size = new System.Drawing.Size(6, 25);
+ //
+ // cutToolStripButton
+ //
+ this.cutToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.cutToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripButton.Image")));
+ this.cutToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.cutToolStripButton.Name = "cutToolStripButton";
+ this.cutToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.cutToolStripButton.Text = "C&ut";
+ //
+ // copyToolStripButton
+ //
+ this.copyToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.copyToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripButton.Image")));
+ this.copyToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.copyToolStripButton.Name = "copyToolStripButton";
+ this.copyToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.copyToolStripButton.Text = "&Copy";
+ //
+ // toolStripSeparator8
+ //
+ this.toolStripSeparator8.Name = "toolStripSeparator8";
+ this.toolStripSeparator8.Size = new System.Drawing.Size(6, 25);
+ //
+ // saveConfigToolStripButton
+ //
+ this.saveConfigToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
+ this.saveConfigToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("saveConfigToolStripButton.Image")));
+ this.saveConfigToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.saveConfigToolStripButton.Name = "saveConfigToolStripButton";
+ this.saveConfigToolStripButton.Size = new System.Drawing.Size(69, 22);
+ this.saveConfigToolStripButton.Text = "&Save Config";
+ this.saveConfigToolStripButton.Click += new System.EventHandler(this.saveConfigToolStripButton_Click);
+ //
+ // cmbArchitecture
+ //
+ this.cmbArchitecture.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbArchitecture.Name = "cmbArchitecture";
+ this.cmbArchitecture.Size = new System.Drawing.Size(150, 25);
+ //
+ // cmbDebug
+ //
+ this.cmbDebug.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbDebug.Name = "cmbDebug";
+ this.cmbDebug.Size = new System.Drawing.Size(75, 25);
+ //
+ // cmbOptimization
+ //
+ this.cmbOptimization.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
+ this.cmbOptimization.Name = "cmbOptimization";
+ this.cmbOptimization.Size = new System.Drawing.Size(75, 25);
+ //
+ // toolStripSeparator1
+ //
+ this.toolStripSeparator1.Name = "toolStripSeparator1";
+ this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
+ //
+ // helpToolStripButton
+ //
+ this.helpToolStripButton.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
+ this.helpToolStripButton.Image = ((System.Drawing.Image)(resources.GetObject("helpToolStripButton.Image")));
+ this.helpToolStripButton.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.helpToolStripButton.Name = "helpToolStripButton";
+ this.helpToolStripButton.Size = new System.Drawing.Size(23, 22);
+ this.helpToolStripButton.Text = "He&lp";
+ //
+ // menuStrip1
+ //
+ this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.fileToolStripMenuItem,
+ this.platformToolStripMenuItem,
+ this.editToolStripMenuItem,
+ this.toolsToolStripMenuItem,
+ this.helpToolStripMenuItem});
+ this.menuStrip1.Location = new System.Drawing.Point(0, 0);
+ this.menuStrip1.Name = "menuStrip1";
+ this.menuStrip1.Size = new System.Drawing.Size(820, 24);
+ this.menuStrip1.TabIndex = 7;
+ this.menuStrip1.Text = "menuStrip1";
+ //
+ // fileToolStripMenuItem
+ //
+ this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.newToolStripMenuItem,
+ this.openToolStripMenuItem,
+ this.toolStripSeparator2,
+ this.saveToolStripMenuItem,
+ this.saveAsToolStripMenuItem,
+ this.toolStripSeparator3,
+ this.printToolStripMenuItem,
+ this.printPreviewToolStripMenuItem,
+ this.toolStripSeparator4,
+ this.exitToolStripMenuItem});
+ this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
+ this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
+ this.fileToolStripMenuItem.Text = "&File";
+ //
+ // newToolStripMenuItem
+ //
+ this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
+ this.newToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.newToolStripMenuItem.Name = "newToolStripMenuItem";
+ this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
+ this.newToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.newToolStripMenuItem.Text = "&New";
+ //
+ // openToolStripMenuItem
+ //
+ this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
+ this.openToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.openToolStripMenuItem.Name = "openToolStripMenuItem";
+ this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
+ this.openToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.openToolStripMenuItem.Text = "&Open";
+ //
+ // toolStripSeparator2
+ //
+ this.toolStripSeparator2.Name = "toolStripSeparator2";
+ this.toolStripSeparator2.Size = new System.Drawing.Size(148, 6);
+ //
+ // saveToolStripMenuItem
+ //
+ this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
+ this.saveToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
+ this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
+ this.saveToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.saveToolStripMenuItem.Text = "&Save";
+ //
+ // saveAsToolStripMenuItem
+ //
+ this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
+ this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.saveAsToolStripMenuItem.Text = "Save &As";
+ //
+ // toolStripSeparator3
+ //
+ this.toolStripSeparator3.Name = "toolStripSeparator3";
+ this.toolStripSeparator3.Size = new System.Drawing.Size(148, 6);
+ //
+ // printToolStripMenuItem
+ //
+ this.printToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printToolStripMenuItem.Image")));
+ this.printToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.printToolStripMenuItem.Name = "printToolStripMenuItem";
+ this.printToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P)));
+ this.printToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.printToolStripMenuItem.Text = "&Print";
+ //
+ // printPreviewToolStripMenuItem
+ //
+ this.printPreviewToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("printPreviewToolStripMenuItem.Image")));
+ this.printPreviewToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.printPreviewToolStripMenuItem.Name = "printPreviewToolStripMenuItem";
+ this.printPreviewToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.printPreviewToolStripMenuItem.Text = "Print Pre&view";
+ //
+ // toolStripSeparator4
+ //
+ this.toolStripSeparator4.Name = "toolStripSeparator4";
+ this.toolStripSeparator4.Size = new System.Drawing.Size(148, 6);
+ //
+ // exitToolStripMenuItem
+ //
+ this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
+ this.exitToolStripMenuItem.Size = new System.Drawing.Size(151, 22);
+ this.exitToolStripMenuItem.Text = "E&xit";
+ //
+ // platformToolStripMenuItem
+ //
+ this.platformToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.addFiltersToolStripMenuItem,
+ this.addLanguagesToolStripMenuItem,
+ this.addDebToolStripMenuItem});
+ this.platformToolStripMenuItem.Name = "platformToolStripMenuItem";
+ this.platformToolStripMenuItem.Size = new System.Drawing.Size(59, 20);
+ this.platformToolStripMenuItem.Text = "&Platform";
+ //
+ // addFiltersToolStripMenuItem
+ //
+ this.addFiltersToolStripMenuItem.Name = "addFiltersToolStripMenuItem";
+ this.addFiltersToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
+ this.addFiltersToolStripMenuItem.Text = "&Add Filters";
+ this.addFiltersToolStripMenuItem.Click += new System.EventHandler(this.addFiltersToolStripMenuItem_Click);
+ //
+ // addLanguagesToolStripMenuItem
+ //
+ this.addLanguagesToolStripMenuItem.Name = "addLanguagesToolStripMenuItem";
+ this.addLanguagesToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
+ this.addLanguagesToolStripMenuItem.Text = "&Add Languages";
+ this.addLanguagesToolStripMenuItem.Click += new System.EventHandler(this.addLanguagesToolStripMenuItem_Click);
+ //
+ // addDebToolStripMenuItem
+ //
+ this.addDebToolStripMenuItem.Name = "addDebToolStripMenuItem";
+ this.addDebToolStripMenuItem.Size = new System.Drawing.Size(185, 22);
+ this.addDebToolStripMenuItem.Text = "&Add Debug Channels";
+ this.addDebToolStripMenuItem.Click += new System.EventHandler(this.addDebToolStripMenuItem_Click);
+ //
+ // editToolStripMenuItem
+ //
+ this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.undoToolStripMenuItem,
+ this.redoToolStripMenuItem,
+ this.toolStripSeparator5,
+ this.cutToolStripMenuItem,
+ this.copyToolStripMenuItem,
+ this.pasteToolStripMenuItem,
+ this.toolStripSeparator6,
+ this.selectAllToolStripMenuItem});
+ this.editToolStripMenuItem.Name = "editToolStripMenuItem";
+ this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
+ this.editToolStripMenuItem.Text = "&Edit";
+ //
+ // undoToolStripMenuItem
+ //
+ this.undoToolStripMenuItem.Name = "undoToolStripMenuItem";
+ this.undoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z)));
+ this.undoToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.undoToolStripMenuItem.Text = "&Undo";
+ //
+ // redoToolStripMenuItem
+ //
+ this.redoToolStripMenuItem.Name = "redoToolStripMenuItem";
+ this.redoToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
+ this.redoToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.redoToolStripMenuItem.Text = "&Redo";
+ //
+ // toolStripSeparator5
+ //
+ this.toolStripSeparator5.Name = "toolStripSeparator5";
+ this.toolStripSeparator5.Size = new System.Drawing.Size(147, 6);
+ //
+ // cutToolStripMenuItem
+ //
+ this.cutToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image")));
+ this.cutToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.cutToolStripMenuItem.Name = "cutToolStripMenuItem";
+ this.cutToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
+ this.cutToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.cutToolStripMenuItem.Text = "Cu&t";
+ //
+ // copyToolStripMenuItem
+ //
+ this.copyToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image")));
+ this.copyToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
+ this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
+ this.copyToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.copyToolStripMenuItem.Text = "&Copy";
+ //
+ // pasteToolStripMenuItem
+ //
+ this.pasteToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image")));
+ this.pasteToolStripMenuItem.ImageTransparentColor = System.Drawing.Color.Magenta;
+ this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
+ this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
+ this.pasteToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.pasteToolStripMenuItem.Text = "&Paste";
+ //
+ // toolStripSeparator6
+ //
+ this.toolStripSeparator6.Name = "toolStripSeparator6";
+ this.toolStripSeparator6.Size = new System.Drawing.Size(147, 6);
+ //
+ // selectAllToolStripMenuItem
+ //
+ this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
+ this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(150, 22);
+ this.selectAllToolStripMenuItem.Text = "Select &All";
+ //
+ // toolsToolStripMenuItem
+ //
+ this.toolsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.customizeToolStripMenuItem,
+ this.optionsToolStripMenuItem});
+ this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
+ this.toolsToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
+ this.toolsToolStripMenuItem.Text = "&Tools";
+ //
+ // customizeToolStripMenuItem
+ //
+ this.customizeToolStripMenuItem.Name = "customizeToolStripMenuItem";
+ this.customizeToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.customizeToolStripMenuItem.Text = "&Customize";
+ //
+ // optionsToolStripMenuItem
+ //
+ this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
+ this.optionsToolStripMenuItem.Size = new System.Drawing.Size(134, 22);
+ this.optionsToolStripMenuItem.Text = "&Options";
+ //
+ // helpToolStripMenuItem
+ //
+ this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
+ this.contentsToolStripMenuItem,
+ this.indexToolStripMenuItem,
+ this.searchToolStripMenuItem,
+ this.toolStripSeparator7,
+ this.aboutToolStripMenuItem});
+ this.helpToolStripMenuItem.Name = "helpToolStripMenuItem";
+ this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20);
+ this.helpToolStripMenuItem.Text = "&Help";
+ //
+ // contentsToolStripMenuItem
+ //
+ this.contentsToolStripMenuItem.Name = "contentsToolStripMenuItem";
+ this.contentsToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.contentsToolStripMenuItem.Text = "&Contents";
+ //
+ // indexToolStripMenuItem
+ //
+ this.indexToolStripMenuItem.Name = "indexToolStripMenuItem";
+ this.indexToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.indexToolStripMenuItem.Text = "&Index";
+ //
+ // searchToolStripMenuItem
+ //
+ this.searchToolStripMenuItem.Name = "searchToolStripMenuItem";
+ this.searchToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.searchToolStripMenuItem.Text = "&Search";
+ //
+ // toolStripSeparator7
+ //
+ this.toolStripSeparator7.Name = "toolStripSeparator7";
+ this.toolStripSeparator7.Size = new System.Drawing.Size(126, 6);
+ //
+ // aboutToolStripMenuItem
+ //
+ this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
+ this.aboutToolStripMenuItem.Size = new System.Drawing.Size(129, 22);
+ this.aboutToolStripMenuItem.Text = "&About...";
+ //
+ // pgProperties
+ //
+ this.pgProperties.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.pgProperties.Location = new System.Drawing.Point(0, 0);
+ this.pgProperties.Name = "pgProperties";
+ this.pgProperties.Size = new System.Drawing.Size(348, 304);
+ this.pgProperties.TabIndex = 9;
+ //
+ // splitContainer1
+ //
+ this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer1.Location = new System.Drawing.Point(0, 49);
+ this.splitContainer1.Name = "splitContainer1";
+ //
+ // splitContainer1.Panel1
+ //
+ this.splitContainer1.Panel1.Controls.Add(this.tvPlatform);
+ //
+ // splitContainer1.Panel2
+ //
+ this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
+ this.splitContainer1.Size = new System.Drawing.Size(820, 552);
+ this.splitContainer1.SplitterDistance = 468;
+ this.splitContainer1.TabIndex = 11;
+ //
+ // splitContainer2
+ //
+ this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer2.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer2.Name = "splitContainer2";
+ this.splitContainer2.Orientation = System.Windows.Forms.Orientation.Horizontal;
+ //
+ // splitContainer2.Panel1
+ //
+ this.splitContainer2.Panel1.Controls.Add(this.tvProject);
+ //
+ // splitContainer2.Panel2
+ //
+ this.splitContainer2.Panel2.Controls.Add(this.pgProperties);
+ this.splitContainer2.Size = new System.Drawing.Size(348, 552);
+ this.splitContainer2.SplitterDistance = 244;
+ this.splitContainer2.TabIndex = 0;
+ //
+ // tvPlatform
+ //
+ this.tvPlatform.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tvPlatform.ImageIndex = 1;
+ this.tvPlatform.Location = new System.Drawing.Point(0, 0);
+ this.tvPlatform.Name = "tvPlatform";
+ this.tvPlatform.SelectedImageIndex = 1;
+ this.tvPlatform.Size = new System.Drawing.Size(468, 552);
+ this.tvPlatform.TabIndex = 1;
+ //
+ // tvProject
+ //
+ this.tvProject.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.tvProject.Location = new System.Drawing.Point(0, 0);
+ this.tvProject.Name = "tvProject";
+ this.tvProject.Size = new System.Drawing.Size(348, 244);
+ this.tvProject.TabIndex = 10;
+ //
+ // toolStripStatusLabel1
+ //
+ this.toolStripStatusLabel1.Name = "toolStripStatusLabel1";
+ this.toolStripStatusLabel1.Size = new System.Drawing.Size(109, 17);
+ this.toolStripStatusLabel1.Text = "toolStripStatusLabel1";
+ //
+ // MainForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(820, 623);
+ this.Controls.Add(this.splitContainer1);
+ this.Controls.Add(this.toolStrip1);
+ this.Controls.Add(this.statusStrip1);
+ this.Controls.Add(this.menuStrip1);
+ this.MainMenuStrip = this.menuStrip1;
+ this.Name = "MainForm";
+ this.Text = "SysGen Platform Designer";
+ this.Load += new System.EventHandler(this.MainForm_Load);
+ this.statusStrip1.ResumeLayout(false);
+ this.statusStrip1.PerformLayout();
+ this.toolStrip1.ResumeLayout(false);
+ this.toolStrip1.PerformLayout();
+ this.menuStrip1.ResumeLayout(false);
+ this.menuStrip1.PerformLayout();
+ this.splitContainer1.Panel1.ResumeLayout(false);
+ this.splitContainer1.Panel2.ResumeLayout(false);
+ this.splitContainer1.ResumeLayout(false);
+ this.splitContainer2.Panel1.ResumeLayout(false);
+ this.splitContainer2.Panel2.ResumeLayout(false);
+ this.splitContainer2.ResumeLayout(false);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private TriStateTreeViewDemo.PlatformTreeView tvPlatform;
+ private System.Windows.Forms.StatusStrip statusStrip1;
+ private System.Windows.Forms.ToolStrip toolStrip1;
+ private System.Windows.Forms.ToolStripButton newToolStripButton;
+ private System.Windows.Forms.ToolStripButton openToolStripButton;
+ private System.Windows.Forms.ToolStripButton saveToolStripButton;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
+ private System.Windows.Forms.ToolStripButton cutToolStripButton;
+ private System.Windows.Forms.ToolStripButton copyToolStripButton;
+ private System.Windows.Forms.ToolStripButton saveConfigToolStripButton;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
+ private System.Windows.Forms.ToolStripButton helpToolStripButton;
+ private System.Windows.Forms.ToolStripComboBox cmbArchitecture;
+ private System.Windows.Forms.ToolStripComboBox cmbDebug;
+ private System.Windows.Forms.MenuStrip menuStrip1;
+ private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem newToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
+ private System.Windows.Forms.ToolStripMenuItem saveToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
+ private System.Windows.Forms.ToolStripMenuItem printToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem printPreviewToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
+ private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem undoToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem redoToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
+ private System.Windows.Forms.ToolStripMenuItem cutToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
+ private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem customizeToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem contentsToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem indexToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem searchToolStripMenuItem;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator7;
+ private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
+ private System.Windows.Forms.PropertyGrid pgProperties;
+ private System.Windows.Forms.ToolStripComboBox cmbOptimization;
+ private ProjectTreeView tvProject;
+ private System.Windows.Forms.ToolStripSeparator toolStripSeparator8;
+ private System.Windows.Forms.SplitContainer splitContainer1;
+ private System.Windows.Forms.SplitContainer splitContainer2;
+ private System.Windows.Forms.ToolStripMenuItem platformToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addFiltersToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addLanguagesToolStripMenuItem;
+ private System.Windows.Forms.ToolStripMenuItem addDebToolStripMenuItem;
+ private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
+ }
+}
+
diff --git a/reactos/tools/sysgen/RosBuilder/MainForm.cs b/reactos/tools/sysgen/RosBuilder/MainForm.cs
new file mode 100644
index 00000000000..c001ba7d016
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/MainForm.cs
@@ -0,0 +1,362 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+using TriStateTreeViewDemo;
+
+using SysGen.Framework.Catalog;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public interface ISysGenDesigner
+ {
+ ModuleFilterController ModuleFilterController { get; }
+ ProjectController ProjectController { get; }
+ object InspectedObject { set; }
+ }
+
+ public partial class MainForm : Form, ISysGenDesigner
+ {
+ ProjectController m_ProjectController = null;
+ ModuleFilterController m_FilterController = null;
+
+ public MainForm()
+ {
+ InitializeComponent();
+
+ m_ProjectController = new ProjectController(this);
+ m_FilterController = new ModuleFilterController(this);
+
+ tvPlatform.SetCatalog(this);
+ tvProject.SetCatalog(this);
+ tvProject.DoubleClick += new EventHandler(tvProject_DoubleClick);
+ //lvModuleFilters.SetCatalog(this);
+ }
+
+ private void button1_Click(object sender, EventArgs e)
+ {
+ //m_project = new RBuildProject();
+
+ m_ProjectController = new ProjectController(this);
+ m_FilterController = new ModuleFilterController(this);
+
+ tvPlatform.SetCatalog(this);
+ tvProject.SetCatalog(this);
+ //lvModuleFilters.SetCatalog(this);
+
+ //PlatformCatalogReader m_Reader = new PlatformCatalogReader(@"C:\Ros\trunk\reactos\rbuilddb.xml");
+
+ /*
+ BuildLog.Listeners.Clear();
+
+ m_SysGenEngine.SetDefaults = false;
+ m_SysGenEngine.RunBackends = false;
+ m_SysGenEngine.CleanCustomConfigs();
+ m_SysGenEngine.ReadBuildFiles();
+
+ m_PlatformController = new PlatformController(this);
+ m_FilterController = new ModuleFilterController(this);
+
+ catalogTriStateTreeView1.SetCatalog(this);
+ lvModuleFilters.SetCatalog(this);
+ */
+
+ }
+
+ void tvProject_DoubleClick(object sender, EventArgs e)
+ {
+ }
+
+ private void button2_Click(object sender, EventArgs e)
+ {
+ using (XmlTextWriter writer = new XmlTextWriter(@"c:\pkg.rbuild", Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("module");
+ writer.WriteAttributeString("name", "");
+ writer.WriteAttributeString("type", "modulegroup");
+
+ foreach (RBuildModule module in m_ProjectController.Project.Platform.Modules)
+ {
+ writer.WriteElementString("requires", module.Name);
+ }
+
+ writer.WriteEndElement();
+ writer.WriteEndDocument();
+ }
+
+ }
+
+ private void button3_Click(object sender, EventArgs e)
+ {
+ }
+
+ public ModuleFilterController ModuleFilterController
+ {
+ get { return m_FilterController; }
+ }
+
+ public ProjectController ProjectController
+ {
+ get { return m_ProjectController; }
+ }
+
+ private void lvModuleFilters_SelectedIndexChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ //private void lvModuleFilters_ItemCheck(object sender, ItemCheckEventArgs e)
+ //{
+ // ModuleFiltersListViewItem filerListViewItem = lvModuleFilters.FocusedItem as ModuleFiltersListViewItem;
+
+ // if (filerListViewItem != null)
+ // {
+ // if (e.NewValue == CheckState.Checked)
+ // {
+ // m_FilterController.Apply(filerListViewItem.Filter);
+ // }
+ // }
+ //}
+
+ private void MainForm_Load(object sender, EventArgs e)
+ {
+ cmbArchitecture.Items.Add("x86 - (i486)");
+ cmbArchitecture.Items.Add("x86 - (i586)");
+ cmbArchitecture.Items.Add("x86 - (Pentium)");
+ cmbArchitecture.Items.Add("x86 - (Pentium2)");
+ cmbArchitecture.Items.Add("x86 - (Pentium3)");
+ cmbArchitecture.Items.Add("x86 - (Pentium4)");
+ cmbArchitecture.Items.Add("x86 - (athlon-xp)");
+ cmbArchitecture.Items.Add("x86 - (athlon-mp)");
+ cmbArchitecture.Items.Add("x86 - (k6-2)");
+ cmbArchitecture.Items.Add("x86 - Xbox");
+ cmbArchitecture.Items.Add("Power PC");
+ cmbArchitecture.Items.Add("ARM");
+ cmbArchitecture.SelectedIndex = 2;
+
+ cmbDebug.Items.Add("Debug");
+ cmbDebug.Items.Add("Release");
+ cmbDebug.SelectedIndex = 0;
+
+ cmbOptimization.Items.Add("Level 0");
+ cmbOptimization.Items.Add("Level 1");
+ cmbOptimization.Items.Add("Level 2");
+ cmbOptimization.Items.Add("Level 3");
+ cmbOptimization.Items.Add("Level 4");
+ cmbOptimization.Items.Add("Level 5");
+ cmbOptimization.SelectedIndex = 1;
+ }
+
+ public object InspectedObject
+ {
+ set
+ {
+ if (value is RBuildPlatform)
+ {
+ pgProperties.SelectedObject = new PlatformInspector(m_ProjectController.Project.Platform);
+ }
+ else
+ pgProperties.SelectedObject = value;
+ }
+ }
+
+ private void openToolStripButton_Click(object sender, EventArgs e)
+ {
+ m_ProjectController.Open();
+ }
+
+ private void saveToolStripButton_Click(object sender, EventArgs e)
+ {
+ m_ProjectController.Save();
+ }
+
+ private void saveConfigToolStripButton_Click(object sender, EventArgs e)
+ {
+ //if (MessageBox.Show("Your platform does not have a default shell selected ¿are you sure you want to continue?",
+ // "Question",
+ // MessageBoxButtons.YesNo,
+ // MessageBoxIcon.Question) == DialogResult.OK)
+ //{
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(m_ProjectController.SysGenProject.Source + @"\config.rbuild", Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("group");
+
+ writer.WriteComment("Platform information");
+ writer.WriteElementString("platformname", m_ProjectController.Project.Platform.Name);
+ writer.WriteElementString("platformdescription", m_ProjectController.Project.Platform.Description);
+
+ writer.WriteComment("Default applications");
+
+ if (m_ProjectController.Project.Platform.Shell != null)
+ {
+ writer.WriteElementString("platformshell", m_ProjectController.Project.Platform.Shell.Name);
+ }
+
+ if (m_ProjectController.Project.Platform.Screensaver != null)
+ {
+ writer.WriteElementString("platformscreensaver", m_ProjectController.Project.Platform.Screensaver.Name);
+ }
+
+ if (m_ProjectController.Project.Platform.Wallpaper != null)
+ {
+ writer.WriteElementString("platformwallpaper", m_ProjectController.Project.Platform.Wallpaper.ID);
+ }
+
+ writer.WriteComment("Modules incuded in the platform");
+ foreach (RBuildModule module in m_ProjectController.Project.Platform.Modules)
+ {
+ writer.WriteElementString("platformmodule", module.Name);
+ }
+
+ writer.WriteComment("Languages incuded in the platform");
+ foreach (RBuildLanguage language in m_ProjectController.Project.Platform.Languages)
+ {
+ writer.WriteElementString("platformlanguage", language.Name);
+ }
+
+ writer.WriteComment("Debug Channels incuded in the platform");
+ foreach (RBuildDebugChannel debugChannel in m_ProjectController.Project.Platform.DebugChannels)
+ {
+ writer.WriteElementString("platformdebugchhanel", debugChannel.Name);
+ }
+
+ writer.WriteComment("Platform RBuild Properties");
+ writer.WriteComment("Properties");
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "SARCH");
+ writer.WriteAttributeString("value", "");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "OARCH");
+ writer.WriteAttributeString("value", "pentium");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "OPTIMIZE");
+ writer.WriteAttributeString("value", ((int)m_ProjectController.SysGenProject.OptimizeLevel).ToString());
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "KDBG");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.KDebug ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "DBG");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.Debug ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "GDB");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.GDB ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "NSWPAT");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.NSWPAT ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", "_WINKD_");
+ writer.WriteAttributeString("value", m_ProjectController.SysGenProject.WINKD ? "1" : "0");
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ writer.WriteEndDocument();
+ // }
+ }
+ }
+
+ private void newToolStripButton_Click(object sender, EventArgs e)
+ {
+ m_ProjectController.New();
+ }
+
+ private void addFiltersToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (NewItemForm newItem = new NewItemForm())
+ {
+ foreach (ModuleFilter filter in ModuleFilterController.ModuleFilters)
+ {
+ newItem.ListView.Items.Add(new ModuleFiltersNewItemListViewItem(this, filter));
+ }
+
+ if (newItem.ShowDialog() == DialogResult.OK)
+ {
+ foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
+ {
+ NewItemListViewItem item = lvItem as NewItemListViewItem;
+
+ if (item != null)
+ item.Apply();
+ }
+ }
+ }
+ }
+
+ private void addLanguagesToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (NewItemForm newItem = new NewItemForm())
+ {
+ foreach (RBuildLanguage language in m_ProjectController.Project.Languages)
+ {
+ newItem.ListView.Items.Add(new LanguageNewItemListViewItem(this, language));
+ }
+
+ if (newItem.ShowDialog() == DialogResult.OK)
+ {
+ foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
+ {
+ NewItemListViewItem item = lvItem as NewItemListViewItem;
+
+ if (item != null)
+ item.Apply();
+ }
+ }
+ }
+ }
+
+ private void addDebToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ using (NewItemForm newItem = new NewItemForm())
+ {
+ foreach (RBuildDebugChannel channel in m_ProjectController.Project.DebugChannels)
+ {
+ newItem.ListView.Items.Add(new DebugChannelNewItemListViewItem(this, channel));
+ }
+
+ if (newItem.ShowDialog() == DialogResult.OK)
+ {
+ foreach (ListViewItem lvItem in newItem.ListView.SelectedItems)
+ {
+ NewItemListViewItem item = lvItem as NewItemListViewItem;
+
+ if (item != null)
+ item.Apply();
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/MainForm.resx b/reactos/tools/sysgen/RosBuilder/MainForm.resx
new file mode 100644
index 00000000000..222877d4dd7
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/MainForm.resx
@@ -0,0 +1,353 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
+ 127, 17
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
+ wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
+ u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
+ 8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
+ PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
+ KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
+ k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
+ TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
+ AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
+ BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
+ UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
+ CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
+ F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
+ rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
+ NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
+ 59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L
+ k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz
+ V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc
+ KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa
+ huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth
+ LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK
+ lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl
+ cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN
+ e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2
+ 7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH
+ Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAYdJREFUOE+t001L
+ QlEQBuB+TdCmRVEJRRIWtRAUlKsQhFmkpZQtIiWyAlMwP5KkXS0shLqGFkgoFqWQmaRR2qIvU7FMwWhd
+ 8JZXkFx0uVGzOcNh5jkDw6mr+++4SN7B6fbju/uQecYm6a25+/Hdl2IJptWNmmJyL4DwWZwZUJbtayT8
+ RxGqIV8oQaaaRfrxkTmw4z2G+WuKbC6PYDgOkUSJp6ccc+AgdI4luwPbHh/UCxb0S0aZN5fHTmefMTVv
+ wfDEHIiBMegMpt8BZUShNoGQTIKQGxA8TTIHMoUPGF1vEOvTWHTcgqeJQahNwLqVQiRRpIdS+XcM2l4h
+ 1t2DI3WAP7oGoSYE3kwSPQofljcqm/kxjK4SCH0OXSMetItsUC26wZuOVptYhI0eEOuz1YI2gZnKBdpr
+ 6iR9V2jkKOkBQpeiCryhFFr4eioft16iU7qNho4h1Dc00QOqlRuwpSSa+UawuZXdByIZsPoUaOmWwrUf
+ owcOozlwZeto7ZXDuXvCfHV/+dGfqqrf44qgu28AAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAeJJREFUOE+lk9FP
+ klEYxv1TSsecde0f0FpZrTbbal7URVvZuuJCr7pq2WzLNWy0iSHNwtIB9qG0ltLSYRJpBomUgZPMGSyU
+ 8SmJIOiv7zssCdrAzXd77s77e5/nnPdUVR20HBPfUCWNB4QsI176HB8IL/9iX2y1ubTMwx6utz0nuLhc
+ GWIfCxT153Z26ep/g9Md4FJLZ2WIZdQnAM4QSJ/BH5Z5aH6NNCljm0hgdSV4MppAPxQXCq5kil31OTx7
+ DjLbOeSNNJFYUgBKq31glfpmN76F9QLEZHOJc73ubXQjMreln7Q+DdP/du0/QIsxhmNK5mjTMJ/m43mI
+ Qcmr5t5MZVlNpFiKrPM1vIbpVVQAOqSckF+ZekUX5UjTS+ouDFLb+CwPUPNupbN7k7WmEDcMX3hgXSpy
+ IP/OsrCyhXtuA6M0g+bc4wJATqaZ/x7DF4zg8f9g/OMibb355701kERriHL5fojzd2aFjNI0mjPdBUD9
+ 6auUqlU/KwBZJV4skWUuvMmYV8b+Ls6jQQ81DfryO3KtfUoA/p3810G37T3VJ3TlARdvukhldjANeemx
+ z2B8MS0mq80GyySHj98rD2jQOpXbtgrVNprRnO2h5lQX1Sc7leYODh27W3nN9/WZDnroDx0A5wwhdtmt
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlBJREFUOE+1k1lI
+ lGEUhn/owm6KFuqqq4LoJooIqouMwixMM4zEjKyJGJUSlcnSITU1RSe3SdPGyGVQc6tEUSkSIXFo13CM
+ FonUyGmy5p9xz+Lp/z8ZbGjzpgMv5+a8z1n4Pkn6H9HZnEH7zVQayxKYF7+hMg+3ynKO4LBVMWa7xmBf
+ Nme1vuSl67hi0GNMj/sVqBon5XqmnXVMOqoxF+sYH6kgJyWKF13xnD/tT7xmM7bOY4y0riY6bL8nRAWo
+ 5mlnDUUZR+m2ZCO/L2C4T89bywmaSgIJD/WmKnEVT/MkIg/v8wTUVeTMAuQbGBLDSNaFoI8K5lxkEDpt
+ IDEafyJCfciPXiMAIX7enoDqUgNTci1TdhPjQ5nYn0dhrVgu1Fu+jO7iRTwyegmzKp9tGz0BZlMGE/Yy
+ JgbSGH95irFnB5GbF5Nb3kqmqZELl2uJN5iJSS0hPMFIWGyWJ6C0MJXRQSNjfVpGH/vjur+Jj7dXCLM7
+ pme+4XBOMjDsIDgihYDj+jlISW4S8qs0XA99cXWsx9m2ksFySXRWo/RWp5Cppp3efpsw3+2ysidIMwsp
+ zErgc88ZnO3rkFuWYq/3ov+6JMb+OvOdLy6l8wcHvW9sWHre4Rcag69i3rX3AN7bdyDlX4zD/iBCMS/h
+ U8NChioXYC2SiFZ2Vsd2T3BVmaDA3EZTh1VkVVs3rEW6lBwrHoj7yu6sVQ72c+d7ltfCXH+nm5rWJ3MA
+ dY3cpJPKCwtEE7SbgJ1bBFm9trqzu9vvspjgT3FIubZa8C/N67P9regHTvjvLQ3rR38AAAAASUVORK5C
+ YII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAhhJREFUOE+1U09r
+ E0EU70fIR9iPUBQ8eMrR46IN5JhCDz2oBA8SBHEpCMFgG5GiwdJdq2Ijqe6ldo3Wrmhri0gXazW2YbMt
+ UdNmm45ulf7R/HwzU1hLIzn54LFvhvn9eW9nOjr+R0wvBLhTXEf6bgV9w0sYLJQx/uoz2mq9c7eRn2pA
+ L67Bq+/i29YeWLBL9Q6u5ktI6w6Kr1dbE3HwA3sT/o8mbAfQRgE1LZPXtsPgbjZxaXAG4y/Kh0m48sbP
+ JgwbiKYAwwLYNkR4DEje5HsMFSI5l3l2kGD6/RYezzeEMgfzwzzMWSCRlV9OFk0xqhl06wNy+Tchyb2n
+ dXxhv4TVaFLazppAJ9VKL0MySxYoVI0hkXaw5AbovjAWEmTur4qBqZoEdfbKVCgTBObqdolBUW0ocRs1
+ P8Cx2PWQ4PJtl6a9J+xLIB1OMHIilU2b1gSMqCZ9TdTq33FEHQgJcg8rWPF3qHcJVOKeyOyoJIioDqUk
+ UFM2SuUqus4YIcHEzFdYji8GxIGROAc41JJHc6E1B58wRRqWhzFrEVduTR78E5mRBSz7v0l1H0AgXgsH
+ +2DNcPBp3cep0/rhezA5V0Vfbg5ug+4CqaiaI/rmyWu+t1zdQIysDxdmW9/GiZcVnO+fgvHkI+YXV7BG
+ 067VA9Ezt91Fyvq/wH8/lKHCW/RcfITj8Rs4evIaYmdHkBl63v4xtX1tLQ78AZ3a8qxOv4hDAAAAAElF
+ TkSuQmCC
+
+
+
+ 226, 17
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAQ9JREFUOE+t09lq
+ wkAUBmBfyr5DfY32jaReSOmFCyKCgkKLFrVUBZeKiEbshqRuaNw1xiXmLxMJBJ0Zc+GBw9zMfDPnHMZm
+ u1ZE35s4zXCqjmC8Al+sgHLjD9y7yGFWPIbecOO45yORtMAEHnxxJHL1IyKI9JeEXqtMwOl50Q8bSS0l
+ 8PzBBPbqAQQxICrgjeapgKZpkJUdBmNZB+y3d/QSnsIZKrDdqZjMFYj9OR9wB1NngHrQsJC36EkrfIkT
+ PuDyJ84AZbOHNF2j1Z2h9i3xAVKfOUjjZssN2oMFmq0xSkLfOmBu3E97iurnENlKxzpgbpzwO0Kh1kOy
+ KFoDjHmzVuYYjRmTDZfyWh9Yd/4B2Mz2w1z7EGUAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlpJREFUOE+tk21I
+ k1EYhif0oyA0sqIQCix/+GcQFFH9CCmiUBTLLEjShJofVBgL2fxoU9Pp5ubUlS5rU9f8rCyjsA+pUCRC
+ TR1ppmVFUSlmhq78unrnQF1KGHTg/nEOz30993PO+7qJFrmUeiv2n+Mij+XLRLLYULdF2pxlEVIDcw0p
+ AsyxD5fmI/rQ94pqi26eOlsfuZj+7BgSm01QdA4ih7m73Yx9qGpavwatjPebqCzOprPt8YKQgzFagqL0
+ BEjyEFWVaBkdLHMxT34uYNwWR9nVTEoL0zHlp2DMSeaSRk6eKt4VWm5WM/rVPNN5SjDTLQebZEHNA1wr
+ UvHjk3E6tsNcV62e1r3KLGqtKm6WplNpSsVqVFJsOM8VfSKFWjkGtcyZptSYzvC7XByx3zQoqCnTMvlG
+ CX1prnornPUmQJcUXsbSVhGK5bIOkcmQyveeTHiv4VZ5Nk33Nc6iuSO8CIfmECYa/bE/8ON1iRipJNh5
+ F0V6Bd86lfQ1JlFj1TDVq4COKCegLVIwHmGiKRB7/V6G7+5koHozymgfYRy5E1CgTWKgXcZ1i5qWp0KS
+ rjgBcAJawph6FszYk/2M1O1isGYLX8p9ab6wgqP+3rMvYciS01GfzA1LFvQkQ6sQ9/khxhoCGHnox1Dt
+ NvorxXw0b8Km8UQh2cip6GOzgNyMeKqKM7HdjqFZJ5pRk2YJ9aql3EnxoCJxNaZ4Ly6e3UDY3O6OEXRp
+ 59ApTpIhiyDh9GHORAZyPHQPB/ZtZ/cOMVvFPvh6e7F+3SrWrHRnraf7Xz/xf/rJ/kvxb84I3U1y+9/W
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAixJREFUOE+tk91L
+ k3EUx/cvdN9N0EW3NTWGa7EaPOUcyqphWBG9PZEv5dJlmqhYmUYtXyBb4dJJy+kknFT4BqZIjaFMJUsz
+ V7TEoabYRDD49ju/6Pm1Mi+iH5zLz+c855zvo1L9j/fsaRRUvvZltHmX8Ni9gMaGCO47ZlBb8wn22yHc
+ KJ9CackECgteIy93FBfOB6H0JrC3B6ipXsVGb2V1Dca0XhxOe8JLEXhbF7mgsuLLX3mCIwsr2G1+DrVa
+ huWQRwjcj+a5oLTk87qCn/D78CLiTD4UXJ7GAXOTEDjrZ7ngku3dH4Jf4ZHJCLZJXlhzxpGa4hSCurth
+ LsjOGo0R/A4PBsPYrHdDlgMwmRxCUF31kQvkMwFFsB7c4/+ATYkNOHL0BZKSaoXgZuU0urvATgkcP/kK
+ lmMDfNu0MJqZPps6/4D7cNDSCUmyC8HVskl0+MAyADS5vrG7f0X59Tm+VFoYzZyZEVTg5NR2GAwVQnCl
+ cByeZuChc40FJwpjek5MmU/YkH6uiHdOTmHwfg/0+jIhsOWNMRiouhPlnUnAQoI4rYSht7MYm5qDnHsN
+ e41tHNbucUGnKxICiqXjHpTPJgHBZ/Nv4U1oHqGZJVwstiNe72JwI+J3PYA2MV8IMjOG2dzLfOatBg+2
+ 7JDQ0tEPX9cguvv8GHg5hH0mC9S6eiQweLumDhqNVQgo06dP9fN4UsIoJHRnOhVtmxZGM1NXKoJ3JmTH
+ Cv71r/4OTrQ4xWMwWlcAAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAi1JREFUOE+1k/9P
+ UlEYxv2nWK2tVlttGmpltrCcEQ1XUjSMaUHJNLIpNcnCragplBvUoC/okJhZLG92ySUpU8RNICdIhAio
+ EF+e7r1UZMDW1jrb+8t7z/N83vucc8rK/sdyeYIwvpopWYbRaZTk0uIx0o0/V/JbGt7lVTwxT6CKKylt
+ oLd8xGYihS/hKGz2WaaeWUnoTATsMz7UCztx9Ex7cYN3jkUQU4tb4DR5LZaAcyEAg4VE5YlLMFmJQoNQ
+ JA61gUA6k4XPH9pCN9s+gZz2oq5Jjlq+DDfUz3Fba86bOGY9jHiUdDF0mvqT7A/F4fKEcE9nZf5d1jOI
+ B4ZxVJ2U5gyc8z70akegMX3AXb0ND1+8R6/GgvZbeog61OA2K3CA2lxR34JjZ69B2T8EsVyN/Q0XcwY3
+ B14iGk8UpE43UukMNqhA6QyC4Q0srcQg7dagsbWHmuDHScj7jDC9nsJTqx0a4xjuaIfRqXoMSXc/hG0q
+ 8C4owGnqwEGeFOXHxThH9eoEV7G7VpiboE2pK0qnm9H1JLz+NUzOBfHWEcAQsQSuqAuVDa1gVZzKGUgU
+ jwoMqAzxNZbC3Od1jDvDYPdth+7NCpP8Yf4V7KoR5A1arg8gmQIoGMLxLJYjWSwEMphwb2J4MoZB2yqU
+ LBZUIxHGYB9HlBfTE4jl9+GmBPTHv6lfo//+GGoaZajmXQabumXl1HHt5TRjz5Hz2HlIgB3Vp7GNzWeo
+ RcX/+pq/AwHYL0leVl8fAAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAY5JREFUOE+d081L
+ AkEUAPD1T+hYhzoERV77OHUo8JBBt+4RRkSQ4U0SunaJOkSRKQWZWCiF5kdroa0WRAoRFXXoEEkWCUFY
+ Wbvrvnqz7NK6OxANPIZh5v1m3uyOKZK5AaamiaLICILACDzPtDXXM+3mRlPtGnWMAK15g4fQabVBYDej
+ 20QFdtJXVGBxg4Xk8aWMRDhjJLh/TgUW1hPQ1T+ihmEZgXieCghiFRBRIEPAFzkxBO4fSsByOfBsRkkE
+ 4xkoFEv6Mla3szoAF2Jy+E2A0KMc/nyRINe3BS2yspXSAf4YR5Kfq/LUE1QJopxEU8qSP6kD5nwxFUAE
+ A0E8hdM1rz0BXtDvhheHwMEnwKkkJ2OPAJMuw+TUDB2QJAneKzxgCRNnHwTBUJJd3ijYx8fowBcvwstr
+ BXIXdxBOZAmCu2JgssMxBGvOOmNA+d5KP+sJw17qiJRjn3bDwOAocF4LQMWtRTABf9W/hLWjFcpsA0Fc
+ tm76+6C+vJ+J4b4WgmAp/0bMTXVg6ekFNrQM3y3xMcC3lb+tAAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAYdJREFUOE+t001L
+ QlEQBuB+TdCmRVEJRRIWtRAUlKsQhFmkpZQtIiWyAlMwP5KkXS0shLqGFkgoFqWQmaRR2qIvU7FMwWhd
+ 8JZXkFx0uVGzOcNh5jkDw6mr+++4SN7B6fbju/uQecYm6a25+/Hdl2IJptWNmmJyL4DwWZwZUJbtayT8
+ RxGqIV8oQaaaRfrxkTmw4z2G+WuKbC6PYDgOkUSJp6ccc+AgdI4luwPbHh/UCxb0S0aZN5fHTmefMTVv
+ wfDEHIiBMegMpt8BZUShNoGQTIKQGxA8TTIHMoUPGF1vEOvTWHTcgqeJQahNwLqVQiRRpIdS+XcM2l4h
+ 1t2DI3WAP7oGoSYE3kwSPQofljcqm/kxjK4SCH0OXSMetItsUC26wZuOVptYhI0eEOuz1YI2gZnKBdpr
+ 6iR9V2jkKOkBQpeiCryhFFr4eioft16iU7qNho4h1Dc00QOqlRuwpSSa+UawuZXdByIZsPoUaOmWwrUf
+ owcOozlwZeto7ZXDuXvCfHV/+dGfqqrf44qgu28AAAAASUVORK5CYII=
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAeJJREFUOE+lk9FP
+ klEYxv1TSsecde0f0FpZrTbbal7URVvZuuJCr7pq2WzLNWy0iSHNwtIB9qG0ltLSYRJpBomUgZPMGSyU
+ 8SmJIOiv7zssCdrAzXd77s77e5/nnPdUVR20HBPfUCWNB4QsI176HB8IL/9iX2y1ubTMwx6utz0nuLhc
+ GWIfCxT153Z26ep/g9Md4FJLZ2WIZdQnAM4QSJ/BH5Z5aH6NNCljm0hgdSV4MppAPxQXCq5kil31OTx7
+ DjLbOeSNNJFYUgBKq31glfpmN76F9QLEZHOJc73ubXQjMreln7Q+DdP/du0/QIsxhmNK5mjTMJ/m43mI
+ Qcmr5t5MZVlNpFiKrPM1vIbpVVQAOqSckF+ZekUX5UjTS+ouDFLb+CwPUPNupbN7k7WmEDcMX3hgXSpy
+ IP/OsrCyhXtuA6M0g+bc4wJATqaZ/x7DF4zg8f9g/OMibb355701kERriHL5fojzd2aFjNI0mjPdBUD9
+ 6auUqlU/KwBZJV4skWUuvMmYV8b+Ls6jQQ81DfryO3KtfUoA/p3810G37T3VJ3TlARdvukhldjANeemx
+ z2B8MS0mq80GyySHj98rD2jQOpXbtgrVNprRnO2h5lQX1Sc7leYODh27W3nN9/WZDnroDx0A5wwhdtmt
+ AAAAAElFTkSuQmCC
+
+
+
+
+ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
+ YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAlBJREFUOE+1k1lI
+ lGEUhn/owm6KFuqqq4LoJooIqouMwixMM4zEjKyJGJUSlcnSITU1RSe3SdPGyGVQc6tEUSkSIXFo13CM
+ FonUyGmy5p9xz+Lp/z8ZbGjzpgMv5+a8z1n4Pkn6H9HZnEH7zVQayxKYF7+hMg+3ynKO4LBVMWa7xmBf
+ Nme1vuSl67hi0GNMj/sVqBon5XqmnXVMOqoxF+sYH6kgJyWKF13xnD/tT7xmM7bOY4y0riY6bL8nRAWo
+ 5mlnDUUZR+m2ZCO/L2C4T89bywmaSgIJD/WmKnEVT/MkIg/v8wTUVeTMAuQbGBLDSNaFoI8K5lxkEDpt
+ IDEafyJCfciPXiMAIX7enoDqUgNTci1TdhPjQ5nYn0dhrVgu1Fu+jO7iRTwyegmzKp9tGz0BZlMGE/Yy
+ JgbSGH95irFnB5GbF5Nb3kqmqZELl2uJN5iJSS0hPMFIWGyWJ6C0MJXRQSNjfVpGH/vjur+Jj7dXCLM7
+ pme+4XBOMjDsIDgihYDj+jlISW4S8qs0XA99cXWsx9m2ksFySXRWo/RWp5Cppp3efpsw3+2ysidIMwsp
+ zErgc88ZnO3rkFuWYq/3ov+6JMb+OvOdLy6l8wcHvW9sWHre4Rcag69i3rX3AN7bdyDlX4zD/iBCMS/h
+ U8NChioXYC2SiFZ2Vsd2T3BVmaDA3EZTh1VkVVs3rEW6lBwrHoj7yu6sVQ72c+d7ltfCXH+nm5rWJ3MA
+ dY3cpJPKCwtEE7SbgJ1bBFm9trqzu9vvspjgT3FIubZa8C/N67P9regHTvjvLQ3rR38AAAAASUVORK5C
+ YII=
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/ModuleFilter.cs b/reactos/tools/sysgen/RosBuilder/ModuleFilter.cs
new file mode 100644
index 00000000000..0853aeec8a1
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/ModuleFilter.cs
@@ -0,0 +1,295 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class ModuleFilterController
+ {
+ private List m_ModuleFilters = new List();
+ private ISysGenDesigner m_SysGenDesigner = null;
+
+ public ModuleFilterController(ISysGenDesigner engine)
+ {
+ //The engine...
+ m_SysGenDesigner = engine;
+
+ RegisterDinamicFilters();
+ RegisterModuleGroups();
+ InitializeFilters();
+ }
+
+ private void RegisterDinamicFilters()
+ {
+ m_ModuleFilters.Add(new AllModuleFilter());
+ m_ModuleFilters.Add(new AllWin32CUIModuleFilter());
+ m_ModuleFilters.Add(new AllWin32GUIModuleFilter());
+ m_ModuleFilters.Add(new AllScreenSaversModuleFilter());
+ m_ModuleFilters.Add(new AllKeyboardLayoutsModuleFilter());
+ m_ModuleFilters.Add(new AllDriversModuleFilter());
+ m_ModuleFilters.Add(new AllDllsModuleFilter());
+ }
+
+ private void RegisterModuleGroups()
+ {
+ foreach (RBuildModule module in m_SysGenDesigner.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.ModuleGroup)
+ {
+ m_ModuleFilters.Add(new PackageModuleFilter(module));
+ }
+ }
+ }
+
+ private void InitializeFilters()
+ {
+ foreach (ModuleFilter filter in m_ModuleFilters)
+ {
+ filter.Designer = m_SysGenDesigner;
+ filter.Initialize();
+ }
+ }
+
+ public List ModuleFilters
+ {
+ get { return m_ModuleFilters; }
+ }
+
+ public void Apply(ModuleFilter filter)
+ {
+ m_SysGenDesigner.ProjectController.Add(filter.Modules);
+ }
+
+ public void Remove(ModuleFilter filter)
+ {
+ //m_SysGenDesigner.PlatformController.Remove(filter.Modules);
+ }
+ }
+
+ public abstract class ModuleFilter
+ {
+ protected ISysGenDesigner m_Project = null;
+ protected RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+
+ public ModuleFilter()
+ {
+ }
+
+ public virtual void Initialize()
+ {
+ ExecuteRule();
+ }
+
+ public abstract void ExecuteRule();
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public ISysGenDesigner Designer
+ {
+ get { return m_Project; }
+ set { m_Project = value; }
+ }
+
+ public abstract string Name { get; }
+
+ public override string ToString()
+ {
+ return string.Format("{0} - ({1} modules)",
+ Name,
+ Modules.Count);
+ }
+ }
+
+ public class PackageModuleFilter : ModuleFilter
+ {
+ RBuildModule m_Module = null;
+
+ public PackageModuleFilter(RBuildModule module)
+ {
+ //Save the underlaying module...
+ m_Module = module;
+ }
+
+ public override string Name
+ {
+ get { return (m_Module.Description != null) ? m_Module.Description : m_Module.Name; }
+ }
+
+ public override void ExecuteRule()
+ {
+ Modules.Add(m_Module.Needs);
+ }
+ }
+
+ public class AllModuleFilter : ModuleFilter
+ {
+ public AllModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+
+ public class AllWin32CUIModuleFilter : ModuleFilter
+ {
+ public AllWin32CUIModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Console Applications"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32CUI)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllWin32GUIModuleFilter : ModuleFilter
+ {
+ public AllWin32GUIModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Graphical Applications"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32GUI)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllScreenSaversModuleFilter : ModuleFilter
+ {
+ public AllScreenSaversModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All ScreenSavers"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32SCR)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllKeyboardLayoutsModuleFilter : ModuleFilter
+ {
+ public AllKeyboardLayoutsModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Keyboard Layouts"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllDriversModuleFilter : ModuleFilter
+ {
+ public AllDriversModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Drivers"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.KernelModeDriver)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+
+ public class AllDllsModuleFilter : ModuleFilter
+ {
+ public AllDllsModuleFilter()
+ {
+ }
+
+ public override string Name
+ {
+ get { return "All Dlls"; }
+ }
+
+ public override void ExecuteRule()
+ {
+ foreach (RBuildModule module in Designer.ProjectController.AvailableModules)
+ {
+ if (module.Type == ModuleType.Win32DLL)
+ {
+ if (Modules.Contains(module) == false)
+ Modules.Add(module);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/NewItemForm.Designer.cs b/reactos/tools/sysgen/RosBuilder/NewItemForm.Designer.cs
new file mode 100644
index 00000000000..81bcb58e30d
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/NewItemForm.Designer.cs
@@ -0,0 +1,135 @@
+namespace TriStateTreeViewDemo
+{
+ partial class NewItemForm
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.lbItems = new System.Windows.Forms.Label();
+ this.lvAddItem = new System.Windows.Forms.ListView();
+ this.btnAdd = new System.Windows.Forms.Button();
+ this.btnCancel = new System.Windows.Forms.Button();
+ this.lbDescription = new System.Windows.Forms.Label();
+ this.lbName = new System.Windows.Forms.Label();
+ this.textBox1 = new System.Windows.Forms.TextBox();
+ this.SuspendLayout();
+ //
+ // lbItems
+ //
+ this.lbItems.AutoSize = true;
+ this.lbItems.Location = new System.Drawing.Point(12, 24);
+ this.lbItems.Name = "lbItems";
+ this.lbItems.Size = new System.Drawing.Size(78, 13);
+ this.lbItems.TabIndex = 0;
+ this.lbItems.Text = "Available Items";
+ //
+ // lvAddItem
+ //
+ this.lvAddItem.Location = new System.Drawing.Point(12, 40);
+ this.lvAddItem.Name = "lvAddItem";
+ this.lvAddItem.Size = new System.Drawing.Size(583, 236);
+ this.lvAddItem.TabIndex = 1;
+ this.lvAddItem.UseCompatibleStateImageBehavior = false;
+ this.lvAddItem.View = System.Windows.Forms.View.List;
+ this.lvAddItem.DoubleClick += new System.EventHandler(this.lvAddItem_DoubleClick);
+ //
+ // btnAdd
+ //
+ this.btnAdd.DialogResult = System.Windows.Forms.DialogResult.OK;
+ this.btnAdd.Location = new System.Drawing.Point(439, 348);
+ this.btnAdd.Name = "btnAdd";
+ this.btnAdd.Size = new System.Drawing.Size(75, 23);
+ this.btnAdd.TabIndex = 2;
+ this.btnAdd.Text = "Add";
+ this.btnAdd.UseVisualStyleBackColor = true;
+ //
+ // btnCancel
+ //
+ this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.btnCancel.Location = new System.Drawing.Point(520, 348);
+ this.btnCancel.Name = "btnCancel";
+ this.btnCancel.Size = new System.Drawing.Size(75, 23);
+ this.btnCancel.TabIndex = 3;
+ this.btnCancel.Text = "Cancel";
+ this.btnCancel.UseVisualStyleBackColor = true;
+ //
+ // lbDescription
+ //
+ this.lbDescription.AutoSize = true;
+ this.lbDescription.Location = new System.Drawing.Point(12, 279);
+ this.lbDescription.Name = "lbDescription";
+ this.lbDescription.Size = new System.Drawing.Size(79, 13);
+ this.lbDescription.TabIndex = 4;
+ this.lbDescription.Text = "Select any item";
+ //
+ // lbName
+ //
+ this.lbName.AutoSize = true;
+ this.lbName.Location = new System.Drawing.Point(9, 308);
+ this.lbName.Name = "lbName";
+ this.lbName.Size = new System.Drawing.Size(35, 13);
+ this.lbName.TabIndex = 5;
+ this.lbName.Text = "&Name";
+ //
+ // textBox1
+ //
+ this.textBox1.Location = new System.Drawing.Point(53, 305);
+ this.textBox1.Name = "textBox1";
+ this.textBox1.Size = new System.Drawing.Size(542, 20);
+ this.textBox1.TabIndex = 6;
+ //
+ // NewItemForm
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(607, 383);
+ this.Controls.Add(this.textBox1);
+ this.Controls.Add(this.lbName);
+ this.Controls.Add(this.lbDescription);
+ this.Controls.Add(this.btnCancel);
+ this.Controls.Add(this.btnAdd);
+ this.Controls.Add(this.lvAddItem);
+ this.Controls.Add(this.lbItems);
+ this.MaximizeBox = false;
+ this.MinimizeBox = false;
+ this.Name = "NewItemForm";
+ this.Text = "Add Item";
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.Label lbItems;
+ private System.Windows.Forms.ListView lvAddItem;
+ private System.Windows.Forms.Button btnAdd;
+ private System.Windows.Forms.Button btnCancel;
+ private System.Windows.Forms.Label lbDescription;
+ private System.Windows.Forms.Label lbName;
+ private System.Windows.Forms.TextBox textBox1;
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/NewItemForm.cs b/reactos/tools/sysgen/RosBuilder/NewItemForm.cs
new file mode 100644
index 00000000000..4101b0c988c
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/NewItemForm.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Data;
+using System.Drawing;
+using System.Text;
+using System.Windows.Forms;
+
+namespace TriStateTreeViewDemo
+{
+ public partial class NewItemForm : Form
+ {
+ public NewItemForm()
+ {
+ InitializeComponent();
+ }
+
+ public ListView ListView
+ {
+ get { return lvAddItem; }
+ }
+
+ private void lvAddItem_DoubleClick(object sender, EventArgs e)
+ {
+ DialogResult = DialogResult.OK;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/NewItemForm.resx b/reactos/tools/sysgen/RosBuilder/NewItemForm.resx
new file mode 100644
index 00000000000..19dc0dd8b39
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/NewItemForm.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/PlatformCatalogReader.cs b/reactos/tools/sysgen/RosBuilder/PlatformCatalogReader.cs
new file mode 100644
index 00000000000..7a847340622
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/PlatformCatalogReader.cs
@@ -0,0 +1,206 @@
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.Text;
+using System.Xml;
+using System.Collections.Generic;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.Framework.Catalog
+{
+ public class PlatformCatalogReader
+ {
+ XmlDocument doc = new XmlDocument();
+
+ RBuildProject m_Project = new RBuildProject();
+
+ public PlatformCatalogReader(string filename)
+ {
+ doc.Load(filename);
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ }
+
+ public void Read()
+ {
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/modules").ChildNodes)
+ {
+ RBuildModule module = new RBuildModule();
+
+ module.Type = (ModuleType)Enum.Parse(typeof(ModuleType), node.Attributes["type"].Value.ToString());
+ module.Name = node.Attributes["name"].Value.ToString();
+ module.Folder.Base = node.Attributes["base"].Value.ToString();
+ module.CatalogPath = node.Attributes["path"].Value.ToString();
+ module.Description = node.Attributes["desc"].Value.ToString();
+
+ m_Project.Modules.Add(module);
+ }
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/modules").ChildNodes)
+ {
+ RBuildModule module = m_Project.Modules.GetByName(node.Attributes["name"].Value.ToString());
+
+ foreach (XmlNode snode in node.SelectSingleNode("libraries").ChildNodes)
+ {
+ module.Libraries.Add(m_Project.Modules.GetByName(snode.InnerText));
+ }
+
+ foreach (XmlNode snode in node.SelectSingleNode("dependencies").ChildNodes)
+ {
+ module.Dependencies.Add(m_Project.Modules.GetByName(snode.InnerText));
+ }
+
+ foreach (XmlNode snode in node.SelectSingleNode("requeriments").ChildNodes)
+ {
+ module.Requeriments.Add(m_Project.Modules.GetByName(snode.InnerText));
+ }
+ }
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/languages").ChildNodes)
+ {
+ RBuildLanguage language = new RBuildLanguage();
+
+ language.Name = node.Attributes["name"].Value.ToString();
+
+ m_Project.Languages.Add(language);
+ }
+
+ foreach (XmlNode node in doc.SelectSingleNode("/catalog/debugchannels").ChildNodes)
+ {
+ RBuildDebugChannel language = new RBuildDebugChannel();
+
+ language.Name = node.Attributes["name"].Value.ToString();
+
+ m_Project.DebugChannels.Add(language);
+ }
+
+ /*
+ RBuildModuleInfoCollection modules = new RBuildModuleInfoCollection();
+
+
+ WhitespaceHandling = WhitespaceHandling.None;
+
+ ReadStartElement("modules");
+ while (Name == "module")
+ {
+ RBuildModuleInfo module = new RBuildModuleInfo();
+
+ MoveToFirstAttribute();
+ do
+ {
+ switch (Name)
+ {
+ case "name":
+ module.Name = Value;
+ break;
+ case "type":
+ module.Type = (ModuleType)Enum.Parse(typeof(ModuleType), Value);
+ break;
+ case "base":
+ module.Base = Value;
+ break;
+ case "desc":
+ module.CatalogPath = Value;
+ break;
+ case "path":
+ module.CatalogPath = Value;
+ break;
+ }
+
+ }
+ while (MoveToNextAttribute());
+
+ MoveToElement();
+
+ //Read();
+ //Read();
+
+ if (Name == "libraries")
+ {
+ if (!IsEmptyElement)
+ {
+ ReadStartElement("libraries");
+ while (Name == "library")
+ {
+ ReadStartElement("library");
+ module.Libraries.Add(ReadContentAsString());
+ ReadEndElement();
+ }
+ ReadEndElement();
+ }
+ else
+ ReadStartElement("libraries");
+ }
+
+ if (Name == "dependencies")
+ {
+ if (!IsEmptyElement)
+ {
+ ReadStartElement("dependencies");
+ while (Name == "dependency")
+ {
+ ReadStartElement("dependency");
+ module.Dependencies.Add(ReadContentAsString());
+ ReadEndElement();
+ }
+ ReadEndElement();
+ }
+ else
+ ReadStartElement("dependencies");
+ }
+
+ if (Name == "requeriments")
+ {
+ if (!IsEmptyElement)
+ {
+ ReadStartElement("requeriments");
+ while (Name == "requires")
+ {
+ ReadStartElement("requires");
+ module.Requirements.Add(ReadContentAsString());
+ ReadEndElement();
+ }
+ ReadEndElement();
+ }
+ else
+ ReadStartElement("requeriments");
+ }
+
+ modules.Add(module);
+
+ Read();
+ }
+
+ ReadEndElement();
+
+ foreach (RBuildModuleInfo moduleInfo in modules)
+ {
+ RBuildModule module = new RBuildModule();
+
+ module.Type = moduleInfo.Type;
+ module.Name = moduleInfo.Name;
+
+ m_Modules.Add(module);
+ }
+
+ foreach (RBuildModuleInfo moduleInfo in modules)
+ {
+ RBuildModule module = m_Modules.GetByName(moduleInfo.Name);
+
+ foreach (string library in moduleInfo.Libraries)
+ module.Libraries.Add(m_Modules.GetByName(library));
+
+ foreach (string library in moduleInfo.Dependencies)
+ module.Dependencies.Add(m_Modules.GetByName(library));
+
+ foreach (string library in moduleInfo.Requirements)
+ module.Requeriments.Add(m_Modules.GetByName(library));
+ }*/
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/PlatformController.cs b/reactos/tools/sysgen/RosBuilder/PlatformController.cs
new file mode 100644
index 00000000000..1d710cb372f
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/PlatformController.cs
@@ -0,0 +1,86 @@
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+
+namespace TriStateTreeViewDemo
+{
+ public class PlatformController
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+
+ public PlatformController(ISysGenDesigner engine)
+ {
+ m_SysGenDesigner = engine;
+ }
+
+ public ProjectTask ProjectTask
+ {
+ get { return m_SysGenDesigner.SysGenEngine.ProjectTask; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_SysGenDesigner.SysGenEngine.Project; }
+ }
+
+ public void Remove(RBuildModule module)
+ {
+ }
+
+ public void Add(RBuildModule module)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(module , Project.Platform.Modules);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.Dependencies);
+ }
+ }
+
+ public void Add(RBuildModuleCollection modules)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(modules, Project.Platform.Modules);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.Dependencies);
+ }
+ }
+
+ public bool AskAddModulesToPlatform(RBuildModuleCollection missingDependencies)
+ {
+ if (missingDependencies.Count > 0)
+ {
+ StringBuilder str = new StringBuilder();
+
+ str.AppendFormat("This action requieres adding {0} dependecies no present in your platform :", missingDependencies.Count);
+ str.AppendLine();
+ str.AppendLine();
+
+ foreach (RBuildModule dependency in missingDependencies)
+ {
+ str.AppendFormat("{0} on '{1}' \n",
+ dependency.Name,
+ dependency.Base);
+ }
+
+ str.AppendLine();
+ str.AppendLine("¿Do you want to add this dependencies?");
+
+ if (MessageBox.Show(str.ToString(), "RosBuilder", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
+ {
+ return true;
+ }
+ }
+ else
+ return true;
+
+ return false;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Program.cs b/reactos/tools/sysgen/RosBuilder/Program.cs
new file mode 100644
index 00000000000..6d9cbcb5b1f
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Program.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Reflection;
+using System.Collections.Generic;
+using System.Windows.Forms;
+
+using TriStateTreeViewDemo;
+
+namespace TriStateTreeViewDemo
+{
+ static class Program
+ {
+ ///
+ /// The main entry point for the application.
+ ///
+ [STAThread]
+ static void Main(string[] args)
+ {
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+
+ MainForm mainForm = new MainForm();
+
+ if (args.Length == 0)
+ {
+ //Create file associations from .dnml files to the script engine
+ CreateFileAssociation();
+ }
+ else if (args[0].ToLower() == "remove")
+ {
+ //Remove file associations for .dnml files to the script engine
+ RemoveFileAssociation();
+ }
+ else
+ {
+ mainForm.ProjectController.Open(args[0]);
+
+ if (args.Length > 1)
+ {
+ if (args[1].ToLower() == "x86")
+ {
+ MessageBox.Show("86");
+ }
+ else if (args[1].ToLower() == "ppc")
+ {
+ MessageBox.Show("ppc");
+ }
+ else if (args[1].ToLower() == "arm")
+ {
+ MessageBox.Show("arm");
+ }
+ else
+ {
+ MessageBox.Show("Unknown Architecture");
+ }
+
+ if (args.Length > 2)
+ {
+ if (args[2].ToLower() == "debug")
+ {
+ mainForm.ProjectController.SysGenProject.Debug = true;
+ }
+ else if (args[2].ToLower() == "release")
+ {
+ mainForm.ProjectController.SysGenProject.Debug = false;
+ }
+ else
+ {
+ MessageBox.Show("Unknown Target Mode");
+ }
+ }
+ }
+ }
+
+ //Run the application
+ Application.Run(mainForm);
+ }
+
+ internal static void CreateFileAssociation()
+ {
+ FileAssociation FA = new FileAssociation();
+ FA.Extension = "sgpd";
+ FA.ContentType = "application/sysgenproject";
+ FA.FullName = "SysGenProject";
+ FA.ProperName = "SysGenProject";
+ FA.AddCommand("open", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\"");
+ FA.AddCommand("edit", "notepad.exe %1");
+ FA.AddCommand("Generate x86", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\" X86 RELEASE");
+ FA.AddCommand("Generate x86 [DEBUG]", "\"" + Assembly.GetExecutingAssembly().Location + "\" \" %1\" X86 DEBUG");
+ FA.IconPath = Assembly.GetExecutingAssembly().Location;
+ FA.IconIndex = 0;
+ FA.Create();
+ }
+
+ internal static void RemoveFileAssociation()
+ {
+ FileAssociation FA = new FileAssociation();
+ FA.Extension = "sgpd";
+ FA.ContentType = "application/sysgenproject";
+ FA.FullName = "SysGenProject";
+ FA.ProperName = "SysGenProject";
+ FA.AddCommand("open", Assembly.GetExecutingAssembly().Location + " %1");
+ FA.AddCommand("edit", "notepad.exe %1");
+ FA.AddCommand("edit123", "notepad.exe %1");
+ FA.IconPath = Assembly.GetExecutingAssembly().Location;
+ FA.IconIndex = 0;
+ FA.Remove();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Project/Project.cs b/reactos/tools/sysgen/RosBuilder/Project/Project.cs
new file mode 100644
index 00000000000..f024dc385a5
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Project/Project.cs
@@ -0,0 +1,267 @@
+using System;
+using System.Collections.Specialized;
+using System.Collections.Generic;
+using System.Xml;
+using System.Collections;
+using System.IO;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public enum TargetArchitectureType
+ {
+ X86,
+ X86_i486,
+ X86_i586,
+ X86_Pentium,
+ X86_Pentium2,
+ X86_Pentium3,
+ X86_Pentium4,
+ X86_AthlonXP,
+ X86_AthlonMP,
+ X86_Xbox,
+ PPC,
+ ARM
+ }
+
+ public enum OptimizeLevelType : int
+ {
+ Level_0 = 0,
+ Level_1 = 1,
+ Level_2 = 2,
+ Level_3 = 3,
+ Level_4 = 4,
+ Level_5 = 5
+ }
+
+ public class Project : RBuildPlatform
+ {
+ RBuildProject m_Project = null;
+
+ string m_FilePath; // full path to this project, including filename
+ string m_FileName = "Unnamed";
+
+ //MovieOptions movieOptions;
+ //CompilerOptions compilerOptions;
+ //PathCollection classpaths;
+ //PathCollection compileTargets;
+ //HiddenPathCollection hiddenPaths;
+ //AssetCollection libraryAssets;
+ bool traceEnabled; // selected configuration
+
+ public bool NoOutput; // Disable file building
+ public string InputPath; // For code injection
+ public string OutputPath;
+ public string PreBuildEvent;
+ public string PostBuildEvent;
+ public string TestMovieCommand;
+ public bool AlwaysRunPostBuild;
+ public bool ShowHiddenPaths;
+
+ public string Source;
+
+ public Project(RBuildProject project,string path)
+ {
+ m_FilePath = path;
+ m_FileName = Path.GetFileName(path);
+ m_Project = project;
+ m_Project.Platform = this;
+ }
+
+ public Project(RBuildProject project)
+ {
+ m_Project = project;
+ m_Project.Platform = this;
+ }
+
+ public RBuildProject RBuildProject
+ {
+ get { return m_Project; }
+ }
+
+ public virtual bool UsesInjection { get { return false; } }
+ public virtual bool HasLibraries { get { return false; } }
+ public virtual void ValidateBuild(out string error) { error = null; }
+
+ #region Simple Properties
+
+ public string ProjectPath { get { return m_FilePath; } set { m_FilePath = value; } }
+ //public string Name { get { return Path.GetFileNameWithoutExtension(path).Replace(' ', '-'); } }
+ public string Directory { get { return Path.GetDirectoryName(m_FilePath); } }
+ public Boolean TraceEnabled { set { traceEnabled = value; } get { return traceEnabled; } }
+
+ public string FileName
+ {
+ get { return m_FileName; }
+ }
+
+ //// we only provide getters for these to preserve the original pointer
+ //public MovieOptions MovieOptions { get { return movieOptions; } }
+ //public PathCollection Classpaths { get { return classpaths; } }
+ //public PathCollection CompileTargets { get { return compileTargets; } }
+ //public HiddenPathCollection HiddenPaths { get { return hiddenPaths; } }
+ //public AssetCollection LibraryAssets { get { return libraryAssets; } }
+
+ //public CompilerOptions CompilerOptions
+ //{
+ // get { return compilerOptions; }
+ // set { compilerOptions = value; }
+ //}
+
+ //public PathCollection AbsoluteClasspaths
+ //{
+ // get
+ // {
+ // PathCollection absolute = new PathCollection();
+ // foreach (string cp in classpaths)
+ // absolute.Add(GetAbsolutePath(cp));
+ // return absolute;
+ // }
+ //}
+
+ //public string OutputPathAbsolute { get { return GetAbsolutePath(OutputPath); } }
+
+ public bool CanBuild
+ {
+ get { return OutputPath != null && OutputPath.Length > 0; }
+ }
+
+ #endregion
+
+ #region Methods
+
+ // all the Set/Is methods expect absolute paths (as opposed to the way they're
+ // actually stored)
+
+ //public void SetPathHidden(string path, bool isHidden)
+ //{
+ // path = GetRelativePath(path);
+
+ // if (isHidden)
+ // {
+ // hiddenPaths.Add(path);
+ // compileTargets.RemoveAtOrBelow(path); // can't compile hidden files
+ // libraryAssets.RemoveAtOrBelow(path); // can't embed hidden resources
+ // }
+ // else hiddenPaths.Remove(path);
+ //}
+
+ //public bool IsPathHidden(string path)
+ //{
+ // return hiddenPaths.IsHidden(GetRelativePath(path));
+ //}
+
+ public void SetCompileTarget(string path, bool isCompileTarget)
+ {
+ //if (isCompileTarget)
+ // compileTargets.Add(GetRelativePath(path));
+ //else
+ // compileTargets.Remove(GetRelativePath(path));
+ }
+
+ //public bool IsCompileTarget(string path) { return compileTargets.Contains(GetRelativePath(path)); }
+
+ public void SetLibraryAsset(string path, bool isLibraryAsset)
+ {
+ //if (isLibraryAsset)
+ // libraryAssets.Add(GetRelativePath(path));
+ //else
+ // libraryAssets.Remove(GetRelativePath(path));
+ }
+
+ //public bool IsLibraryAsset(string path) { return libraryAssets.Contains(GetRelativePath(path)); }
+// public LibraryAsset GetAsset(string path) { return libraryAssets[GetRelativePath(path)]; }
+
+ public void ChangeAssetPath(string fromPath, string toPath)
+ {
+ //if (IsLibraryAsset(fromPath))
+ //{
+ // //LibraryAsset asset = libraryAssets[GetRelativePath(fromPath)];
+ // //libraryAssets.Remove(asset);
+ // //asset.Path = GetRelativePath(toPath);
+ // //libraryAssets.Add(asset);
+ //}
+ }
+
+ //public bool IsInput(string path) { return GetRelativePath(path) == InputPath; }
+ //public bool IsOutput(string path) { return GetRelativePath(path) == OutputPath; }
+
+ ///
+ /// Call this when you delete a path so we can remove all our references to it
+ ///
+ public void NotifyPathsDeleted(string path)
+ {
+ //path = GetRelativePath(path);
+ //hiddenPaths.Remove(path);
+ //compileTargets.RemoveAtOrBelow(path);
+ //libraryAssets.RemoveAtOrBelow(path);
+ }
+
+ ///
+ /// Returns the path to the "obj\" subdirectory, creating it if necessary.
+ ///
+ public string GetObjDirectory()
+ {
+ string objPath = Path.Combine(this.Directory, "obj");
+ if (!System.IO.Directory.Exists(objPath))
+ System.IO.Directory.CreateDirectory(objPath);
+ return objPath;
+ }
+
+ #endregion
+
+ #region Relative Path Helpers
+
+ //public string GetRelativePath(string path)
+ //{
+ // return ProjectPaths.GetRelativePath(this.Directory,path);
+ //}
+
+ //public string GetAbsolutePath(string path)
+ //{
+ // return ProjectPaths.GetAbsolutePath(this.Directory,path);
+ //}
+
+ #endregion
+
+ public Project Load()
+ {
+ ProjectReader reader = new ProjectReader(this, ProjectPath);
+
+ try
+ {
+ return reader.ReadProject();
+ }
+ catch (XmlException exception)
+ {
+ string format = string.Format("Error in Project '{0}' line {1}, position {2}.",
+ ProjectPath,
+ exception.LineNumber,
+ exception.LinePosition);
+
+ throw new Exception(format, exception);
+ }
+ finally
+ {
+ reader.Close();
+ }
+ }
+
+ public void Save()
+ {
+ ProjectWriter writer = new ProjectWriter(this, ProjectPath);
+
+ try
+ {
+ writer.WriteProject();
+ writer.Flush();
+ }
+ finally
+ {
+ writer.Close();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Project/ProjectReader.cs b/reactos/tools/sysgen/RosBuilder/Project/ProjectReader.cs
new file mode 100644
index 00000000000..4fec3546bc6
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Project/ProjectReader.cs
@@ -0,0 +1,319 @@
+using System;
+using System.Windows.Forms;
+using System.Collections;
+using System.Diagnostics;
+using System.Text;
+using System.Xml;
+using System.Collections.Generic;
+
+using SysGen.RBuild.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectReader : XmlTextReader
+ {
+ Project project;
+
+ public ProjectReader(Project project, string filename)
+ : base(filename)
+ {
+ this.project = project;
+ WhitespaceHandling = WhitespaceHandling.None;
+ }
+
+ protected Project Project { get { return project; } }
+
+ public virtual Project ReadProject()
+ {
+ MoveToContent();
+
+ while (Read())
+ ProcessNode(Name);
+
+ return project;
+ }
+
+ private void ReadModules()
+ {
+ RBuildModule module = null;
+
+ ReadStartElement("modules");
+ while (Name == "module")
+ {
+ try
+ {
+ module = project.RBuildProject.Modules.GetByName(GetAttribute("name"));
+
+ if (module == null)
+ throw new Exception("Unkown module '" + Value + "'");
+
+ project.Modules.Add(module);
+
+ //project.SysGenDesinger.PlatformController.Project.Platform.Modules.Add(module);
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(
+ e.Message,
+ "Error",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
+
+ //project.Modules.Add(GetAttribute("name"));
+
+ // continue reading
+ Read();
+ }
+
+ ReadEndElement();
+ }
+
+ private void ReadLanguages()
+ {
+ RBuildLanguage language = null;
+
+ ReadStartElement("languages");
+ while (Name == "language")
+ {
+ try
+ {
+ language = project.RBuildProject.Languages.GetByName(GetAttribute("name"));
+
+ if (language == null)
+ throw new Exception("Unkown language '" + Value + "'");
+
+ project.Languages.Add(language);
+ }
+ catch (Exception e)
+ {
+ MessageBox.Show(e.Message,
+ "Error",
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Error);
+ }
+
+ // continue reading
+ Read();
+ }
+
+ ReadEndElement();
+ }
+
+ //private void ReadRSLPaths()
+ //{
+ // //project.CompilerOptions.RSLPaths = ReadLibrary("rslPaths");
+ //}
+
+ //private void ReadExternalLibraryPaths()
+ //{
+ // //project.CompilerOptions.ExternalLibraryPaths = ReadLibrary("externalLibraryPaths");
+ //}
+
+ //private void ReadLibrayPath()
+ //{
+ // //project.CompilerOptions.LibraryPaths = ReadLibrary("libraryPaths");
+ //}
+
+ //private void ReadIncludeLibraries()
+ //{
+ // //project.CompilerOptions.IncludeLibraries = ReadLibrary("includeLibraries");
+ //}
+
+ //private string[] ReadLibrary(string name)
+ //{
+ // ReadStartElement(name);
+ // List elements = new List();
+ // while (Name == "element")
+ // {
+ // elements.Add(GetAttribute("path"));
+ // Read();
+ // }
+ // ReadEndElement();
+ // string[] result = new string[elements.Count];
+ // elements.CopyTo(result);
+ // return result;
+ //}
+
+ public void ReadApplications()
+ {
+ ReadStartElement("applications");
+ while (Name == "option")
+ {
+ MoveToFirstAttribute();
+ switch (Name)
+ {
+ case "shell":
+ project.Shell = Project.RBuildProject.Modules.GetByName(Value);
+ break;
+ case "screensaver":
+ project.Screensaver = Project.RBuildProject.Modules.GetByName(Value);
+ break;
+ case "wallpaper":
+ //project.Wallpaper = Value;
+ break;
+ }
+ Read();
+ }
+ ReadEndElement();
+ }
+
+ //protected virtual void ProcessNode(string name)
+ //{
+ // switch (name)
+ // {
+ // case "output": ReadOutputOptions(); break;
+ // // case "classpaths": ReadClasspaths(); break;
+ // // case "compileTargets": ReadCompileTargets(); break;
+ // // case "hiddenPaths": ReadHiddenPaths(); break;
+ // // case "preBuildCommand": ReadPreBuildCommand(); break;
+ // // case "postBuildCommand": ReadPostBuildCommand(); break;
+ // // case "options": ReadProjectOptions(); break;
+ // }
+ //}
+
+ // process AS3-specific stuff
+ protected virtual void ProcessNode(string name)
+ {
+ if (NodeType == XmlNodeType.Element)
+ {
+ switch (name)
+ {
+ //case "build": ReadBuildOptions(); break;
+ //case "includeLibraries": ReadIncludeLibraries(); break;
+ //case "libraryPaths": ReadLibrayPath(); break;
+ //case "externalLibraryPaths": ReadExternalLibraryPaths(); break;
+ case "modules":
+ ReadModules();
+ break;
+ case "languages":
+ ReadLanguages();
+ break;
+ case "applications":
+ ReadApplications();
+ break;
+ case "output":
+ ReadOutputOptions();
+ break;
+ case "options":
+ ReadProjectOptions();
+ break;
+ //default:
+ // base.ProcessNode(name); break;
+ }
+ }
+ }
+
+ public void ReadOutputOptions()
+ {
+ ReadStartElement("output");
+ while (Name == "movie")
+ {
+ MoveToFirstAttribute();
+ switch (Name)
+ {
+ case "name":
+ project.Name = Value;
+ break;
+ case "desc":
+ project.Description = Value;
+ break;
+ //case "path": project.OutputPath = OSPath(Value); break;
+ //case "fps": project.MovieOptions.Fps = IntValue; break;
+ //case "width": project.MovieOptions.Width = IntValue; break;
+ //case "height": project.MovieOptions.Height = IntValue; break;
+ //case "version": project.MovieOptions.Version = IntValue; break;
+ //case "background": project.MovieOptions.Background = Value; break;
+ }
+ Read();
+ }
+ ReadEndElement();
+ }
+
+ //public void ReadClasspaths()
+ //{
+ // ReadStartElement("classpaths");
+ // //ReadPaths("class",project.Classpaths);
+ // ReadEndElement();
+ //}
+
+ //public void ReadCompileTargets()
+ //{
+ // ReadStartElement("compileTargets");
+ // //ReadPaths("compile",project.CompileTargets);
+ // ReadEndElement();
+ //}
+
+ //public void ReadHiddenPaths()
+ //{
+ // ReadStartElement("hiddenPaths");
+ // //ReadPaths("hidden",project.HiddenPaths);
+ // ReadEndElement();
+ //}
+
+ //public void ReadPreBuildCommand()
+ //{
+ // if (!IsEmptyElement)
+ // {
+ // ReadStartElement("preBuildCommand");
+ // project.PreBuildEvent = OSPath(ReadString().Trim());
+ // ReadEndElement();
+ // }
+ //}
+
+ public void ReadPostBuildCommand()
+ {
+ //project.AlwaysRunPostBuild = Convert.ToBoolean(GetAttribute("alwaysRun"));
+
+ //if (!IsEmptyElement)
+ //{
+ // ReadStartElement("postBuildCommand");
+ // project.PostBuildEvent = OSPath(ReadString().Trim());
+ // ReadEndElement();
+ //}
+ }
+
+ public void ReadProjectOptions()
+ {
+ ReadStartElement("options");
+ while (Name == "option")
+ {
+ MoveToFirstAttribute();
+ switch (Name)
+ {
+ case "debug":
+ project.Debug = BoolValue;
+ break;
+ case "kdebug":
+ project.KDebug = BoolValue;
+ break;
+ case "source":
+ project.Source = Value;
+ break;
+ }
+ Read();
+ }
+ ReadEndElement();
+ }
+
+ public bool BoolValue { get { return Convert.ToBoolean(Value); } }
+ public int IntValue { get { return Convert.ToInt32(Value); } }
+
+ //public void ReadPaths(string pathNodeName, IAddPaths paths)
+ //{
+ // while (Name == pathNodeName)
+ // {
+ // paths.Add(OSPath(GetAttribute("path")));
+ // Read();
+ // }
+ //}
+
+ //protected string OSPath(string path)
+ //{
+ // if (path != null)
+ // return path.Replace('\\',System.IO.Path.DirectorySeparatorChar);
+ // else
+ // return null;
+ //}
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Project/ProjectWriter.cs b/reactos/tools/sysgen/RosBuilder/Project/ProjectWriter.cs
new file mode 100644
index 00000000000..1061c326395
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Project/ProjectWriter.cs
@@ -0,0 +1,170 @@
+using System;
+using System.Collections;
+using System.IO;
+using System.Diagnostics;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectWriter : XmlTextWriter
+ {
+ Project m_Project;
+
+ public ProjectWriter(Project project, string filename) : base(filename,Encoding.UTF8)
+ {
+ m_Project = project;
+ Formatting = Formatting.Indented;
+ }
+
+ protected Project Project { get { return m_Project; } }
+
+ public void WriteProject()
+ {
+ WriteStartDocument();
+ WriteStartElement("project");
+ WriteOutputOptions();
+ WriteBuildOptions();
+ WriteProjectOptions();
+ WriteEndElement();
+ WriteEndDocument();
+ }
+
+ public void WriteOutputOptions()
+ {
+ WriteComment(" Output SWF options ");
+ WriteStartElement("output");
+ WriteOption("movie", "name", m_Project.Name);
+ WriteOption("movie", "desc", m_Project.Description);
+ WriteEndElement();
+ }
+
+ public void WriteBuildOptions()
+ {
+ WriteComment(" Build options ");
+ WriteStartElement("build");
+
+ if (Project.Modules.Count > 0)
+ {
+ WriteStartElement("modules");
+ foreach (RBuildModule module in Project.Modules)
+ {
+ WriteStartElement("module");
+ WriteAttributeString("name", module.Name);
+ WriteEndElement();
+ }
+ WriteEndElement();
+ }
+
+ WriteEndElement();
+
+ if (Project.Languages.Count > 0)
+ {
+ WriteComment(" Build options ");
+ WriteStartElement("languages");
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ WriteStartElement("language");
+ WriteAttributeString("name", language.Name);
+ WriteEndElement();
+ }
+ WriteEndElement();
+ }
+
+ if (Project.DebugChannels.Count > 0)
+ {
+ WriteStartElement("debugchhanels");
+ foreach (RBuildDebugChannel channel in Project.DebugChannels)
+ {
+ WriteStartElement("debugchannel");
+ WriteAttributeString("name", channel.Name);
+ WriteEndElement();
+ }
+ WriteEndElement();
+ }
+
+ WriteStartElement("applications");
+
+ if (m_Project.Shell != null)
+ WriteOption("Shell", m_Project.Shell.Name);
+
+ if (m_Project.Screensaver != null)
+ WriteOption("Screensaver", m_Project.Screensaver.Name);
+
+ if (m_Project.Wallpaper != null)
+ WriteOption("Wallpaper", m_Project.Wallpaper.Name);
+
+ WriteEndElement();
+ }
+
+ public void WriteClasspaths()
+ {
+ WriteComment(" Other classes to be compiled into your SWF ");
+ WriteStartElement("classpaths");
+ //WritePaths(project.Classpaths,"class");
+ WriteEndElement();
+ }
+
+ public void WriteCompileTargets()
+ {
+ WriteComment(" Class files to compile (other referenced classes will automatically be included) ");
+ WriteStartElement("compileTargets");
+ //WritePaths(project.CompileTargets,"compile");
+ WriteEndElement();
+ }
+
+ public void WriteHiddenPaths()
+ {
+ WriteComment(" Paths to exclude from the Project Explorer tree ");
+ WriteStartElement("hiddenPaths");
+ //WritePaths(project.HiddenPaths,"hidden");
+ WriteEndElement();
+ }
+
+ public void WritePreBuildCommand()
+ {
+ WriteComment(" Executed before build ");
+ WriteStartElement("preBuildCommand");
+ if (m_Project.PreBuildEvent.Length > 0)
+ WriteString(m_Project.PreBuildEvent);
+ WriteEndElement();
+ }
+
+ public void WritePostBuildCommand()
+ {
+ WriteComment(" Executed after build ");
+ WriteStartElement("postBuildCommand");
+ WriteAttributeString("alwaysRun",m_Project.AlwaysRunPostBuild.ToString());
+ if (m_Project.PostBuildEvent.Length > 0)
+ WriteString(m_Project.PostBuildEvent);
+ WriteEndElement();
+
+ }
+
+ public void WriteProjectOptions()
+ {
+ WriteComment(" Other project options ");
+ WriteStartElement("options");
+ WriteOption("debug",m_Project.Debug);
+ WriteOption("kdebug",m_Project.KDebug);
+ WriteOption("source", @"c:\ros\trunk\reactos" /*project.Source*/);
+ WriteEndElement();
+ }
+
+ public void WriteOption(string optionName, object optionValue)
+ {
+ WriteOption("option", optionName, optionValue);
+ }
+
+ public void WriteOption(string nodeName, string optionName, object optionValue)
+ {
+ WriteStartElement(nodeName);
+ WriteAttributeString(optionName, optionValue.ToString());
+ WriteEndElement();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/ProjectController.cs b/reactos/tools/sysgen/RosBuilder/ProjectController.cs
new file mode 100644
index 00000000000..c77491d236f
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/ProjectController.cs
@@ -0,0 +1,222 @@
+using System;
+using System.Windows.Forms;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.Framework.Catalog;
+
+namespace TriStateTreeViewDemo
+{
+ public class ProjectController
+ {
+ private ISysGenDesigner m_SysGenDesigner = null;
+ private RBuildProject m_Project = null;
+
+ public event EventHandler PlatformModulesUpdated;
+ public event EventHandler ProjectLoaded;
+ public event EventHandler ProjectSaved;
+ public event EventHandler ProjectUpdated;
+
+ public ProjectController(ISysGenDesigner engine)
+ {
+ m_SysGenDesigner = engine;
+
+ PlatformCatalogReader m_Catalog = new PlatformCatalogReader(@"C:\Ros\trunk\reactos\rbuilddb.xml");
+ m_Catalog.Read();
+
+ m_Project = m_Catalog.Project;
+
+ New();
+ }
+
+ public void New()
+ {
+ m_Project.Platform = new Project(m_Project);
+
+ if (ProjectLoaded != null)
+ ProjectLoaded(this, EventArgs.Empty);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Open(string file)
+ {
+ SysGenProject = new Project(m_Project, file);
+ SysGenProject.Load();
+
+ if (ProjectLoaded != null)
+ ProjectLoaded(this, EventArgs.Empty);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Open()
+ {
+ using (OpenFileDialog openFile = new OpenFileDialog())
+ {
+ openFile.Title = "Open SysGen Designer Project File";
+ //openFile.InitialDirectory = m_SysGenEngine.BaseDirectory;
+ openFile.Filter = "SysGen Project File|*.sgpd";
+
+ if (openFile.ShowDialog() == DialogResult.OK)
+ {
+ SysGenProject = new Project(m_Project, openFile.FileName);
+ SysGenProject.Load();
+
+ if (ProjectLoaded != null)
+ ProjectLoaded(this, EventArgs.Empty);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ public void Save()
+ {
+ using (SaveFileDialog saveFile = new SaveFileDialog())
+ {
+ saveFile.Title = "Save SysGen Designer Project File";
+ //saveFile.InitialDirectory = m_SysGenEngine.BaseDirectory;
+ saveFile.Filter = "SysGen Project File|*.sgpd";
+
+ if (saveFile.ShowDialog() == DialogResult.OK)
+ {
+ SysGenProject.ProjectPath = saveFile.FileName;
+ SysGenProject.Save();
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+
+ if (ProjectSaved != null)
+ ProjectSaved(this, EventArgs.Empty);
+ }
+ }
+ }
+
+ public RBuildModuleCollection AvailableModules
+ {
+ get { return m_Project.Modules; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ }
+
+ public Project SysGenProject
+ {
+ get { return Project.Platform as Project; }
+ set { Project.Platform = value; }
+ }
+
+ public void Remove(RBuildModule module)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project, module);
+
+ if (dependencyTracker.Using.Count > 0)
+ {
+ string s = string.Format("Cannot remove module '{0}' because '{1}' modules depends on it",
+ module.Name,
+ dependencyTracker.Using.Count);
+
+ MessageBox.Show(s, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ else
+ {
+ Project.Platform.Modules.Remove(module);
+ }
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Add(RBuildModule module)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project , module);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.DependsOn);
+ Project.Platform.Modules.Add(module);
+ }
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void Add(RBuildModuleCollection modules)
+ {
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project, modules);
+
+ if (AskAddModulesToPlatform(dependencyTracker.Missing))
+ {
+ Project.Platform.Modules.Add(dependencyTracker.DependsOn);
+ Project.Platform.Modules.Add(modules);
+ }
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+ }
+
+ public void AddLanguage(RBuildLanguage language)
+ {
+ if (Project.Platform.Languages.Contains(language) == false)
+ Project.Platform.Languages.Add(language);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+
+ if (ProjectUpdated != null)
+ ProjectUpdated(this, EventArgs.Empty);
+ }
+
+ public void AddDebugChannel(RBuildDebugChannel channel)
+ {
+ if (Project.Platform.DebugChannels.Contains(channel) == false)
+ Project.Platform.DebugChannels.Add(channel);
+
+ if (PlatformModulesUpdated != null)
+ PlatformModulesUpdated(this, EventArgs.Empty);
+
+ if (ProjectUpdated != null)
+ ProjectUpdated(this, EventArgs.Empty);
+ }
+
+ public bool AskAddModulesToPlatform(RBuildModuleCollection missingDependencies)
+ {
+ if (missingDependencies.Count > 0)
+ {
+ StringBuilder str = new StringBuilder();
+
+ str.AppendFormat("This action requieres adding {0} dependecies no present in your platform :", missingDependencies.Count);
+ str.AppendLine();
+ str.AppendLine();
+
+ foreach (RBuildModule dependency in missingDependencies)
+ {
+ str.AppendFormat("{0} on '{1}' \n",
+ dependency.Name,
+ dependency.Base);
+ }
+
+ str.AppendLine();
+ str.AppendLine("¿Do you want to add this dependencies?");
+
+ if (MessageBox.Show(str.ToString(), "RosBuilder", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
+ {
+ return true;
+ }
+ }
+ else
+ return true;
+
+ return false;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/RosBuilder/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..0b59df60ad1
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RosBuilder")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("RosBuilder")]
+[assembly: AssemblyCopyright("Copyright © Sand 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("8f4d0b84-8882-4b89-8e3c-8ce5238d603f")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Resources.Designer.cs b/reactos/tools/sysgen/RosBuilder/Properties/Resources.Designer.cs
new file mode 100644
index 00000000000..268c5602106
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Resources.Designer.cs
@@ -0,0 +1,63 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4927
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace RosBuilder.Properties {
+ using System;
+
+
+ ///
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ ///
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ ///
+ /// Returns the cached ResourceManager instance used by this class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if (object.ReferenceEquals(resourceMan, null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RosBuilder.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Resources.resx b/reactos/tools/sysgen/RosBuilder/Properties/Resources.resx
new file mode 100644
index 00000000000..af7dbebbace
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Settings.Designer.cs b/reactos/tools/sysgen/RosBuilder/Properties/Settings.Designer.cs
new file mode 100644
index 00000000000..71b700b5e99
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Settings.Designer.cs
@@ -0,0 +1,26 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:2.0.50727.4927
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace RosBuilder.Properties {
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default {
+ get {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosBuilder/Properties/Settings.settings b/reactos/tools/sysgen/RosBuilder/Properties/Settings.settings
new file mode 100644
index 00000000000..39645652af6
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj
new file mode 100644
index 00000000000..3e94b2c1469
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj
@@ -0,0 +1,148 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {78A0F196-A5BD-469A-B901-B269671AFB0A}
+ WinExe
+ Properties
+ RosBuilder
+ RosBuilder
+
+
+ 2.0
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+ Component
+
+
+ Component
+
+
+ Component
+
+
+ UserControl
+
+
+ RegistryEditor.cs
+
+
+ Form
+
+
+ Form1.cs
+
+
+ Form
+
+
+ MainForm.cs
+
+
+
+ Form
+
+
+ NewItemForm.cs
+
+
+ Code
+
+
+
+
+
+
+
+
+
+ Designer
+ RegistryEditor.cs
+
+
+ Designer
+ Form1.cs
+
+
+ Designer
+ MainForm.cs
+
+
+ Designer
+ NewItemForm.cs
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+ Designer
+
+
+ True
+ Resources.resx
+ True
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ SysGen.RBuild.Framework
+
+
+ {8F5F8375-4097-4952-B860-784EB9961ABE}
+ SysGen.Framework
+
+
+ {99CEE41D-B76D-4102-B0AD-C81069509D17}
+ TriStateTreeView
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj.user b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj.user
new file mode 100644
index 00000000000..6a34e7dcdf5
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/SysGen.Designer.csproj.user
@@ -0,0 +1,5 @@
+
+
+ ShowAllFiles
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosBuilder/Util/FileAssociation.cs b/reactos/tools/sysgen/RosBuilder/Util/FileAssociation.cs
new file mode 100644
index 00000000000..f60b10d4603
--- /dev/null
+++ b/reactos/tools/sysgen/RosBuilder/Util/FileAssociation.cs
@@ -0,0 +1,244 @@
+using System;
+using System.Security;
+using System.Collections;
+using Microsoft.Win32;
+
+namespace TriStateTreeViewDemo
+{
+ /// List of commands.
+ internal struct CommandList
+ {
+ ///
+ /// Holds the names of the commands.
+ ///
+ public ArrayList Captions;
+ ///
+ /// Holds the commands.
+ ///
+ public ArrayList Commands;
+ }
+ /// Properties of the file association.
+ internal struct FileType
+ {
+ ///
+ /// Holds the command names and the commands.
+ ///
+ public CommandList Commands;
+ ///
+ /// Holds the extension of the file type.
+ ///
+ public string Extension;
+ ///
+ /// Holds the proper name of the file type.
+ ///
+ public string ProperName;
+ ///
+ /// Holds the full name of the file type.
+ ///
+ public string FullName;
+ ///
+ /// Holds the name of the content type of the file type.
+ ///
+ public string ContentType;
+ ///
+ /// Holds the path to the resource with the icon of this file type.
+ ///
+ public string IconPath;
+ ///
+ /// Holds the icon index in the resource file.
+ ///
+ public short IconIndex;
+ }
+ /// Creates file associations for your programs.
+ /// The following example creates a file association for the type XYZ with a non-existent program.
+ ///
VB.NET code
+ ///
+ /// Dim FA as New FileAssociation
+ /// FA.Extension = "xyz"
+ /// FA.ContentType = "application/myprogram"
+ /// FA.FullName = "My XYZ Files!"
+ /// FA.ProperName = "XYZ File"
+ /// FA.AddCommand("open", "C:\mydir\myprog.exe %1")
+ /// FA.Create
+ ///
+ ///
C# code
+ ///
+ /// FileAssociation FA = new FileAssociation();
+ /// FA.Extension = "xyz";
+ /// FA.ContentType = "application/myprogram";
+ /// FA.FullName = "My XYZ Files!";
+ /// FA.ProperName = "XYZ File";
+ /// FA.AddCommand("open", "C:\\mydir\\myprog.exe %1");
+ /// FA.Create();
+ ///
+ ///
+ public class FileAssociation
+ {
+ /// Initializes an instance of the FileAssociation class.
+ public FileAssociation()
+ {
+ FileInfo = new FileType();
+ FileInfo.Commands.Captions = new ArrayList();
+ FileInfo.Commands.Commands = new ArrayList();
+ }
+ /// Gets or sets the proper name of the file type.
+ /// A String representing the proper name of the file type.
+ public string ProperName
+ {
+ get
+ {
+ return FileInfo.ProperName;
+ }
+ set
+ {
+ FileInfo.ProperName = value;
+ }
+ }
+ /// Gets or sets the full name of the file type.
+ /// A String representing the full name of the file type.
+ public string FullName
+ {
+ get
+ {
+ return FileInfo.FullName;
+ }
+ set
+ {
+ FileInfo.FullName = value;
+ }
+ }
+ /// Gets or sets the content type of the file type.
+ /// A String representing the content type of the file type.
+ public string ContentType
+ {
+ get
+ {
+ return FileInfo.ContentType;
+ }
+ set
+ {
+ FileInfo.ContentType = value;
+ }
+ }
+ /// Gets or sets the extension of the file type.
+ /// A String representing the extension of the file type.
+ /// If the extension doesn't start with a dot ("."), a dot is automatically added.
+ public string Extension
+ {
+ get
+ {
+ return FileInfo.Extension;
+ }
+ set
+ {
+ if (value.Substring(0, 1) != ".")
+ value = "." + value;
+ FileInfo.Extension = value;
+ }
+ }
+ /// Gets or sets the index of the icon of the file type.
+ /// A short representing the index of the icon of the file type.
+ public short IconIndex
+ {
+ get
+ {
+ return FileInfo.IconIndex;
+ }
+ set
+ {
+ FileInfo.IconIndex = value;
+ }
+ }
+ /// Gets or sets the path of the resource that contains the icon for the file type.
+ /// A String representing the path of the resource that contains the icon for the file type.
+ /// This resource can be an executable or a DLL.
+ public string IconPath
+ {
+ get
+ {
+ return FileInfo.IconPath;
+ }
+ set
+ {
+ FileInfo.IconPath = value;
+ }
+ }
+ /// Adds a new command to the command list.
+ /// The name of the command.
+ /// The command to execute.
+ /// Caption -or- Command is null (VB.NET: Nothing).
+ public void AddCommand(string Caption, string Command)
+ {
+ if (Caption == null || Command == null)
+ throw new ArgumentNullException();
+ FileInfo.Commands.Captions.Add(Caption);
+ FileInfo.Commands.Commands.Add(Command);
+ }
+ /// Creates the file association.
+ /// Extension -or- ProperName is null (VB.NET: Nothing).
+ /// Extension -or- ProperName is empty.
+ /// The user does not have registry write access.
+ public void Create()
+ {
+ // remove the extension to avoid incompatibilities [such as DDE links]
+ try
+ {
+ Remove();
+ }
+ catch (ArgumentException) {} // the extension doesn't exist
+
+ // create the exception
+ if (Extension == "" || ProperName == "")
+ throw new ArgumentException();
+ int cnt;
+
+ try
+ {
+ RegistryKey RegKey = Registry.ClassesRoot.CreateSubKey(Extension);
+ RegKey.SetValue("", ProperName);
+
+ if (ContentType != null && ContentType != "")
+ RegKey.SetValue("Content Type", ContentType);
+
+ RegKey.Close();
+ RegKey = Registry.ClassesRoot.CreateSubKey(ProperName);
+ RegKey.SetValue("", FullName);
+ RegKey.Close();
+
+ if (IconPath != "")
+ {
+ RegKey = Registry.ClassesRoot.CreateSubKey(ProperName + "\\" + "DefaultIcon");
+ RegKey.SetValue("", IconPath + "," + IconIndex.ToString());
+ RegKey.Close();
+ }
+
+ for (cnt = 0; cnt < FileInfo.Commands.Captions.Count; cnt++)
+ {
+ RegKey = Registry.ClassesRoot.CreateSubKey(ProperName + "\\" + "Shell" + "\\" + (String)FileInfo.Commands.Captions[cnt]);
+ RegKey = RegKey.CreateSubKey("Command");
+ RegKey.SetValue("", FileInfo.Commands.Commands[cnt]);
+ RegKey.Close();
+ }
+ }
+ catch
+ {
+ throw new SecurityException();
+ }
+ }
+ /// Removes the file association.
+ /// Extension -or- ProperName is null (VB.NET: Nothing).
+ /// Extension -or- ProperName is empty -or- the specified extension doesn't exist.
+ /// The user does not have registry delete access.
+ public void Remove()
+ {
+ if (Extension == null || ProperName == null)
+ throw new ArgumentNullException();
+ if (Extension == "" || ProperName == "")
+ throw new ArgumentException();
+ Registry.ClassesRoot.DeleteSubKeyTree(Extension);
+ Registry.ClassesRoot.DeleteSubKeyTree(ProperName);
+ }
+ /// Holds the properties of the file type.
+ private FileType FileInfo;
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Base/RBuildElement.cs b/reactos/tools/sysgen/RosFramework/Base/RBuildElement.cs
new file mode 100644
index 00000000000..3376bd00ed7
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Base/RBuildElement.cs
@@ -0,0 +1,311 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public abstract class RBuildElement : IRBuildNamed
+ {
+ protected string m_RBuild = null;
+ protected string m_Name = null;
+ protected string m_Base = null;
+ protected string m_Path = null;
+ protected string m_XmlFile = null;
+
+ protected List m_AssemblyFlags = new List();
+ protected List m_CompilerFlags = new List();
+ protected List m_LinkerFlags = new List();
+ protected RBuildIncludeFolderCollection m_Includes = new RBuildIncludeFolderCollection();
+ protected RBuildPlatformFileCollection m_Files = new RBuildPlatformFileCollection();
+ protected RBuildDefineCollection m_Defines = new RBuildDefineCollection();
+ protected RBuildPropertyCollection m_Properties = new RBuildPropertyCollection();
+ protected RBuildFolderCollection m_Folders = new RBuildFolderCollection();
+ protected RBuildFolder m_Folder = new RBuildFolder();
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public virtual RBuildFolder Folder
+ {
+ get { return m_Folder; }
+ set { m_Folder = value; }
+ }
+
+ public string XmlFile
+ {
+ get { return m_XmlFile; }
+ set { m_XmlFile = value; }
+ }
+
+ public string Path
+ {
+ get { return m_Path; }
+ set { m_Path = value; }
+ }
+
+ public string Base
+ {
+ get { return Folder.FullPath; }
+ }
+
+ public string RBuildPath
+ {
+ get { return System.IO.Path.Combine(Base, RBuildFile); }
+ }
+
+ public string RBuildFile
+ {
+ get { return m_RBuild; }
+ set { m_RBuild = value; }
+ }
+
+ public Uri BaseURI
+ {
+ get { return new Uri(Base, UriKind.Relative); }
+ }
+
+ public string BaseParent
+ {
+ get { return Base.Replace(System.IO.Path.DirectorySeparatorChar + Name , string.Empty); }
+ }
+
+ public string FolderFullPath
+ {
+ get { return System.IO.Path.Combine(Path, Base); }
+ }
+
+ public RBuildFolderCollection Folders
+ {
+ get { return m_Folders; }
+ }
+
+ public RBuildPlatformFileCollection Files
+ {
+ get { return m_Files; }
+ }
+
+ public RBuildPropertyCollection Properties
+ {
+ get { return m_Properties; }
+ }
+
+ public List CompilerFlags
+ {
+ get { return m_CompilerFlags; }
+ }
+
+ public List LinkerFlags
+ {
+ get { return m_LinkerFlags; }
+ }
+
+ public List AssemblyFlags
+ {
+ get { return m_AssemblyFlags; }
+ }
+
+ public RBuildDefineCollection Defines
+ {
+ get { return m_Defines; }
+ }
+
+ public RBuildIncludeFolderCollection IncludeFolders
+ {
+ get { return m_Includes; }
+ set { m_Includes = value; }
+ }
+
+ public string MakeFilePreCondition
+ {
+ get { return string.Format("{0}_PRECONDITION", Name); }
+ }
+
+ public string MakeFileRCFlags
+ {
+ get { return string.Format("{0}_RCFLAGS", Name); }
+ }
+
+ public string MakeFileWIDLFlags
+ {
+ get { return string.Format("{0}_WIDLFLAGS", Name); }
+ }
+
+ public string MakeFileLFlags
+ {
+ get { return string.Format("{0}_LFLAGS", Name); }
+ }
+
+ public string MakeFileNASMFlags
+ {
+ get { return string.Format("{0}_NASMFLAGS", Name); }
+ }
+
+ public string MakeFileFoldersMacro
+ {
+ get { return string.Format("$({0}_FOLDERS)", Name); }
+ }
+
+ public string MakeFileFolders
+ {
+ get { return string.Format("{0}_FOLDERS", Name); }
+ }
+
+ public string MakeFileCFlags
+ {
+ get { return string.Format("{0}_CFLAGS", Name); }
+ }
+
+ public string MakeFileObjs
+ {
+ get { return string.Format("{0}_OBJS", Name); }
+ }
+
+ public string MakeFileSources
+ {
+ get { return string.Format("{0}_SOURCES", Name); }
+ }
+
+ public string MakeFileHeaders
+ {
+ get { return string.Format("{0}_HEADERS", Name); }
+ }
+
+ public string MakeFileMakeTarget
+ {
+ get { return string.Format("{0}", Name); }
+ }
+
+ public string MakeFileFlagDebugTarget
+ {
+ get { return string.Format("{0}_flagdebug", Name); }
+ }
+
+ public string MakeFileInfoTarget
+ {
+ get { return string.Format("{0}_info", Name); }
+ }
+
+ public string MakeFileCleanTarget
+ {
+ get { return string.Format("{0}_clean", Name); }
+ }
+
+ public string MakeFileDependsTarget
+ {
+ get { return string.Format("{0}_depends", Name); }
+ }
+
+ public string MakeFileInstallTarger
+ {
+ get { return string.Format("{0}_install", Name); }
+ }
+
+ public string MakeFileHeadersMacro
+ {
+ get { return string.Format("$({0}_HEADERS)", Name); }
+ }
+
+ public string MakeFileMCHeadersMacro
+ {
+ get { return string.Format("$({0}_MCHEADERS)", Name); }
+ }
+
+ public string MakeFileMCHeaders
+ {
+ get { return string.Format("{0}_MCHEADERS", Name); }
+ }
+
+ public string MakeFileRPCHeadersMacro
+ {
+ get { return string.Format("$({0}_RPCHEADERS)", Name); }
+ }
+
+ public string MakeFileRPCHeaders
+ {
+ get { return string.Format("{0}_RPCHEADERS", Name); }
+ }
+
+ public string MakeFileRPCSourcesMacro
+ {
+ get { return string.Format("$({0}_RPCSOURCES)", Name); }
+ }
+
+ public string MakeFileRPCSources
+ {
+ get { return string.Format("{0}_RPCSOURCES", Name); }
+ }
+
+ public string MakeFilePCHMacro
+ {
+ get { return string.Format("$({0}_PCH)", Name); }
+ }
+
+ public string MakeFilePCHHeaders
+ {
+ get { return string.Format("{0}_PCH", Name); }
+ }
+
+ public string MakeFileNASMMacro
+ {
+ get { return string.Format("$({0}_NASMFLAGS)", Name); }
+ }
+
+ public string MakeFileCFlagsMacro
+ {
+ get { return string.Format("$({0}_CFLAGS)", Name); }
+ }
+
+ public string MakeFileLFlagsMacro
+ {
+ get { return string.Format("$({0}_LFLAGS)", Name); }
+ }
+
+ public string MakeFileWIDLFlagsMacro
+ {
+ get { return string.Format("$({0}_WIDLFLAGS)", Name); }
+ }
+
+ public string MakeFileObjsMacro
+ {
+ get { return string.Format("$({0}_OBJS)", Name); }
+ }
+
+ public string MakeFileSourcesMacro
+ {
+ get { return string.Format("$({0}_SOURCES)", Name); }
+ }
+
+ public string MakeFilePreConditionMacro
+ {
+ get { return string.Format("$({0}_PRECONDITION)", Name); }
+ }
+
+ public string MakeFileRCFlagsMacro
+ {
+ get { return string.Format("$({0}_RCFLAGS)", Name); }
+ }
+
+ public abstract void SaveAs(string file);
+
+ public override bool Equals(object obj)
+ {
+ if (obj is RBuildElement)
+ {
+ RBuildElement element = obj as RBuildElement;
+
+ if (element.Name == Name)
+ return true;
+ }
+
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return base.GetHashCode();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildAPIStatusCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildAPIStatusCollection.cs
new file mode 100644
index 00000000000..e877521ee0c
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildAPIStatusCollection.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildAPIStatusCollection : List
+ {
+ public int Percentage
+ {
+ get
+ {
+ if (TotalFunctions == 0)
+ return 100;
+
+ return ((100 * ImplementedFunctionsCount) / TotalFunctions);
+ }
+ }
+
+ public int TotalFunctions
+ {
+ get { return (ImplementedFunctionsCount + UnImplementedFunctionsCount); }
+ }
+
+ public int ImplementedFunctionsCount
+ {
+ get
+ {
+ int count = 0;
+
+ foreach (RBuildAPIInfo info in this)
+ if (info.Implemented == true)
+ count++;
+
+ return count;
+ }
+ }
+
+ public int UnImplementedFunctionsCount
+ {
+ get
+ {
+ int count = 0;
+
+ foreach (RBuildAPIInfo info in this)
+ if (info.Implemented == false)
+ count++;
+
+ return count;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildAuthorCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildAuthorCollection.cs
new file mode 100644
index 00000000000..e9f588ae119
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildAuthorCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildAuthorCollection : List
+ {
+ public RBuildAuthor GetByName(string alias)
+ {
+ foreach (RBuildAuthor author in this)
+ {
+ if (author.Contributor.Alias == alias)
+ return author;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildBuildFamilyCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildBuildFamilyCollection.cs
new file mode 100644
index 00000000000..c2f0b416a42
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildBuildFamilyCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildBuildFamilyCollection : List
+ {
+ public RBuildBuildFamily GetByName(string name)
+ {
+ foreach (RBuildBuildFamily family in this)
+ {
+ if (family.Name == name)
+ return family;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildContributorCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildContributorCollection.cs
new file mode 100644
index 00000000000..ee8e5530b7e
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildContributorCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildContributorCollection : List
+ {
+ public RBuildContributor GetByName(string alias)
+ {
+ foreach (RBuildContributor contributor in this)
+ {
+ if (contributor.Alias == alias)
+ return contributor;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildDebugChannelCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildDebugChannelCollection.cs
new file mode 100644
index 00000000000..8f45b25cfb1
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildDebugChannelCollection.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildDebugChannelCollection : List
+ {
+ public RBuildDebugChannel GetByName(string name)
+ {
+ foreach (RBuildDebugChannel channel in this)
+ {
+ if (channel.Name == name)
+ return channel;
+ }
+
+ return null;
+ }
+
+ public string Text
+ {
+ get
+ {
+ StringBuilder sBuilder = new StringBuilder();
+
+ foreach (RBuildDebugChannel channel in this)
+ {
+ sBuilder.Append(channel.Text);
+ }
+
+ return sBuilder.ToString();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildDefineCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildDefineCollection.cs
new file mode 100644
index 00000000000..7281ab8a556
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildDefineCollection.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildDefineCollection : List
+ {
+ public bool IsDefined(string name)
+ {
+ foreach (RBuildDefine define in this)
+ {
+ if (define.Name == name)
+ return true;
+ }
+
+ return false;
+ }
+
+ public void Add(string name)
+ {
+ Add(new RBuildDefine(name));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildExportedFunctionsCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildExportedFunctionsCollection.cs
new file mode 100644
index 00000000000..c3d17463fad
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildExportedFunctionsCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildExportedFunctionsCollection : List
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildFamilyCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildFamilyCollection.cs
new file mode 100644
index 00000000000..66ea4355fd4
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildFamilyCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFamilyCollection : List
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildFileCollection.cs
new file mode 100644
index 00000000000..08e47dd24be
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildFileCollection.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFileCollection : List
+ {
+ public void Add(RBuildFileCollection files)
+ {
+ foreach (RBuildFile file in files)
+ {
+ Add(file);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildFolderCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildFolderCollection.cs
new file mode 100644
index 00000000000..09faabaa28f
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildFolderCollection.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFolderCollection : List
+ {
+ public void Add(RBuildFolderCollection folders)
+ {
+ foreach (RBuildFolder folder in folders)
+ {
+ Add(folder);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildIncludeFolderCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildIncludeFolderCollection.cs
new file mode 100644
index 00000000000..96b63771fe8
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildIncludeFolderCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildIncludeFolderCollection : List
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildInstallFolderCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildInstallFolderCollection.cs
new file mode 100644
index 00000000000..e9620346126
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildInstallFolderCollection.cs
@@ -0,0 +1,28 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInstallFolderCollection : List
+ {
+ public RBuildInstallFolder GetByName(string name)
+ {
+ foreach (RBuildInstallFolder folder in this)
+ {
+ if (NormalizeFolderName(folder.Name) == NormalizeFolderName(name))
+ return folder;
+ }
+
+ return null;
+ }
+
+ private string NormalizeFolderName(string path)
+ {
+ return path.Replace(
+ Path.AltDirectorySeparatorChar,
+ Path.DirectorySeparatorChar);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildLanguageCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildLanguageCollection.cs
new file mode 100644
index 00000000000..d81f0506a49
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildLanguageCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLanguageCollection : List
+ {
+ public RBuildLanguage GetByName(string culture)
+ {
+ foreach (RBuildLanguage language in this)
+ {
+ if (language.Name == culture)
+ return language;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildLocalizationFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildLocalizationFileCollection.cs
new file mode 100644
index 00000000000..7e005d00616
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildLocalizationFileCollection.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLocalizationFileCollection : List
+ {
+ public bool ContainsLocalization(string culture)
+ {
+ return GetByName(culture) != null;
+ }
+
+ public RBuildLocalizationFile GetByName(string culture)
+ {
+ foreach (RBuildLocalizationFile file in this)
+ {
+ if (file.IsoName == culture)
+ return file;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleCollection.cs
new file mode 100644
index 00000000000..2c472e74f07
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleCollection.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class ModulePreferenceComparer : IComparer
+ {
+ public int Compare(RBuildModule x, RBuildModule y)
+ {
+ if (x.Type == y.Type)
+ return 0;
+
+ if (x.Type == ModuleType.BuildTool)
+ return -1;
+
+ return 1;
+ }
+ }
+
+ public class RBuildModuleCollection : List
+ {
+ public event EventHandler OnModuleAdded;
+
+ public void Add(RBuildModuleCollection modules)
+ {
+ foreach (RBuildModule module in modules)
+ {
+ Add(module);
+ }
+ }
+
+ public new void Add(RBuildModule module)
+ {
+ if (module == null)
+ throw new Exception("Could not add a null instance");
+
+ if (GetByName(module.Name) == null)
+ {
+ base.Add(module);
+ }
+
+ if (OnModuleAdded != null)
+ OnModuleAdded(this, EventArgs.Empty);
+ }
+
+ public void Add(string moduleName)
+ {
+ RBuildModule module = GetByName(moduleName);
+
+ if (module == null)
+ throw new Exception(string.Format("Unknown '{0}' module", moduleName));
+
+ Add(module);
+ }
+
+ public void Add(int index, RBuildModule moduleName)
+ {
+ base.Insert(index, moduleName);
+ }
+
+ public void DisableAll()
+ {
+ foreach (RBuildModule module in this)
+ {
+ // Disable module
+ module.Enabled = false;
+ }
+ }
+
+ public RBuildModule GetByName(string name)
+ {
+ foreach (RBuildModule module in this)
+ {
+ if (module.Name == name)
+ return module;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleInfoCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleInfoCollection.cs
new file mode 100644
index 00000000000..4670f093936
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildModuleInfoCollection.cs
@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildModuleInfoCollection : List
+ {
+ public RBuildModuleInfo GetByName(string name)
+ {
+ foreach (RBuildModuleInfo module in this)
+ {
+ if (module.Name == name)
+ return module;
+ }
+
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildPlatformFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildPlatformFileCollection.cs
new file mode 100644
index 00000000000..7ccf135cefc
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildPlatformFileCollection.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildPlatformFileCollection : List
+ {
+ public void Add(RBuildPlatformFileCollection files)
+ {
+ foreach (RBuildPlatformFile file in files)
+ {
+ Add(file);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildPropertyCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildPropertyCollection.cs
new file mode 100644
index 00000000000..f3a4769258f
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildPropertyCollection.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+using System.Text.RegularExpressions;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildPropertyCollection : List
+ {
+ ///
+ /// Adds a property that cannot be changed.
+ ///
+ ///
+ /// Properties added with this method can never be changed. Note that
+ /// they are removed if the Clear method is called.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void AddReadOnly(string name, string value)
+ {
+ Add(name, value, true);
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, string value)
+ {
+ Add(name, value, false);
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, bool value)
+ {
+ Add(name, value.ToString());
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, string value, bool readOnly)
+ {
+ if (!PropertyExists(name))
+ {
+ Add(new RBuildProperty(name, value , readOnly));
+ }
+ }
+
+ ///
+ /// Adds a property to the collection.
+ ///
+ /// Name of property
+ /// Value of property
+ public virtual void Add(string name, string value, bool readOnly, bool isInternal)
+ {
+ if (!PropertyExists(name))
+ {
+ Add(new RBuildProperty(name, value, readOnly,isInternal));
+ }
+ }
+
+ ///
+ /// Returns true if a property is listed as read only
+ ///
+ /// Property to check
+ /// true if readonly, false otherwise
+ public virtual bool IsReadOnlyProperty(string name)
+ {
+ if (PropertyExists(name))
+ return this[name].ReadOnly;
+ return false;
+ }
+
+ ///
+ /// Returns true if a property exists
+ ///
+ /// Property to check
+ /// true if exists, false otherwise
+ public bool PropertyExists(string name)
+ {
+ return (this[name] != null);
+ }
+
+ ///
+ /// Indexer property.
+ ///
+ public virtual RBuildProperty this[string name]
+ {
+ get
+ {
+ foreach (RBuildProperty property in this)
+ if (property.Name == name)
+ return property;
+
+ return null;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Collections/RBuildSourceFileCollection.cs b/reactos/tools/sysgen/RosFramework/Collections/RBuildSourceFileCollection.cs
new file mode 100644
index 00000000000..7175bac8e8a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Collections/RBuildSourceFileCollection.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class SourceCodePreferenceComparer : IComparer
+ {
+ public int Compare(RBuildSourceFile x, RBuildSourceFile y)
+ {
+ if (x.First != y.First)
+ {
+ if (x.First)
+ return -1;
+ else
+ return 1;
+ }
+
+ if (x.Extension == y.Extension)
+ return 0;
+
+ if (x.IsWidl)
+ return -1;
+ else if (y.IsWidl)
+ return 1;
+
+ if (x.IsAssembler)
+ return 1;
+ else if (y.IsAssembler)
+ return -1;
+
+ if (x.IsNASM)
+ return 1;
+ else if (y.IsNASM)
+ return -1;
+
+ return 0;
+ }
+ }
+
+ public class RBuildSourceFileCollection : List
+ {
+ public bool ContainsASM
+ {
+ get
+ {
+ foreach (RBuildSourceFile file in this)
+ {
+ if ((file.IsAssembler) || (file.IsNASM))
+ {
+ return true;
+ }
+ }
+
+ // This module does not contain C++ code
+ return false;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildInstallable.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildInstallable.cs
new file mode 100644
index 00000000000..4e5a8467d0b
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildInstallable.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildInstallable
+ {
+ string InstallBase { get; set; }
+
+ RBuildInstallFolder InstallFolder { get; set; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildModulesContainer.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildModulesContainer.cs
new file mode 100644
index 00000000000..9bc5f9902f3
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildModulesContainer.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildModulesContainer
+ {
+ RBuildSourceFileCollection Modules { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildNamed.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildNamed.cs
new file mode 100644
index 00000000000..34252cab108
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildNamed.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildNamed
+ {
+ string Name { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildSourceFilesContainer.cs b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildSourceFilesContainer.cs
new file mode 100644
index 00000000000..78eccd72cdb
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Interfaces/IRBuildSourceFilesContainer.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public interface IRBuildSourceFilesContainer
+ {
+ RBuildSourceFileCollection SourceFiles { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Misc/Utility.cs b/reactos/tools/sysgen/RosFramework/Misc/Utility.cs
new file mode 100644
index 00000000000..da5200b907d
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Misc/Utility.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ class Utility
+ {
+ public static string GetSafeString (string str)
+ {
+ str = str.Replace(" ", string.Empty);
+ str = str.Replace(".", string.Empty);
+
+ return str;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildModuleGroup.cs b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildModuleGroup.cs
new file mode 100644
index 00000000000..6cc00b2fe2a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildModuleGroup.cs
@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework.NotImplementedYet
+{
+ public class RBuildModuleGroup
+ {
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ private string m_Name = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildPatch.cs b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildPatch.cs
new file mode 100644
index 00000000000..0b8b9c22b82
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/NotImplementedYet/RBuildPatch.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework.NotImplementedYet
+{
+ public class RBuildPatch
+ {
+ private string m_Filename = null;
+ private string m_Name = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string FileName
+ {
+ get { return m_Filename; }
+ set { m_Filename = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/PlatformCatalog.cs b/reactos/tools/sysgen/RosFramework/Obsolete/PlatformCatalog.cs
new file mode 100644
index 00000000000..4d8fcfbaf41
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/PlatformCatalog.cs
@@ -0,0 +1,92 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class PlatformCatalog
+ {
+ public List m_Platform = new List();
+ public SoftwareCatalog m_SoftwareCatalog = new SoftwareCatalog();
+
+ public PlatformCatalog()
+ {
+ }
+
+ public List Platforms
+ {
+ get { return m_Platform; }
+ }
+
+ public SoftwareCatalog SoftwareCatalog
+ {
+ get { return m_SoftwareCatalog; }
+ set { m_SoftwareCatalog = value; }
+ }
+
+ public RosPlatform GetPlatformByName(string name)
+ {
+ foreach (RosPlatform platform in Platforms)
+ {
+ if (platform.Name == name)
+ {
+ return platform;
+ }
+ }
+
+ throw new Exception("Platform not found in catalog");
+ }
+
+ public void LoadFromFile(string file)
+ {
+ XmlDocument doc = new XmlDocument();
+
+ //Load the file in to memory
+ doc.Load(file);
+
+ //Load modules ...
+ foreach (XmlNode node in doc.SelectNodes("/platforms/platform"))
+ {
+ RosPlatform platform = new RosPlatform();
+
+ platform.Name = node.Attributes["name"].InnerText;
+
+ if (node.Attributes["base"] != null)
+ {
+ platform.Base = node.Attributes["base"].InnerText;
+ }
+
+ m_Platform.Add(platform);
+ }
+
+ foreach (XmlNode comp in doc.SelectNodes("/platforms/platform"))
+ {
+ // Get the component name....
+ string name = comp.Attributes["name"].InnerText;
+
+ RosPlatform platform = GetPlatformByName(name);
+
+ if (platform.Base != null)
+ {
+ platform.ParentPlatform = GetPlatformByName(platform.Base);
+
+ foreach (RBuildModule module in platform.ParentModules)
+ {
+ platform.Modules.Add(module);
+ }
+ }
+
+ foreach (XmlNode dep in comp.SelectNodes("modules/module"))
+ {
+ // Gets the dependency name
+ name = dep.Attributes["name"].InnerText;
+
+ RBuildModule module = SoftwareCatalog.Modules.GetByName(name);
+
+ platform.Modules.Add(module);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/RosArchitecture.cs b/reactos/tools/sysgen/RosFramework/Obsolete/RosArchitecture.cs
new file mode 100644
index 00000000000..593a0373a1a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/RosArchitecture.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RosArchitecture
+ {
+ private string m_Name = null;
+ private string m_Sub = null;
+ private string m_Optimization = null;
+
+ public RosArchitecture ()
+ {
+ m_Name = "i386";
+ m_Sub = string.Empty;
+ m_Optimization = "pentium";
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string SubArchitecture
+ {
+ get { return m_Sub; }
+ set { m_Sub = value; }
+ }
+
+ public string Optimization
+ {
+ get { return m_Optimization; }
+ set { m_Optimization = value; }
+ }
+
+ public string SafeName
+ {
+ get { return Utility.GetSafeString(m_Name).ToUpper(); }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/RosOSImage.cs b/reactos/tools/sysgen/RosFramework/Obsolete/RosOSImage.cs
new file mode 100644
index 00000000000..7890b26cf26
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/RosOSImage.cs
@@ -0,0 +1,209 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildOSImage
+ {
+ private RosPlatform m_Platform = null;
+ private RBuildLanguage m_Language = null;
+ private RosArchitecture m_Architecture = null;
+
+ private Dictionary m_Properties = new Dictionary();
+ private List m_Defines = new List();
+ private List m_Includes = new List();
+
+ private bool m_Debug = false;
+ //private bool m_KernelDebugger = false;
+ //private bool m_GDBDebugger = false;
+
+ private bool m_MakeBootCD = false;
+ private bool m_MakeLiveCD = false;
+
+ public RBuildOSImage()
+ {
+ Properties.Add("SARCH", "");
+ Properties.Add("OARCH", "pentium");
+ Properties.Add("OPTIMIZE", "1");
+ Properties.Add("MP", "0");
+ Properties.Add("KDBG", "0");
+ Properties.Add("DBG", "0");
+ Properties.Add("GDB", "0");
+ Properties.Add("NSWPAT", "0");
+ Properties.Add("NTLPC", "1");
+ Properties.Add("_WINKD_", "0");
+
+ Defines.Add ("_M_IX86");
+ Defines.Add ("_X86_");
+ Defines.Add ("__i386__");
+ Defines.Add ("_REACTOS_");
+
+ Includes.Add(".");
+ Includes.Add("include");
+ Includes.Add("include/psdk");
+ Includes.Add("include/dxsdk");
+ Includes.Add("include/crt");
+ Includes.Add("include/ddk");
+ Includes.Add("include/GL");
+ Includes.Add("include/ndk");
+ Includes.Add("include/reactos");
+ Includes.Add("include/reactos/libs");
+ }
+
+ public bool MakeLiveCD
+ {
+ get { return m_MakeLiveCD; }
+ set { m_MakeLiveCD = value; }
+ }
+
+ public bool MakeBootCD
+ {
+ get { return m_MakeBootCD; }
+ set { m_MakeBootCD = value; }
+ }
+
+ public RBuildLanguage Language
+ {
+ get { return m_Language; }
+ set { m_Language = value; }
+ }
+
+ public RosPlatform Platform
+ {
+ get { return m_Platform; }
+ set { m_Platform = value; }
+ }
+
+ public RosArchitecture Architecture
+ {
+ get { return m_Architecture; }
+ set { m_Architecture = value; }
+ }
+
+ public Dictionary Properties
+ {
+ get { return m_Properties; }
+ }
+
+ public List Defines
+ {
+ get { return m_Defines; }
+ }
+
+ public List Includes
+ {
+ get { return m_Includes; }
+ }
+
+ public string ReleaseType
+ {
+ get
+ {
+ if (m_Debug)
+ return "DBG";
+
+ return "RELEASE";
+ }
+ }
+
+ public string ImageType
+ {
+ get
+ {
+ if (m_MakeBootCD)
+ return "BootCD";
+
+ return "LiveCD";
+ }
+ }
+
+ public void SaveAs(string file)
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(file, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("project");
+ writer.WriteAttributeString("name", "ReactOS");
+ writer.WriteAttributeString("makefile", "makefile.auto");
+ writer.WriteAttributeString("xmlns", "xi", null, "http://www.w3.org/2001/XInclude");
+
+ writer.WriteComment("Generic Properties");
+ foreach (KeyValuePair property in Properties)
+ {
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", property.Key);
+ writer.WriteAttributeString("value", property.Value);
+ writer.WriteEndElement();
+ }
+
+ foreach (string define in Defines)
+ {
+ writer.WriteStartElement("define");
+ writer.WriteAttributeString("name", define);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "baseaddress.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "boot/bootdata/bootdata.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteElementString("compilerflag", "-Os");
+ writer.WriteElementString("compilerflag", "-ftracer");
+ writer.WriteElementString("compilerflag", "-momit-leaf-frame-pointer");
+ writer.WriteElementString("compilerflag", "-mpreferred-stack-boundary=2");
+
+ writer.WriteElementString("compilerflag", "-Wno-strict-aliasing");
+ writer.WriteElementString("compilerflag", "-Wpointer-arith");
+ writer.WriteElementString("linkerflag", "-enable-stdcall-fixup");
+
+ foreach (string include in Includes)
+ {
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("root", "intermediate");
+ writer.WriteString(include);
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("include");
+ writer.WriteString(include);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule module in Platform.Modules)
+ {
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", module.RBuildFile);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndElement(); //Project
+ writer.WriteEndDocument();
+ }
+
+ string a = Name;
+ }
+
+ public string Name
+ {
+ get {
+ return "";
+ //return string.Format("{0}_{1}{2}_{3}_{4}.iso",
+ // Platform.SafeName,
+ // Architecture.SafeName ,
+ // Language.CultureInfo.ThreeLetterISOLanguageName,
+ // ImageType,
+ // ReleaseType);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/RosPlatform.cs b/reactos/tools/sysgen/RosFramework/Obsolete/RosPlatform.cs
new file mode 100644
index 00000000000..2864a425bbf
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/RosPlatform.cs
@@ -0,0 +1,78 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RosPlatform
+ {
+ private List m_Modules = new List();
+
+ private string m_Name = null;
+ private string m_Base = null;
+
+ private RosPlatform m_ParentPlatform = null;
+
+ public RosPlatform()
+ {
+ m_Name = "ReactOS Core";
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Base
+ {
+ get { return m_Base; }
+ set { m_Base = value; }
+ }
+
+ public RosPlatform ParentPlatform
+ {
+ get { return m_ParentPlatform; }
+ set { m_ParentPlatform = value; }
+ }
+
+ public string SafeName
+ {
+ get { return Utility.GetSafeString(m_Name); }
+ }
+
+ public void SaveAs(string file)
+ {
+
+ }
+
+ public List Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public List ParentModules
+ {
+ get
+ {
+ List modules = new List();
+
+ if (ParentPlatform != null)
+ {
+ foreach (RBuildModule module in ParentPlatform.Modules)
+ {
+ modules.Add(module);
+ }
+
+ foreach (RBuildModule module in ParentPlatform.ParentModules)
+ {
+ modules.Add(module);
+ }
+ }
+
+ return modules;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Obsolete/SoftwareCatalog.cs b/reactos/tools/sysgen/RosFramework/Obsolete/SoftwareCatalog.cs
new file mode 100644
index 00000000000..5169cf21a55
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Obsolete/SoftwareCatalog.cs
@@ -0,0 +1,80 @@
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class SoftwareCatalog
+ {
+ public RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+
+ public SoftwareCatalog()
+ {
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public void LoadFromFile(string file)
+ {
+ XmlDocument doc = new XmlDocument();
+
+ //Load the file in to memory
+ doc.Load(file);
+
+ //Load modules ...
+ foreach (XmlNode node in doc.SelectNodes("/modules/module"))
+ {
+ RBuildModule module;
+
+ module = new RBuildModule();
+ module.Metadata = new RBuildMetadata();
+
+ module.Name = node.Attributes["name"].Value;
+ //module.Base = node.Attributes["base"].Value;
+ module.Metadata.Description = node.Attributes["desc"].Value;
+ //module.Rbuild = node.Attributes["rbuild"].Value;
+
+ /*
+ foreach (XmlNode dep in node.SelectNodes("provides/provide"))
+ {
+ string value = dep.SelectSingleNode("value").InnerText;
+ string type = dep.SelectSingleNode("type").InnerText;
+
+ module.Provides.Add(value, type);
+ }*/
+
+ m_Modules.Add(module);
+ }
+
+ foreach (XmlNode comp in doc.SelectNodes("/modules/module"))
+ {
+ // Get the component name....
+ string componentName = comp.Attributes["name"].Value;
+
+ foreach (XmlNode dep in comp.SelectNodes("dependencies/dependency"))
+ {
+ // Gets the dependency name
+ string dependencyName = dep.Attributes["name"].Value;
+
+ foreach (RBuildModule dependency in m_Modules)
+ {
+ if (dependency.Name == dependencyName)
+ {
+ foreach (RBuildModule module in m_Modules)
+ {
+ if (module.Name == componentName)
+ {
+ module.Libraries.Add(dependency);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/RosFramework/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..c9902b14d7b
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("RosFramework")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("RosFramework")]
+[assembly: AssemblyCopyright("Copyright © Sand 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("bc0dfcae-52a0-41f1-83b6-df64128d52b7")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/RosFramework/RBuildAPIInfo.cs b/reactos/tools/sysgen/RosFramework/RBuildAPIInfo.cs
new file mode 100644
index 00000000000..dc175f72398
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildAPIInfo.cs
@@ -0,0 +1,37 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildAPIInfo
+ {
+ private string m_Name;
+ private string m_File;
+ private bool m_Implemented;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string File
+ {
+ get { return m_File; }
+ set { m_File = value; }
+ }
+
+ public bool Implemented
+ {
+ get { return m_Implemented; }
+ set { m_Implemented = value; }
+ }
+
+ public string HtmlDocFileName
+ {
+ get { return string.Format("{0}.htm", Name); }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildAuthor.cs b/reactos/tools/sysgen/RosFramework/RBuildAuthor.cs
new file mode 100644
index 00000000000..eb504b687d6
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildAuthor.cs
@@ -0,0 +1,38 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum AuthorRole
+ {
+ Developer,
+ Mantainer,
+ Translator
+ }
+
+ public class RBuildAuthor
+ {
+ private AuthorRole m_AuthorRole = AuthorRole.Developer;
+ private RBuildContributor m_Contributor = null;
+
+ ///
+ /// The underlying contributor.
+ ///
+ public RBuildContributor Contributor
+ {
+ get { return m_Contributor; }
+ set { m_Contributor = value; }
+ }
+
+ ///
+ /// The author role.
+ ///
+ public AuthorRole Role
+ {
+ get { return m_AuthorRole; }
+ set { m_AuthorRole = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildAutoRegister.cs b/reactos/tools/sysgen/RosFramework/RBuildAutoRegister.cs
new file mode 100644
index 00000000000..8bc526a5f01
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildAutoRegister.cs
@@ -0,0 +1,106 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// Type of registration
+ ///
+ public enum AutoRegisterType : int
+ {
+ DllRegisterServer = 1,
+ DllInstall = 2,
+ Both = 3
+ }
+
+ public enum SetupApiFolder : int
+ {
+ SourceDrive = 1, //(the directory from which the INF file was installed)
+ OS = 10, //(%SystemRoot%)
+ System = 11, //(%SystemRoot%\system32)
+ Drivers = 12, //(%SystemRoot%\system32\drivers)
+ Inf = 17, //(%SystemRoot%\inf)
+ Help = 18, //(%SystemRoot%\Help)
+ Fonts = 20, //(%SystemRoot%\Fonts)
+ Root = 24, //(%SystemDrive%)
+ Shared = 25, //(%ALLUSERSPROFILE%\Shared Documents)
+ UserProfile = 53 //(%USERPROFILE%)
+ }
+
+ public enum SetupApiShellFolder : int
+ {
+ AllUsersApplicationData, // 16419 %ALLUSERSPROFILE%\Application Data
+ AllUsersDesktop, // 16409 %ALLUSERSPROFILE%\Desktop
+ AllUsersMyDocuments, // 16430 %ALLUSERSPROFILE%\Documents
+ AllUsersMyMusic, // 16437 %ALLUSERSPROFILE%\Documents\My Music
+ AllUsersMyPictures, // 16438 %ALLUSERSPROFILE%\Documents\My Pictures
+ AllUsersMyVideos, // 16439 %ALLUSERSPROFILE%\Documents\My Videos
+ AllUsersFavourites, // 16415 %ALLUSERSPROFILE%\Favorites
+ AllUsersStartMenu, // 16406 %ALLUSERSPROFILE%\Start Menu
+ AllUsersStartMenuPrograms, // 16407 %ALLUSERSPROFILE%\Start Menu\Programs
+ AllUsersStartMenuAdministrativeTools, // 16431 %ALLUSERSPROFILE%\Start Menu\Programs\Administrative Tools
+ AllUsersStartMenuStartup, // 16408 %ALLUSERSPROFILE%\Start Menu\Programs\Startup
+ AllUsersTemplates, // 16429 %ALLUSERSPROFILE%\Templates
+ UserApplicationData, // 16410 %USERPROFILE%\Application Data
+ UserCookies, // 16417 %USERPROFILE%\Cookies
+ UserDesktop, // 16384 %USERPROFILE%\Desktop
+ UserDesktop2, // 16400 %USERPROFILE%\Desktop
+ UserFavourites, // 16390 %USERPROFILE%\Favorites
+ UserLocalSettingsApplicationData, // 16412 %USERPROFILE%\Local Settings\Application Data
+ UserLocalSettingsMSCDBruning, // 16443 %USERPROFILE%\Local Settings\Application Data\Microsoft\CD Burning
+ UserHistory, // 16418 %USERPROFILE%\Local Settings\History
+ UserTemporaryInternetFiles, // 16416 %USERPROFILE%\Local Settings\Temporary Internet Files
+ UserMyDocuments, // 16389 %USERPROFILE%\My Documents
+ UserMyMusic, // 16397 %USERPROFILE%\My Documents\My Music
+ UserMyPictures, // 16423 %USERPROFILE%\My Documents\My Pictures
+ UserMyVideos, // 16398 %USERPROFILE%\My Documents\My Videos
+ UserNetHood, // 16403 %USERPROFILE%\NetHood
+ UserPrintHood, // 16411 %USERPROFILE%\PrintHood
+ UserRecent, // 16392 %USERPROFILE%\Recent
+ UserSendTo, // 16393 %USERPROFILE%\SendTo
+ UserStartMenu, // 16395 %USERPROFILE%\Start Menu
+ UserStartMenuPrograms, // 16386 %USERPROFILE%\Start Menu\Programs
+ UserStartMenuAdministrativeTools, // 16432 %USERPROFILE%\Start Menu\Programs\Administrative Tools
+ UserStartMenuStartup, // 16391 %USERPROFILE%\Start Menu\Programs\Startup
+ UserTemplates, // 16405 %USERPROFILE%\Templates
+ ProgramFiles, // 16422 %ProgramFiles%
+ ProgramFilesCommonFiles, // 16427 %ProgramFiles%\Common Files
+ SystenResources, // 16440 %SystemRoot%\Resources
+ SystemEnglishResources // 16441 %SystemRoot%\Resources\0409
+ }
+
+ ///
+ /// An autoregister element specifies that the generated executable should be
+ /// registered in the registry during second stage setup.
+ ///
+ public class RBuildAutoRegister
+ {
+ private AutoRegisterType m_AutoRegisterType = AutoRegisterType.Both;
+ private string m_InfSection = null;
+
+ ///
+ /// Name of section in syssetup.inf.
+ ///
+ public string InfSection
+ {
+ get { return m_InfSection; }
+ set { m_InfSection = value; }
+ }
+
+ ///
+ /// Type of registration.
+ ///
+ public AutoRegisterType Type
+ {
+ get { return m_AutoRegisterType; }
+ set { m_AutoRegisterType = value; }
+ }
+
+ public int RegistrationType
+ {
+ get { return (int)Type; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildBootstrapFile.cs b/reactos/tools/sysgen/RosFramework/RBuildBootstrapFile.cs
new file mode 100644
index 00000000000..07771b10d46
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildBootstrapFile.cs
@@ -0,0 +1,52 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// A bootstrap element specifies that the generated file should
+ /// be put on the bootable CD as a bootstrap file.
+ ///
+ public class RBuildBootstrapFile : RBuildCDFileBase
+ {
+ public RBuildBootstrapFile()
+ {
+ }
+
+ public RBuildBootstrapFile(string basePath , string name)
+ {
+ Base = basePath;
+ Name = name;
+ }
+
+ //public override RBuildFile CDNewFile
+ //{
+ // get
+ // {
+ // RBuildFile file = (RBuildFile)Clone();
+
+ // file.Name = NewName;
+ // file.Base = InstallBase;
+ // file.Root = PathRoot.CDOutput;
+
+ // return file;
+ // }
+ //}
+
+ //public virtual RBuildFile CDNewFile
+ //{
+ // get
+ // {
+ // RBuildFile file = (RBuildFile)Clone();
+
+ // file.Name = NewName;
+ // file.Base = InstallBase;
+ // file.Root = PathRoot.CDOutput;
+
+ // return file;
+ // }
+ //}
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildBuildFamily.cs b/reactos/tools/sysgen/RosFramework/RBuildBuildFamily.cs
new file mode 100644
index 00000000000..24014e0e2c7
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildBuildFamily.cs
@@ -0,0 +1,25 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildBuildFamily
+ {
+ private string m_Name = null;
+ private string m_Description = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildCDFile.cs b/reactos/tools/sysgen/RosFramework/RBuildCDFile.cs
new file mode 100644
index 00000000000..e8b34f00252
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildCDFile.cs
@@ -0,0 +1,14 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// A cdfile element specifies the name of a file that is to be put on the bootable CD.
+ ///
+ public class RBuildCDFile : RBuildCDFileBase
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildCDFileBase.cs b/reactos/tools/sysgen/RosFramework/RBuildCDFileBase.cs
new file mode 100644
index 00000000000..5f07e283027
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildCDFileBase.cs
@@ -0,0 +1,11 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildCDFileBase : RBuildOutputFile /*RBuildPlatformFile*/
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildCompilationUnit.cs b/reactos/tools/sysgen/RosFramework/RBuildCompilationUnit.cs
new file mode 100644
index 00000000000..2b1348b8c7b
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildCompilationUnit.cs
@@ -0,0 +1,24 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// A compilationunit element specifies that one or more source code
+ /// files are to be compiled as a single compilation unit.
+ ///
+ public class RBuildCompilationUnitFile : RBuildSourceFile , IRBuildSourceFilesContainer
+ {
+ private RBuildSourceFileCollection m_SourceFiles = new RBuildSourceFileCollection();
+
+ ///
+ /// Gets the collection of .
+ ///
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return m_SourceFiles; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildContributor.cs b/reactos/tools/sysgen/RosFramework/RBuildContributor.cs
new file mode 100644
index 00000000000..a881176f071
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildContributor.cs
@@ -0,0 +1,93 @@
+using System;
+using System.Text.RegularExpressions;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildContributor
+ {
+ private string m_FirstName = null;
+ private string m_LastName = null;
+ private string m_Alias = null;
+ private string m_City = null;
+ private string m_Country = null;
+ private string m_Mail = null;
+ private string m_Website = null;
+ private bool m_Active = true;
+
+ public string FirstName
+ {
+ get { return m_FirstName; }
+ set { m_FirstName = value; }
+ }
+
+ public string Website
+ {
+ get { return m_Website; }
+ set { m_Website = value; }
+ }
+
+ public string LastName
+ {
+ get { return m_LastName; }
+ set { m_LastName = value; }
+ }
+
+ public string Alias
+ {
+ get { return m_Mail; }
+ set { m_Mail = value; }
+ }
+
+ public string Mail
+ {
+ get { return m_Alias; }
+ set { m_Alias = value; }
+ }
+
+ public string City
+ {
+ get { return m_City; }
+ set { m_City = value; }
+ }
+
+ public string Country
+ {
+ get { return m_Country; }
+ set { m_Country = value; }
+ }
+
+ public bool Active
+ {
+ get { return m_Active; }
+ set { m_Active = value; }
+ }
+
+ public string FullName
+ {
+ get { return string.Format("{0} {1}", FirstName, LastName); }
+ }
+
+ public string HtmlDocFileName
+ {
+ get { return string.Format("{0}.htm", Alias); }
+ }
+
+ public bool HasAlias
+ {
+ get { return ((Alias != null) && (Alias.Length > 0)); }
+ }
+
+ public bool HasMail
+ {
+ get { return ((Mail != null) && (Mail.Length > 0)); }
+ }
+
+ public bool HasLocation
+ {
+ get { return ((City != null) && (City.Length > 0) && (Country != null) && (Country.Length > 0)); }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildDebugChannel.cs b/reactos/tools/sysgen/RosFramework/RBuildDebugChannel.cs
new file mode 100644
index 00000000000..6125c49bd48
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildDebugChannel.cs
@@ -0,0 +1,74 @@
+using System;
+using System.Text;
+using System.IO;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildDebugChannel
+ {
+ private string m_Name = null;
+ private bool m_Warn = true;
+ private bool m_Error = true;
+ private bool m_Trace = false;
+ private bool m_Fixme = true;
+
+ public RBuildDebugChannel()
+ {
+ }
+
+ public RBuildDebugChannel(string name)
+ {
+ m_Name = name;
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public bool Warn
+ {
+ get { return m_Warn; }
+ set { m_Warn = value; }
+ }
+
+ public bool Error
+ {
+ get { return m_Error; }
+ set { m_Error = value; }
+ }
+
+ public bool Trace
+ {
+ get { return m_Trace; }
+ set { m_Trace = value; }
+ }
+
+ public bool Fixme
+ {
+ get { return m_Fixme; }
+ set { m_Fixme = value; }
+ }
+
+ public string Text
+ {
+ get
+ {
+ StringBuilder sBuilder = new StringBuilder();
+
+ if (Warn)
+ sBuilder.AppendFormat("warn+{0},", Name);
+ if (Error)
+ sBuilder.AppendFormat("err+{0},", Name);
+ if (Trace)
+ sBuilder.AppendFormat("trace+{0},", Name);
+ if (Fixme)
+ sBuilder.AppendFormat("fix+{0},", Name);
+
+ return sBuilder.ToString();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildExportFunction.cs b/reactos/tools/sysgen/RosFramework/RBuildExportFunction.cs
new file mode 100644
index 00000000000..9e1868a01f5
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildExportFunction.cs
@@ -0,0 +1,47 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum CallingConventionType
+ {
+ None,
+ StdCall,
+ Pascal,
+ VarArgs
+ }
+
+ public class RBuildExportFunction
+ {
+ private string m_Ordinal;
+ private string m_FunctionName;
+ private CallingConventionType m_CallingConvention = CallingConventionType.None;
+ private bool m_Stub;
+
+ public string Ordinal
+ {
+ get { return m_Ordinal; }
+ set { m_Ordinal = value; }
+ }
+
+ public string FunctionName
+ {
+ get { return m_FunctionName; }
+ set { m_FunctionName = value; }
+ }
+
+ public CallingConventionType CallingConvention
+ {
+ get { return m_CallingConvention; }
+ set { m_CallingConvention = value; }
+ }
+
+ public bool IsStub
+ {
+ get { return m_Stub; }
+ set { m_Stub = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildFamily.cs b/reactos/tools/sysgen/RosFramework/RBuildFamily.cs
new file mode 100644
index 00000000000..067453a19df
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildFamily.cs
@@ -0,0 +1,18 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildFamily
+ {
+ private string m_FamilyName = null;
+
+ public string Name
+ {
+ get { return m_FamilyName; }
+ set { m_FamilyName = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildFile.cs b/reactos/tools/sysgen/RosFramework/RBuildFile.cs
new file mode 100644
index 00000000000..ed070b95ecf
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildFile.cs
@@ -0,0 +1,441 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum PathRoot
+ {
+ Default,
+ SourceCode,
+ Output,
+ Intermediate,
+ CDOutput,
+ Temporary,
+ Install,
+ BootCD,
+ LiveCD,
+ Platform
+ }
+
+ public enum SourceType
+ {
+ Unknown,
+ C,
+ CPP,
+ IDL,
+ Assembler,
+ NASM,
+ WineBuild,
+ WindResource,
+ MessageTable,
+ Header
+ }
+
+ public class RBuildFolder : RBuildFileSystemInfo
+ {
+ private List m_Contents = new List();
+
+ public RBuildFolder()
+ {
+ }
+
+ public RBuildFolder(RBuildFolder parentFolder , string name)
+ {
+ Root = parentFolder.Root;
+ Base = parentFolder.Base;
+ Name = name;
+ }
+
+ public RBuildFolder(PathRoot rootPath)
+ {
+ Root = rootPath;
+ //Base = ".";
+ }
+
+ public RBuildFolder (PathRoot rootPath, string basePath)
+ {
+ Root = rootPath;
+ Base = basePath;
+ }
+
+ public RBuildFolder Parent
+ {
+ get
+ {
+ RBuildFolder folder = null;
+
+ folder = new RBuildFolder();
+ folder.Base = Path.GetDirectoryName(FullPath);
+ folder.Name = "";
+ folder.Root = Root;
+
+ return folder;
+ // return new RBuildFolder(Root, Path.GetDirectoryName(Base), Name);
+ }
+ }
+
+ public List Contents
+ {
+ get { return m_Contents; }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("{0} - {1}", Root, FullPath);
+ }
+ }
+
+ public class RBuildSourceFile : RBuildFile, IComparable
+ {
+ private bool m_First = false;
+ private string m_Switches = string.Empty;
+
+ public string Switches
+ {
+ get { return m_Switches; }
+ set { m_Switches = value; }
+ }
+
+ public bool First
+ {
+ get { return m_First; }
+ set { m_First = value; }
+ }
+
+ public SourceType Type
+ {
+ get
+ {
+ if (IsC)
+ return SourceType.C;
+ if (IsCPP)
+ return SourceType.CPP;
+ if (IsAssembler)
+ return SourceType.Assembler;
+ if (IsNASM)
+ return SourceType.NASM;
+ if (IsWidl)
+ return SourceType.IDL;
+ if (IsWindResource)
+ return SourceType.WindResource;
+ if (IsWineBuild)
+ return SourceType.WineBuild;
+ if (IsMessageTable)
+ return SourceType.MessageTable;
+ if (IsHeader)
+ return SourceType.Header;
+
+ return SourceType.Unknown;
+ }
+ }
+
+ public bool CompilableObject
+ {
+ get
+ {
+ if (IsWidl)
+ return false;
+ if (IsMessageTable)
+ return false;
+
+ return true;
+ }
+ }
+
+ public bool IsCPP
+ {
+ get
+ {
+ switch (Extension)
+ {
+ case ".cc":
+ case ".cpp":
+ case ".cxx":
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ public bool IsWidl
+ {
+ get
+ {
+ if (Extension == ".idl")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsMessageTable
+ {
+ get
+ {
+ if (Extension == ".mc")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsHeader
+ {
+ get
+ {
+ if (Extension == ".h")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsWineBuild
+ {
+ get
+ {
+ if (Extension == ".spec")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsWindResource
+ {
+ get
+ {
+ if (Extension == ".rc")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsNASM
+ {
+ get
+ {
+ if (Extension == ".asm")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsAssembler
+ {
+ get
+ {
+ if (Extension == ".s")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsC
+ {
+ get
+ {
+ if (Extension == ".c")
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool IsCompilable
+ {
+ get { return (IsC || IsCPP || IsAssembler || IsNASM || IsWidl || IsWindResource || IsWineBuild || IsHeader); }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("{0} {1}" , Name , Type);
+ }
+
+ #region IComparable Members
+
+ public int CompareTo(object obj)
+ {
+ RBuildSourceFile source = (RBuildSourceFile)obj;
+
+ if (First != source.First)
+ {
+ if (source.First)
+ return 1;
+ else
+ return -1;
+ }
+
+ return 0;
+ }
+
+ #endregion
+ }
+
+ public class RBuildFile : RBuildFileSystemInfo
+ {
+ public RBuildFile()
+ {
+ }
+
+ public RBuildFile(RBuildElement element)
+ : base (element)
+ {
+ }
+
+ public string Extension
+ {
+ get { return Path.GetExtension(Name).Trim().ToLower(); }
+ }
+
+ public override object Clone()
+ {
+ RBuildFile file = new RBuildFile();
+
+ file.Base = Base;
+ file.Name = Name;
+ file.Root = Root;
+ file.Enabled = Enabled;
+
+ return file;
+ }
+
+ public RBuildFolder Folder
+ {
+ get { return new RBuildFolder(Root, Base); }
+ }
+ }
+
+ ///
+ /// Represents the base class for source-code , installable file , folder , include folder , cdfile taks ... from a build.
+ ///
+ public abstract class RBuildFileSystemInfo : ICloneable
+ {
+ protected RBuildElement m_Element = null;
+ protected PathRoot m_Root = PathRoot.Default;
+ protected string m_Name = string.Empty; //".";
+ protected string m_Base = string.Empty; //null;
+ protected bool m_Enabled = true;
+
+ public RBuildFileSystemInfo(RBuildElement element)
+ {
+ m_Element = element;
+ }
+
+ public RBuildFileSystemInfo()
+ {
+ }
+
+ private string NormalizePath(string path)
+ {
+ return path.Replace(
+ Path.AltDirectorySeparatorChar,
+ Path.DirectorySeparatorChar);
+ }
+
+ public string FullPath
+ {
+ get {
+
+ if (Base == null || Name == null)
+ {
+ int i = 10;
+ }
+
+ return NormalizePath(Path.Combine(Base, Name));
+ }
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set
+ {
+ if (value == null)
+ {
+ int i = 10;
+ }
+ m_Name = value; }
+ }
+
+ public string Base
+ {
+ get { return m_Base; }
+ set
+ {
+ if (value == null)
+ {
+ int i = 10;
+ }
+ m_Base = value;
+ }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+
+ //TODO : ELIMINAR
+ public RBuildElement Element
+ {
+ get { return m_Element; }
+ set { m_Element = value; }
+ }
+
+ public virtual PathRoot Root
+ {
+ get { return m_Root; }
+ set { m_Root = value; }
+ }
+
+ public string[] BasePathParts
+ {
+ get { return Base.Split(new char[] { '\\' }); }
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj is RBuildFileSystemInfo)
+ {
+ RBuildFileSystemInfo rfsInfo = obj as RBuildFileSystemInfo;
+
+ if ((rfsInfo.Base == Base) &&
+ (rfsInfo.Root == Root) &&
+ (rfsInfo.Name == Name))
+ {
+ return true;
+ }
+
+ if ((rfsInfo.FullPath == FullPath) && (rfsInfo.Root == Root))
+ {
+ return true;
+ }
+ }
+
+ // The instances are not equal
+ return false;
+ }
+
+ public override int GetHashCode()
+ {
+ return Base.GetHashCode() ^ Name.GetHashCode() ^ Root.GetHashCode ();
+ }
+
+ #region ICloneable Members
+
+ public virtual object Clone()
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildImportLibrary.cs b/reactos/tools/sysgen/RosFramework/RBuildImportLibrary.cs
new file mode 100644
index 00000000000..04d9508d25f
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildImportLibrary.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// An importlibrary element specifies that an import library should be
+ /// generated which other modules can use to link with the current module.
+ ///
+ public sealed class RBuildImportLibrary : RBuildFile
+ {
+ private string m_DllName = null;
+
+ ///
+ /// Creates a new instance of the .
+ ///
+ public RBuildImportLibrary()
+ {
+ }
+
+ public string DllName
+ {
+ get { return m_DllName; }
+ set { m_DllName = value; }
+ }
+
+ public bool IsSpecFile
+ {
+ get { return Name.EndsWith(".spec.def"); }
+ }
+
+ public string Definition
+ {
+ get { return Name; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildInfInstallerFile.cs b/reactos/tools/sysgen/RosFramework/RBuildInfInstallerFile.cs
new file mode 100644
index 00000000000..0eec49b37ae
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildInfInstallerFile.cs
@@ -0,0 +1,18 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInfInstallerFile : RBuildFile
+ {
+ private string m_InstallSection = "DefaultInstall";
+
+ public string InstallSection
+ {
+ get { return m_InstallSection; }
+ set { m_InstallSection = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildInstallFile.cs b/reactos/tools/sysgen/RosFramework/RBuildInstallFile.cs
new file mode 100644
index 00000000000..a401e126969
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildInstallFile.cs
@@ -0,0 +1,38 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInstallFile : RBuildPlatformFile
+ {
+ }
+
+ public class RBuildWallpaperFile : RBuildInstallFile
+ {
+ private string m_ID = null;
+
+ public RBuildWallpaperFile()
+ {
+ }
+
+ public RBuildWallpaperFile(string file)
+ {
+ Name = file;
+ }
+
+ public string ID
+ {
+ get
+ {
+ if (m_ID == null ||
+ m_ID == string.Empty)
+ return base.Name;
+
+ return m_ID;
+ }
+ set { m_ID = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildInstallFolder.cs b/reactos/tools/sysgen/RosFramework/RBuildInstallFolder.cs
new file mode 100644
index 00000000000..acc7918b249
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildInstallFolder.cs
@@ -0,0 +1,30 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildInstallFolder : RBuildFolder
+ {
+ private string m_ID = null;
+
+ public RBuildInstallFolder()
+ {
+ Root = PathRoot.Install;
+ }
+
+ public RBuildInstallFolder(string id, string name)
+ {
+ ID = id;
+ Name = name;
+ Root = PathRoot.Install;
+ }
+
+ public string ID
+ {
+ get { return m_ID; }
+ set { m_ID = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildLanguage.cs b/reactos/tools/sysgen/RosFramework/RBuildLanguage.cs
new file mode 100644
index 00000000000..0e0be1389f2
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildLanguage.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLanguage
+ {
+ private string m_Name = null;
+ private string m_LCID = null;
+
+ private CultureInfo m_CultureInfo = null;
+
+ public RBuildLanguage()
+ {
+ }
+
+ public RBuildLanguage(string name)
+ {
+ //IsoName = name;
+ Name = name;
+ }
+
+ public string LCID
+ {
+ get { return m_LCID; }
+ set { m_LCID = value; }
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public CultureInfo CultureInfo
+ {
+ get { return m_CultureInfo; }
+ }
+
+ //public string IsoName
+ //{
+ // get { return m_CultureInfo.Name; }
+ // set { m_CultureInfo = CultureInfo.GetCultureInfo(value); }
+ //}
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildLocalizationFile.cs b/reactos/tools/sysgen/RosFramework/RBuildLocalizationFile.cs
new file mode 100644
index 00000000000..cbc46aa5c99
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildLocalizationFile.cs
@@ -0,0 +1,34 @@
+using System;
+using System.Globalization;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildLocalizationFile : RBuildFile
+ {
+ private bool m_Dirty = false;
+ private CultureInfo m_CultureInfo = null;
+
+ public RBuildLocalizationFile()
+ {
+ }
+
+ public CultureInfo CultureInfo
+ {
+ get { return m_CultureInfo; }
+ }
+
+ public bool Dirty
+ {
+ get { return m_Dirty; }
+ set { m_Dirty = value; }
+ }
+
+ public string IsoName
+ {
+ get { return m_CultureInfo.Name; }
+ set { m_CultureInfo = CultureInfo.GetCultureInfo(value); }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildMetadata.cs b/reactos/tools/sysgen/RosFramework/RBuildMetadata.cs
new file mode 100644
index 00000000000..e828dbdc725
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildMetadata.cs
@@ -0,0 +1,18 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildMetadata
+ {
+ private string m_Description = null;
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildModule.cs b/reactos/tools/sysgen/RosFramework/RBuildModule.cs
new file mode 100644
index 00000000000..f7fcb2f504d
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildModule.cs
@@ -0,0 +1,1210 @@
+using System;
+using System.Xml;
+using System.IO;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Text;
+using System.ComponentModel;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum ModuleType
+ {
+ BuildTool = 0,
+ StaticLibrary = 1,
+ ObjectLibrary = 2,
+ Kernel = 3,
+ KernelModeDLL = 4,
+ KernelModeDriver = 5,
+ NativeDLL = 6,
+ NativeCUI = 7,
+ Win32DLL = 8,
+ Win32OCX = 9,
+ Win32CUI = 10,
+ Win32GUI = 11,
+ BootLoader = 12,
+ BootSector = 13,
+ Iso = 14,
+ LiveIso = 15,
+ Test = 16,
+ RpcServer = 17,
+ RpcClient = 18,
+ Alias = 19,
+ BootProgram = 20,
+ Win32SCR = 21,
+ IdlHeader = 23,
+ IsoRegTest = 24,
+ LiveIsoRegTest = 25,
+ EmbeddedTypeLib = 26,
+ ElfExecutable = 27,
+ RpcProxy = 28,
+ HostStaticLibrary = 29,
+ Cabinet = 30,
+ Package = 50,
+ ModuleGroup = 51,
+ PlatformProfile = 52,
+ KeyboardLayout,
+ MessageHeader,
+ IdlInterface
+ }
+
+ [DefaultPropertyAttribute("Name")]
+ public class RBuildModule : RBuildElement, IRBuildSourceFilesContainer//, IRBuildInstallable
+ {
+ private string m_InstallBase = ".";
+ private string m_InstallName = null;
+ private string m_BaseAddress = null;
+ private string m_EntryPoint = null;
+ private string m_AliasOf = null;
+ private string m_Extension = null;
+ private string m_BuildType = null;
+ private string m_Description = null;
+ private string m_LCID = null;
+ private string m_CDLabel = null;
+ private string m_OutputName = null;
+ private string m_CatalogPath = null;
+
+ private ModuleType m_Type = ModuleType.Win32CUI;
+
+ protected bool m_Enabled = true;
+ protected bool m_Unicode = false;
+ protected bool m_AllowWarnings = false;
+ protected bool m_IsStartupLib = false;
+ protected bool m_UnderscoreSymbols = false;
+ protected bool m_MangledSymbols = false;
+ protected bool m_HostBuild = false;
+
+ //protected RBuildInfInstallerFile m_InfInstallComponent = null;
+ protected RBuildFile m_LinkerScript = null;
+ protected RBuildSourceFile m_PrecompiledHeader = null;
+ protected RBuildAutoRegister m_AutoRegister = null;
+ protected RBuildSetupFile m_RBuildSetup = null;
+ protected RBuildImportLibrary m_ImportLibrary = null;
+ protected RBuildMetadata m_Metadata = null;
+ //protected RBuildInstallFolder m_InstallFolder = null;
+ protected RBuildBootstrapFile m_Bootstrap = null;
+ protected RBuildModule m_BootSectorModule = null;
+
+ private RBuildFamilyCollection m_Families = new RBuildFamilyCollection();
+ private RBuildAPIStatusCollection m_ApiInfo = new RBuildAPIStatusCollection();
+ private RBuildModuleCollection m_Dependencies = new RBuildModuleCollection();
+ private RBuildModuleCollection m_Libraries = new RBuildModuleCollection();
+ private RBuildModuleCollection m_Requeriments = new RBuildModuleCollection();
+ private RBuildSourceFileCollection m_SourceFiles = new RBuildSourceFileCollection();
+ private RBuildLocalizationFileCollection m_LocalizationFiles = new RBuildLocalizationFileCollection();
+ private RBuildExportedFunctionsCollection m_ExportedFunctions = new RBuildExportedFunctionsCollection();
+ private RBuildAuthorCollection m_Authors = new RBuildAuthorCollection();
+ private List m_RegistryKeys = new List();
+ private List m_CompilationUnits = new List();
+
+ //public void GenerateFromPath(string path)
+ //{
+ // m_Base = path;
+
+ // m_Path = System.IO.Path.GetFileName(path);
+ // m_Name = System.IO.Path.GetFileName(path);
+ //}
+
+ public RBuildSourceFile PreCompiledHeader
+ {
+ get
+ {
+ foreach (RBuildSourceFile file in SourceFiles)
+ {
+ if (file.Type == SourceType.Header)
+ return file;
+ }
+
+ return null;
+ }
+ }
+
+ public RBuildFile LinkerScript
+ {
+ get { return m_LinkerScript; }
+ set { m_LinkerScript = value; }
+ }
+
+ public RBuildBootstrapFile Bootstrap
+ {
+ get { return m_Bootstrap; }
+ set { m_Bootstrap = value; }
+ }
+
+ public bool IsBootstrap
+ {
+ get { return Bootstrap != null; }
+ }
+
+ //Hack:
+ public bool IsSpecialIncludedBootStrap
+ {
+ get { return (Name == "ntdll"); }
+ }
+
+ //Hack::
+ public bool IsSpecialExcludedBootStrap
+ {
+ get { return (Name == "hal"); }
+ }
+
+ public RBuildModule BootSector
+ {
+ get { return m_BootSectorModule; }
+ set { m_BootSectorModule = value; }
+ }
+
+ //public RBuildInstallFolder InstallFolder
+ //{
+ // get { return m_InstallFolder; }
+ // set { m_InstallFolder = value; }
+ //}
+
+ public RBuildMetadata Metadata
+ {
+ get { return m_Metadata; }
+ set { m_Metadata = value; }
+ }
+
+ public string Extension
+ {
+ get
+ {
+ if ((m_Extension == null) || (m_Extension == string.Empty))
+ return DefaultExtension;
+
+ return m_Extension;
+ }
+ set { m_Extension = value; }
+ }
+
+ public string DefaultExtension
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.StaticLibrary:
+ case ModuleType.HostStaticLibrary:
+ return ".a";
+ case ModuleType.ObjectLibrary:
+ return ".o";
+ case ModuleType.Kernel:
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32GUI:
+ return ".exe";
+ case ModuleType.Win32SCR:
+ return ".scr";
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.NativeDLL:
+ case ModuleType.Win32DLL:
+ return ".dll";
+ case ModuleType.Win32OCX:
+ return ".ocx";
+ case ModuleType.KernelModeDriver:
+ case ModuleType.BootLoader:
+ return ".sys";
+ case ModuleType.BootSector:
+ return ".o";
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ return ".iso";
+ case ModuleType.Test:
+ return ".exe";
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ return ".o";
+ case ModuleType.BuildTool:
+ return ".exe";
+ case ModuleType.Alias:
+ case ModuleType.BootProgram:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return string.Empty;
+ case ModuleType.EmbeddedTypeLib:
+ return ".tlb";
+ case ModuleType.Cabinet:
+ return ".cab";
+ default:
+ throw new Exception("Unknown module type");
+ }
+ }
+ }
+
+ public string CatalogPath
+ {
+ get
+ {
+ if (m_CatalogPath == null)
+ return Folder.Parent.FullPath;
+
+ return m_CatalogPath;
+ }
+ set { m_CatalogPath = value; }
+ }
+
+ public RBuildImportLibrary ImportLibrary
+ {
+ get { return m_ImportLibrary; }
+ set { m_ImportLibrary = value; }
+ }
+
+ public string AliasOf
+ {
+ get { return m_AliasOf; }
+ set { m_AliasOf = value; }
+ }
+
+ public string BuildType
+ {
+ get
+ {
+ if (m_BuildType == null)
+ m_BuildType = "BOOTPROG";
+
+ return m_BuildType;
+ }
+ set { m_BuildType = value; }
+ }
+
+ public string BaseAddress
+ {
+ get
+ {
+ if ((m_BaseAddress == null) || (m_BaseAddress == string.Empty))
+ return DefaultBaseAdress;
+
+ return m_BaseAddress;
+ }
+ set { m_BaseAddress = value; }
+ }
+
+ public string EntryPoint
+ {
+ get
+ {
+ if (string.IsNullOrEmpty(m_EntryPoint))
+ return DefaultEntrypoint;
+
+ return m_EntryPoint;
+ }
+ set { m_EntryPoint = value; }
+ }
+
+ public bool NoEntryPoint
+ {
+ get { return (EntryPoint == "0") || (EntryPoint == "0x0"); }
+ }
+
+ public string LinkerEntryPoint
+ {
+ get
+ {
+ if (NoEntryPoint)
+ return EntryPoint;
+
+ return string.Format("_{0}", EntryPoint);
+ }
+ }
+
+ public string HtmlDocFileName
+ {
+ get { return string.Format("{0}.htm", Name); }
+ }
+
+ public bool IsDefaultBaseAdress
+ {
+ get { return (BaseAddress == DefaultBaseAdress); }
+ }
+
+ public bool IsDefaultEntryPoint
+ {
+ get { return (EntryPoint == DefaultEntrypoint); }
+ }
+
+ public bool PCH
+ {
+ get { return (PreCompiledHeader != null); }
+ }
+
+ public bool CPlusPlus
+ {
+ get
+ {
+ foreach (RBuildSourceFile file in SourceFiles)
+ {
+ if ((file.Extension == ".cpp") ||
+ (file.Extension == ".cc") ||
+ (file.Extension == ".cxx"))
+ {
+ return true;
+ }
+ }
+
+ // This module does not contain C++ code
+ return false;
+ }
+ }
+
+ public bool IsRPC
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ public bool IsLibrary
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.HostStaticLibrary: //HACK
+ return true;
+ default:
+ return false;
+ }
+ }
+ }
+
+ public bool HasInstallBase
+ {
+ get { return InstallBase != null; }
+ }
+
+ public bool IsInstallable
+ {
+ get { return (IsDLL) || (IsApplication); }
+ }
+
+ public bool IsApplication
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ return true;
+ case ModuleType.KeyboardLayout:
+ case ModuleType.Kernel:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeDLL:
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.Test:
+ case ModuleType.BuildTool:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.BootProgram:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return false;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public bool IsDLL
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Kernel:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeDLL:
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.KeyboardLayout:
+ return true;
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Test:
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ case ModuleType.BuildTool:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.BootProgram:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return false;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public string DefaultBaseAdress
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Kernel:
+ return "0x80800000";
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ return "0x10000000";
+ case ModuleType.NativeDLL:
+ case ModuleType.NativeCUI:
+ case ModuleType.Win32CUI:
+ case ModuleType.Test:
+ return "0x00400000";
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ return "0x00400000";
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ return "0x00010000";
+ case ModuleType.BuildTool:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.BootProgram:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return string.Empty;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public string DefaultEntrypoint
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Kernel:
+ return "KiSystemStartup";
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ return "DriverEntry@8";
+ case ModuleType.NativeDLL:
+ return "DllMainCRTStartup@12";
+ case ModuleType.NativeCUI:
+ return "NtProcessStartup@4";
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ return "DllMain@12";
+ case ModuleType.Win32CUI:
+ case ModuleType.Test:
+ {
+ if (Unicode)
+ return "wmainCRTStartup";
+ return "mainCRTStartup";
+ }
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ {
+ if (Unicode)
+ return "wWinMainCRTStartup";
+ return "WinMainCRTStartup";
+ }
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.BuildTool:
+ case ModuleType.StaticLibrary:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.BootLoader:
+ case ModuleType.BootSector:
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcProxy:
+ case ModuleType.Alias:
+ case ModuleType.BootProgram:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.Cabinet:
+ case ModuleType.Package:
+ case ModuleType.ModuleGroup:
+ case ModuleType.PlatformProfile:
+ return string.Empty;
+ default:
+ throw new Exception("Unknown Module Type");
+ }
+ }
+ }
+
+ public bool IsBuildable
+ {
+ get { return Type != ModuleType.Package && Type != ModuleType.ModuleGroup && Type != ModuleType.PlatformProfile; }
+ }
+
+ public bool IncludeInAllTarget
+ {
+ get
+ {
+ if (Type == ModuleType.BootSector ||
+ Type == ModuleType.Iso ||
+ Type == ModuleType.LiveIso ||
+ Type == ModuleType.IsoRegTest ||
+ Type == ModuleType.LiveIsoRegTest ||
+ Type == ModuleType.Test ||
+ Type == ModuleType.Alias)
+ {
+ return false;
+ }
+
+ return true;
+ }
+ }
+
+ public bool LinksToCRuntimeLibrary
+ {
+ get
+ {
+ foreach (RBuildModule module in Libraries)
+ {
+ if ((module.Name == "libcntpr") ||
+ (module.Name == "crt"))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+ }
+
+ ///
+ /// Default root to use when someone references
+ /// this module by using include
+ ///
+ public PathRoot IncludeDefaultRoot
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ return PathRoot.Intermediate;
+ default:
+ return PathRoot.SourceCode;
+ }
+ }
+ }
+
+ ///
+ /// Gets the folder to be used when another object
+ /// references this module
+ ///
+ public PathRoot ReferenceDefaultRoot
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.BootSector:
+ case ModuleType.StaticLibrary:
+ case ModuleType.HostStaticLibrary:
+ return PathRoot.Intermediate;
+ default:
+ return PathRoot.Output;
+ }
+ }
+ }
+
+ ///
+ /// Gets the folder to be used when another objects
+ /// references the target file generated by this module
+ ///
+ public PathRoot TargetDefaultRoot
+ {
+ get
+ {
+ switch (Type)
+ {
+ case ModuleType.Iso:
+ case ModuleType.LiveIso:
+ case ModuleType.IsoRegTest:
+ case ModuleType.LiveIsoRegTest:
+ return PathRoot.Default;
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.BootSector:
+ case ModuleType.StaticLibrary:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.HostStaticLibrary:
+ return PathRoot.Intermediate;
+ default:
+ return PathRoot.Output;
+ }
+ }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+
+ public bool MangledSymbols
+ {
+ get { return m_MangledSymbols; }
+ set { m_MangledSymbols = value; }
+ }
+
+ public bool IsStartupLib
+ {
+ get { return m_IsStartupLib; }
+ set { m_IsStartupLib = value; }
+ }
+
+ public bool UnderscoreSymbols
+ {
+ get { return m_UnderscoreSymbols; }
+ set { m_UnderscoreSymbols = value; }
+ }
+
+ public bool Unicode
+ {
+ get { return m_Unicode; }
+ set { m_Unicode = value; }
+ }
+
+ public bool AllowWarnings
+ {
+ get { return m_AllowWarnings; }
+ set { m_AllowWarnings = value; }
+ }
+
+ /*
+ public RBuildFolder Folder
+ {
+ get { return new RBuildFolder(PathRoot.SourceCode, Base); }
+ }
+ */
+
+ ///
+ /// Gets the collection of .
+ ///
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return m_SourceFiles; }
+ set { m_SourceFiles = value; }
+ }
+
+ public RBuildLocalizationFileCollection LocalizationFiles
+ {
+ get { return m_LocalizationFiles; }
+ set { m_LocalizationFiles = value; }
+ }
+
+ public List RegistryKeys
+ {
+ get { return m_RegistryKeys; }
+ set { m_RegistryKeys = value; }
+ }
+
+ public RBuildAuthorCollection Authors
+ {
+ get { return m_Authors; }
+ set { m_Authors = value; }
+ }
+
+ public List CompilationUnits
+ {
+ get { return m_CompilationUnits; }
+ }
+
+ public RBuildExportedFunctionsCollection ExportedFunctions
+ {
+ get { return m_ExportedFunctions; }
+ }
+
+ public RBuildAPIStatusCollection ApiInfo
+ {
+ get { return m_ApiInfo; }
+ }
+
+ public RBuildFamilyCollection Families
+ {
+ get { return m_Families; }
+ }
+
+ public string ModulePath
+ {
+ get { return m_Path + @"\"; }
+ }
+
+ public RBuildFolder TargetFolder
+ {
+ get
+ {
+ RBuildFolder folder = null;
+
+ folder = new RBuildFolder();
+ folder.Root = TargetDefaultRoot;
+
+ //Las ISO son excepciones a la regla , generan su resultado en el raiz y no en la carpeta
+ //del módulo donde se encuentran
+ if (Type != ModuleType.Iso &&
+ Type != ModuleType.LiveIso &&
+ Type != ModuleType.IsoRegTest &&
+ Type != ModuleType.LiveIsoRegTest)
+ {
+ folder.Name = Folder.Name;
+ folder.Base = Folder.Base;
+ }
+
+ return folder;
+ }
+ }
+
+ public RBuildFile TargetFile
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Name = TargetName;
+ file.Base = TargetFolder.FullPath;
+ file.Root = TargetFolder.Root;
+
+ return file;
+ }
+ }
+
+ public RBuildFile Install
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = InstallBase;
+ file.Name = InstallName;
+ file.Root = PathRoot.Install;
+
+ return file;
+ }
+ }
+
+ public RBuildFile PlatformInstall
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = "%SystemRoot%\\" + InstallBase;
+ file.Name = InstallName;
+ file.Root = PathRoot.Platform;
+
+ return file;
+ }
+ }
+
+ public RBuildFile Dependency
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = Folder.FullPath;
+ file.Name = DependencyName;
+ file.Root = PathRoot.Intermediate; // ReferenceDefaultRoot;
+
+ return file;
+ }
+ }
+
+ public string CDLabel
+ {
+ get { return "ReactOS"; }
+ set { m_CDLabel = value; }
+ }
+
+ public string TargetName
+ {
+ get
+ {
+ if (OutputName != null)
+ return OutputName;
+
+ if (InstallName != null)
+ return InstallName;
+
+ return string.Format("{0}{1}", Name, Extension);
+ }
+ }
+
+ public string DependencyName
+ {
+ get
+ {
+ if (HasImportLibrary)
+ return string.Format("lib{0}.a" , Name);
+
+ //Get the regular name
+ return string.Format("{0}.a" , Name);
+ }
+ }
+
+ public string InstallBase
+ {
+ get { return m_InstallBase; }
+ set { m_InstallBase = value; }
+ }
+
+ public string InstallName
+ {
+ get { return m_InstallName; }
+ set { m_InstallName = value; }
+ }
+
+ public string OutputName
+ {
+ get { return m_OutputName; }
+ set { m_OutputName = value; }
+ }
+
+ public bool Host
+ {
+ get { return m_HostBuild; }
+ set { m_HostBuild = value; }
+ }
+
+ public bool HasImportLibrary
+ {
+ get { return (ImportLibrary != null) && (Type != ModuleType.StaticLibrary); }
+ }
+
+ public bool HasMessageTables
+ {
+ get
+ {
+ foreach (RBuildSourceFile source in SourceFiles)
+ if (source.Type == SourceType.MessageTable)
+ return true;
+
+ return false;
+ }
+ }
+
+ public bool HasIDLs
+ {
+ get
+ {
+ foreach (RBuildSourceFile source in SourceFiles)
+ if (source.Type == SourceType.IDL)
+ return true;
+
+ return false;
+ }
+ }
+
+ ///*
+ //public string[] BaseLocation
+ //{
+ // get { return Base.Split(new char[] { '\\' }); }
+ //}
+
+ //public string[] PathLocation
+ //{
+ // get
+ // {
+ // Uri uri = new Uri(Base , UriKind.Relative);
+
+ // return Base.Split(new char[] { '\\' });
+
+ // /*
+ // DirectoryInfo info = new DirectoryInfo(Base);
+ // return info.Parent.FullName.Split(new char[] { '\\' });
+ // */
+ // }
+ //}
+ //*/
+
+ public bool IsModuleInRoot
+ {
+ get { return Path == string.Empty; }
+ }
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+
+ public string LCID
+ {
+ get { return m_LCID; }
+ set { m_LCID = value; }
+ }
+
+ public RBuildModuleCollection Dependencies
+ {
+ get { return m_Dependencies; }
+ }
+
+ public RBuildModuleCollection Requeriments
+ {
+ get { return m_Requeriments; }
+ }
+
+ public RBuildModuleCollection Libraries
+ {
+ get { return m_Libraries; }
+ }
+
+ public RBuildModuleCollection Needs
+ {
+ get
+ {
+ RBuildModuleCollection modules = new RBuildModuleCollection();
+
+ modules.Add(Dependencies);
+ modules.Add(Libraries);
+ modules.Add(Requeriments);
+
+ return modules;
+ }
+ }
+
+ public ModuleType Type
+ {
+ get { return m_Type; }
+ set { m_Type = value; }
+ }
+
+ public RBuildSetupFile Setup
+ {
+ get { return m_RBuildSetup; }
+ set { m_RBuildSetup = value; }
+ }
+
+ public RBuildAutoRegister AutoRegister
+ {
+ get { return m_AutoRegister; }
+ set { m_AutoRegister = value; }
+ }
+
+ public string MakeFileTargetMacro
+ {
+ get { return string.Format("$({0}_TARGET)", Name); }
+ }
+
+ public string MakeFileTarget
+ {
+ get { return string.Format("{0}_TARGET", Name); }
+ }
+
+ public string MakeFileLibs
+ {
+ get { return string.Format("{0}_LIBS", Name); }
+ }
+
+ public string MakeFileLinkDeps
+ {
+ get { return string.Format("{0}_LINKDEPS", Name); }
+ }
+
+ public string MakeFileLinkDepsMacro
+ {
+ get { return string.Format("$({0}_LINKDEPS)", Name); }
+ }
+
+ public string MakeFileLibsMacro
+ {
+ get { return string.Format("$({0}_LIBS)", Name); }
+ }
+
+ public override void SaveAs(string moduleFile)
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(moduleFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+
+ writer.WriteComment("File autogenerated by RosBuilder 0.1");
+ writer.WriteStartElement("module");
+
+ writer.WriteAttributeString("name", Name);
+ writer.WriteAttributeString("type", Type.ToString());
+ writer.WriteAttributeString("installbase", InstallBase);
+ writer.WriteAttributeString("installname", InstallName);
+ writer.WriteAttributeString("unicode", Unicode.ToString());
+ writer.WriteAttributeString("allowwarnings", AllowWarnings.ToString());
+ writer.WriteAttributeString("underscoresymbols", UnderscoreSymbols.ToString());
+ writer.WriteAttributeString("baseadress", BaseAddress);
+ writer.WriteAttributeString("entrypoint", EntryPoint);
+ writer.WriteAttributeString("extension", Extension);
+ writer.WriteAttributeString("isstartuplib", IsStartupLib.ToString());
+ writer.WriteAttributeString("mangledsymbols", MangledSymbols.ToString());
+
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("base", Name);
+ writer.WriteString(".");
+ writer.WriteEndElement();
+
+ foreach (RBuildFolder include in IncludeFolders)
+ {
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("base", include.Base);
+ writer.WriteString(include.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildDefine define in Defines)
+ {
+ writer.WriteStartElement("define");
+ writer.WriteAttributeString("name", define.Name);
+
+ if (define.Name != string.Empty)
+ {
+ writer.WriteString(define.Value);
+ }
+
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule dependency in Dependencies)
+ {
+ writer.WriteStartElement("dependency");
+ writer.WriteString(dependency.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule library in Libraries)
+ {
+ writer.WriteStartElement("library");
+ writer.WriteString(library.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildSourceFile sourceFile in SourceFiles)
+ {
+ if (sourceFile.IsCompilable)
+ {
+ if (sourceFile.Switches != string.Empty)
+ {
+ writer.WriteAttributeString("switches", sourceFile.Switches);
+ }
+
+ writer.WriteStartElement("file");
+ writer.WriteString(sourceFile.Name);
+ writer.WriteEndElement();
+ }
+ }
+
+ if (PreCompiledHeader != null)
+ {
+ writer.WriteStartElement("pch");
+ writer.WriteString(PreCompiledHeader.Name);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndDocument();
+ }
+ }
+
+ public override string ToString()
+ {
+ return string.Format("Module : '{0}' Type : {1} Base : '{2}' Libraries : '{3}' Dependencies : '{4}' Requeriments : '{5}'",
+ Name,
+ Type,
+ Base,
+ Libraries.Count,
+ Dependencies.Count,
+ Requeriments.Count);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildModuleGroup.cs b/reactos/tools/sysgen/RosFramework/RBuildModuleGroup.cs
new file mode 100644
index 00000000000..a3c57c26c8a
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildModuleGroup.cs
@@ -0,0 +1,24 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildModuleGroup
+ {
+ private string m_Name = null;
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildModuleInfo.cs b/reactos/tools/sysgen/RosFramework/RBuildModuleInfo.cs
new file mode 100644
index 00000000000..c4c944e87fc
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildModuleInfo.cs
@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildModuleInfo
+ {
+ private string m_Name = string.Empty;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+ private string m_Base = string.Empty;
+
+ public string Base
+ {
+ get { return m_Base; }
+ set { m_Base = value; }
+ }
+ private string m_CatalogPath = string.Empty;
+
+ public string CatalogPath
+ {
+ get { return m_CatalogPath; }
+ set { m_CatalogPath = value; }
+ }
+ private ModuleType m_Type = ModuleType.BuildTool;
+
+ public ModuleType Type
+ {
+ get { return m_Type; }
+ set { m_Type = value; }
+ }
+
+ List m_Libraries = new List();
+ List m_Dependencies = new List();
+ List m_Requirements = new List();
+
+ public List Libraries
+ {
+ get { return m_Libraries; }
+ set { m_Libraries = value; }
+ }
+
+ public List Dependencies
+ {
+ get { return m_Dependencies; }
+ set { m_Dependencies = value; }
+ }
+
+ public List Requirements
+ {
+ get { return m_Requirements; }
+ set { m_Requirements = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildPlatform.cs b/reactos/tools/sysgen/RosFramework/RBuildPlatform.cs
new file mode 100644
index 00000000000..8940398da6e
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildPlatform.cs
@@ -0,0 +1,133 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum OptimizeLevelType : int
+ {
+ Level_0 = 0,
+ Level_1 = 1,
+ Level_2 = 2,
+ Level_3 = 3,
+ Level_4 = 4,
+ Level_5 = 5
+ }
+
+ public class RBuildPlatform
+ {
+ private string m_Name = "Unamed Platform";
+ private string m_Description = "This Platform has not yet a description";
+ private bool m_Debug = true;
+ private bool m_KDebug = true;
+ private bool m_GDB = false;
+ private bool m_NSWPAT = false;
+ private bool m_WINKD = false;
+ private OptimizeLevelType m_OptimizeLevelType = OptimizeLevelType.Level_1;
+ private RBuildModule m_ShellModule = null;
+ private RBuildModule m_ScreenSaverModule = null;
+ private RBuildLanguage m_Language = null;
+ private RBuildWallpaperFile m_Wallpaper = null;
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ private RBuildModuleCollection m_Autorun = new RBuildModuleCollection();
+ private RBuildLanguageCollection m_Languages = new RBuildLanguageCollection();
+ private RBuildDebugChannelCollection m_DebugChannels = new RBuildDebugChannelCollection();
+
+ public RBuildPlatform()
+ {
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Description
+ {
+ get { return m_Description; }
+ set { m_Description = value; }
+ }
+
+ public RBuildDebugChannelCollection DebugChannels
+ {
+ get { return m_DebugChannels; }
+ }
+
+ public RBuildModule Shell
+ {
+ get { return m_ShellModule; }
+ set { m_ShellModule = value; }
+ }
+
+ public RBuildModule Screensaver
+ {
+ get { return m_ScreenSaverModule; }
+ set { m_ScreenSaverModule = value; }
+ }
+
+ public RBuildLanguage Language
+ {
+ get { return m_Language; }
+ set { m_Language = value; }
+ }
+
+ public RBuildWallpaperFile Wallpaper
+ {
+ get { return m_Wallpaper; }
+ set { m_Wallpaper = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public RBuildModuleCollection AutorunModules
+ {
+ get { return m_Autorun; }
+ }
+
+ public RBuildLanguageCollection Languages
+ {
+ get { return m_Languages; }
+ }
+
+ public bool Debug
+ {
+ get { return m_Debug; }
+ set { m_Debug = value; }
+ }
+
+ public bool KDebug
+ {
+ get { return m_KDebug; }
+ set { m_KDebug = value; }
+ }
+
+ public bool GDB
+ {
+ get { return m_GDB; }
+ set { m_GDB = value; }
+ }
+
+ public bool NSWPAT
+ {
+ get { return m_NSWPAT; }
+ set { m_NSWPAT = value; }
+ }
+
+ public bool WINKD
+ {
+ get { return m_WINKD; }
+ set { m_WINKD = value; }
+ }
+
+ public OptimizeLevelType OptimizeLevel
+ {
+ get { return m_OptimizeLevelType; }
+ set { m_OptimizeLevelType = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/RBuildPlatformFile.cs b/reactos/tools/sysgen/RosFramework/RBuildPlatformFile.cs
new file mode 100644
index 00000000000..2e300fd4f30
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildPlatformFile.cs
@@ -0,0 +1,84 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildOutputFile : RBuildFile //, IRBuildInstallable
+ {
+ private string m_InstallBase = "."; //".";
+ private string m_NewName = null;
+
+ public string NewName
+ {
+ get
+ {
+ if (m_NewName == null)
+ return m_Name;
+ return m_NewName;
+ }
+ set { m_NewName = value; }
+ }
+
+ public string InstallBase
+ {
+ get { return m_InstallBase; }
+ set { m_InstallBase = value; }
+ }
+
+ public virtual RBuildFile CDNewFile
+ {
+ get
+ {
+ RBuildFile file = (RBuildFile)Clone();
+
+ file.Name = NewName;
+ file.Base = InstallBase;
+ file.Root = PathRoot.CDOutput;
+
+ return file;
+ }
+ }
+
+ public virtual RBuildFile NewFile
+ {
+ get
+ {
+ RBuildFile file = (RBuildFile)Clone();
+
+ file.Name = NewName;
+ file.Base = InstallBase;
+ file.Root = Root;
+
+ return file;
+ }
+ }
+ }
+
+ public class RBuildPlatformFile : RBuildOutputFile
+ {
+ //protected RBuildInstallFolder m_InstallFolder = null;
+
+ //public RBuildInstallFolder InstallFolder
+ //{
+ // get { return m_InstallFolder; }
+ // set { m_InstallFolder = value; }
+ //}
+
+ public RBuildFile PlatformInstall
+ {
+ get
+ {
+ RBuildFile file = null;
+
+ file = new RBuildFile();
+ file.Base = "%SystemRoot%\\" + InstallBase;
+ file.Name = Name;
+ file.Root = PathRoot.Platform;
+
+ return file;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildProject.cs b/reactos/tools/sysgen/RosFramework/RBuildProject.cs
new file mode 100644
index 00000000000..c771b923d95
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildProject.cs
@@ -0,0 +1,163 @@
+using System;
+using System.Text;
+using System.Xml;
+using System.Collections.Generic;
+
+namespace SysGen.RBuild.Framework
+{
+ ///
+ /// There can be one project per top-level XML build file.
+ /// A project can only be defined in a top-level xml build file.
+ ///
+ public class RBuildProject : RBuildElement
+ {
+ private RBuildContributorCollection m_Contributors = new RBuildContributorCollection();
+ private RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ private RBuildLanguageCollection m_Languages = new RBuildLanguageCollection();
+ private RBuildInstallFolderCollection m_InstallFolders = new RBuildInstallFolderCollection();
+ private RBuildBuildFamilyCollection m_BuildFamilies = new RBuildBuildFamilyCollection();
+ private RBuildPlatform m_Platform = new RBuildPlatform();
+ private RBuildDebugChannelCollection m_DebugChannels = new RBuildDebugChannelCollection();
+
+ private string m_PackagesFile = "obj-i386/reactos.dff";
+ private string m_MakeFile = "makefile.auto";
+
+ public RBuildProject()
+ {
+ Folder = new RBuildFolder(PathRoot.SourceCode);
+ }
+
+ ///
+ /// Filename of the GNU makefile that is to be created.
+ ///
+ public string MakeFile
+ {
+ get { return m_MakeFile; }
+ set { m_MakeFile = value; }
+ }
+
+ public string PackagesFile
+ {
+ get { return m_PackagesFile; }
+ set { m_PackagesFile = value; }
+ }
+
+ public RBuildDebugChannelCollection DebugChannels
+ {
+ get { return m_DebugChannels; }
+ }
+
+ public RBuildPlatform Platform
+ {
+ get { return m_Platform; }
+ set { m_Platform = value; }
+ }
+
+ public RBuildBuildFamilyCollection BuildFamilies
+ {
+ get { return m_BuildFamilies; }
+ set { m_BuildFamilies = value; }
+ }
+
+ public RBuildInstallFolderCollection InstallFolders
+ {
+ get { return m_InstallFolders; }
+ set { m_InstallFolders = value; }
+ }
+
+ public RBuildContributorCollection Contributors
+ {
+ get { return m_Contributors; }
+ set { m_Contributors = value; }
+ }
+
+ public RBuildModuleCollection Modules
+ {
+ get { return m_Modules; }
+ }
+
+ public RBuildLanguageCollection Languages
+ {
+ get { return m_Languages; }
+ }
+
+ public string MakeFileGCCOptions
+ {
+ get { return string.Format("{0}_GCCOPTIONS", Name); }
+ }
+
+ public string MakeFileGCCOptionsMacro
+ {
+ get { return string.Format("$({0}_GCCOPTIONS)", Name); }
+ }
+
+ public override void SaveAs(string projectFile)
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(projectFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteStartElement("project");
+ writer.WriteAttributeString("name", Name);
+ writer.WriteAttributeString("makefile", MakeFile);
+ writer.WriteAttributeString("xmlns", "xi", null, "http://www.w3.org/2001/XInclude");
+
+ /*
+ writer.WriteComment("Generic Properties");
+ foreach (KeyValuePair property in Properties)
+ {
+ writer.WriteStartElement("property");
+ writer.WriteAttributeString("name", property.Key);
+ writer.WriteAttributeString("value", property.Value);
+ writer.WriteEndElement();
+ }
+
+ foreach (string define in Defines)
+ {
+ writer.WriteStartElement("define");
+ writer.WriteAttributeString("name", define);
+ writer.WriteEndElement();
+ }*/
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "baseaddress.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", "boot/bootdata/bootdata.rbuild");
+ writer.WriteEndElement();
+
+ writer.WriteElementString("compilerflag", "-Os");
+ writer.WriteElementString("compilerflag", "-ftracer");
+ writer.WriteElementString("compilerflag", "-momit-leaf-frame-pointer");
+ writer.WriteElementString("compilerflag", "-mpreferred-stack-boundary=2");
+
+ writer.WriteElementString("compilerflag", "-Wno-strict-aliasing");
+ writer.WriteElementString("compilerflag", "-Wpointer-arith");
+ writer.WriteElementString("linkerflag", "-enable-stdcall-fixup");
+
+ foreach (RBuildFolder folder in IncludeFolders)
+ {
+ writer.WriteStartElement("include");
+ writer.WriteAttributeString("root", folder.Root.ToString());
+ writer.WriteString(folder.Name);
+ writer.WriteEndElement();
+ }
+
+ foreach (RBuildModule module in Modules)
+ {
+ writer.WriteStartElement("xi:include");
+ writer.WriteAttributeString("href", module.RBuildFile);
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndElement(); //Project
+ writer.WriteEndDocument();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildProperty.cs b/reactos/tools/sysgen/RosFramework/RBuildProperty.cs
new file mode 100644
index 00000000000..bbc996f00e0
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildProperty.cs
@@ -0,0 +1,104 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildProperty : RBuildValueKey
+ {
+ public RBuildProperty(string name, string value)
+ : base(name, value)
+ {
+ }
+
+ public RBuildProperty(string name, string value, bool readOnly)
+ : base(name, value, readOnly)
+ {
+ }
+
+ public RBuildProperty(string name, string value, bool readOnly, bool isInternal)
+ : base(name, value, readOnly, isInternal)
+ {
+ }
+ }
+
+ public class RBuildBaseAdress : RBuildProperty
+ {
+ public RBuildBaseAdress(string name, string value)
+ : base(name, value, true)
+ {
+ }
+ }
+
+ public class RBuildDefine : RBuildValueKey
+ {
+ public RBuildDefine(string name)
+ : base(name, string.Empty, true)
+ {
+ }
+
+ public RBuildDefine(string name, string value)
+ : base(name, value, true)
+ {
+ }
+ }
+
+ public abstract class RBuildValueKey
+ {
+ protected string m_Name = null;
+ protected string m_Value = null;
+ protected bool m_ReadOnly = false;
+ protected bool m_IsInternal = false;
+
+ public RBuildValueKey(string name, string value)
+ {
+ m_Name = name;
+ m_Value = value;
+ }
+
+ public RBuildValueKey(string name, string value, bool readOnly)
+ {
+ m_Name = name;
+ m_Value = value;
+ m_ReadOnly = readOnly;
+ }
+
+ public RBuildValueKey(string name, string value, bool readOnly, bool isInternal)
+ {
+ m_Name = name;
+ m_Value = value;
+ m_ReadOnly = readOnly;
+ m_IsInternal = isInternal;
+ }
+
+ public bool IsEmpty
+ {
+ get { return string.IsNullOrEmpty(Value); }
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Value
+ {
+ get { return m_Value; }
+ set { m_Value = value; }
+ }
+
+ public bool ReadOnly
+ {
+ get { return m_ReadOnly; }
+ set { m_ReadOnly = value; }
+ }
+
+ public bool Internal
+ {
+ get { return m_IsInternal; }
+ set { m_IsInternal = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildRegistryKey.cs b/reactos/tools/sysgen/RosFramework/RBuildRegistryKey.cs
new file mode 100644
index 00000000000..2f573be5409
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildRegistryKey.cs
@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using Microsoft.Win32;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildRegistryKey
+ {
+ private bool m_Enabled = true;
+ private bool m_LiveCD = true;
+ private bool m_BootCD = true;
+
+ private string m_KeyName = null;
+ private string m_KeyValue = null;
+
+ private RegistryHive m_RegistryHive = RegistryHive.ClassesRoot;
+ private RegistryValueKind m_RegistryValueKind = RegistryValueKind.Unknown;
+
+ public RBuildRegistryKey()
+ {
+ }
+
+ public bool LiveCD
+ {
+ get { return m_LiveCD; }
+ set { m_LiveCD = value; }
+ }
+
+ public bool BootCD
+ {
+ get { return m_BootCD; }
+ set { m_BootCD = value; }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+
+ public string KeyName
+ {
+ get { return m_KeyName; }
+ set { m_KeyName = value; }
+ }
+
+ public string KeyValue
+ {
+ get { return m_KeyValue; }
+ set { m_KeyValue = value; }
+ }
+
+ public RegistryHive RegistryHive
+ {
+ get { return m_RegistryHive; }
+ set { m_RegistryHive = value; }
+ }
+
+ public RegistryValueKind RegistryValueKind
+ {
+ get { return m_RegistryValueKind; }
+ set { m_RegistryValueKind = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildSetup.cs b/reactos/tools/sysgen/RosFramework/RBuildSetup.cs
new file mode 100644
index 00000000000..42dc5c18ed7
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildSetup.cs
@@ -0,0 +1,52 @@
+//using System;
+//using System.IO;
+//using System.Collections.Generic;
+//using System.Text;
+
+//namespace SysGen.RBuild.Framework
+//{
+// public enum SetupType
+// {
+// Device,
+// Component
+// }
+
+// public class RBuildSetup : RBuildPlatformFile
+// {
+// private SetupType m_SetupType = SetupType.Component;
+// private bool m_InstallAlways = true;
+// private string m_InstallSection = "DefaultInstall";
+
+// public SetupType SetupType
+// {
+// get { return m_SetupType; }
+// set { m_SetupType = value; }
+// }
+
+// public string InstallSection
+// {
+// get { return m_InstallSection; }
+// set { m_InstallSection = value; }
+// }
+
+// public string DefaultInstallSection
+// {
+// get
+// {
+// switch (SetupType)
+// {
+// case SetupType.Device:
+// return "DefaultInstall";
+// default:
+// return "DefaultInstall";
+// }
+// }
+// }
+
+// public bool InstallAlways
+// {
+// get { return m_InstallAlways; }
+// set { m_InstallAlways = value; }
+// }
+// }
+//}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildSetupFile.cs b/reactos/tools/sysgen/RosFramework/RBuildSetupFile.cs
new file mode 100644
index 00000000000..6bd9aee38c9
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildSetupFile.cs
@@ -0,0 +1,52 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum SetupType
+ {
+ Device,
+ Component
+ }
+
+ public class RBuildSetupFile : RBuildPlatformFile
+ {
+ private SetupType m_SetupType = SetupType.Component;
+ private bool m_InstallAlways = true;
+ private string m_InstallSection = "DefaultInstall";
+
+ public SetupType SetupType
+ {
+ get { return m_SetupType; }
+ set { m_SetupType = value; }
+ }
+
+ public string InstallSection
+ {
+ get { return m_InstallSection; }
+ set { m_InstallSection = value; }
+ }
+
+ public string DefaultInstallSection
+ {
+ get
+ {
+ switch (SetupType)
+ {
+ case SetupType.Device:
+ return "DefaultInstall";
+ default:
+ return "DefaultInstall";
+ }
+ }
+ }
+
+ public bool InstallAlways
+ {
+ get { return m_InstallAlways; }
+ set { m_InstallAlways = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildSolution.cs b/reactos/tools/sysgen/RosFramework/RBuildSolution.cs
new file mode 100644
index 00000000000..32d10134769
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildSolution.cs
@@ -0,0 +1,21 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class RBuildSolution
+ {
+ private List m_Projects = null;
+
+ ///
+ /// The projects this solution contains.
+ ///
+ public List Projects
+ {
+ get { return m_Projects; }
+ set { m_Projects = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildTarget.cs b/reactos/tools/sysgen/RosFramework/RBuildTarget.cs
new file mode 100644
index 00000000000..adf726165e3
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildTarget.cs
@@ -0,0 +1,274 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum TargetType
+ {
+ LiveCD,
+ BootCD
+ }
+
+ public enum TargetDebugOutputType
+ {
+ COM1,
+ COM2,
+ Screen,
+ Bochs
+ }
+
+ public enum TargetDebugType
+ {
+ None,
+ Debug,
+ KernelDebug
+ }
+
+ public enum TargetWindowsPlatformType
+ {
+ WindowsNT4 = 0x400,
+ Windows2000 = 0x500,
+ WindowsXP = 0x501,
+ Windows2003 = 0x0502,
+ WindowsVista = 0x600
+ }
+
+ public enum TargetWindowsSPType
+ {
+ NoServicePack,
+ ServicePack1 = 0x100,
+ ServicePack2 = 0x200,
+ ServicePack3 = 0x300,
+ ServicePack4 = 0x400,
+ ServicePack5 = 0x500,
+ ServicePack6 = 0x600,
+ ServicePack7 = 0x700,
+ ServicePack8 = 0x800,
+ ServicePack9 = 0x900
+ }
+
+ public enum TargetPlatformType
+ {
+ NT4, /* Windows NT 4.0 */
+ NT4_SP1,
+ NT4_SP2,
+ NT4_SP3,
+ NT4_SP4,
+ NT4_SP5,
+ NT4_SP6,
+ NT5, /* Windows 2000 */
+ NT5_SP1,
+ NT5_SP2,
+ NT5_SP3,
+ NT5_SP4,
+ NT51, /* Windows XP */
+ NT51_SP1,
+ NT51_SP2,
+ NT52, /* Windows 2003 */
+ NT52_SP1,
+ NT52_SP2,
+ NT6 /* Windows Vista */
+ }
+
+ public enum TargetArchitectureType
+ {
+ X86,
+ X86_i486,
+ X86_i586,
+ X86_Pentium,
+ X86_Pentium2,
+ X86_Pentium3,
+ X86_Pentium4,
+ X86_AthlonXP,
+ X86_AthlonMP,
+ X86_Xbox,
+ PPC
+ }
+
+ public enum TargetOptimizeLevelType
+ {
+ Level_0,
+ Level_1,
+ Level_2,
+ Level_3,
+ Level_4,
+ Level_5
+ }
+
+ public class RBuildTarget
+ {
+ private string m_Name = null;
+
+ private bool m_RegTest = false;
+ private bool m_Multiprocessor = false;
+
+ private TargetType m_Type = TargetType.BootCD;
+ private TargetDebugType m_DebugType = TargetDebugType.None;
+ private TargetPlatformType m_PlatformType = TargetPlatformType.NT5_SP4;
+ private TargetDebugOutputType m_DebugOutputType = TargetDebugOutputType.COM1;
+ private TargetArchitectureType m_ArchitectureType = TargetArchitectureType.X86_Pentium;
+ private TargetOptimizeLevelType m_OptimizeLevelType = TargetOptimizeLevelType.Level_1;
+
+ public RBuildTarget()
+ {
+ }
+
+ public RBuildTarget(string name)
+ {
+ m_Name = name;
+ }
+
+ public RBuildTarget(string name, TargetType type)
+ {
+ m_Name = name;
+ m_Type = type;
+ }
+
+ public RBuildTarget(string name, TargetType type, TargetDebugType debugType)
+ {
+ m_Name = name;
+ m_Type = type;
+ m_DebugType = debugType;
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public bool MultiProcessor
+ {
+ get { return m_Multiprocessor; }
+ set { m_Multiprocessor = value; }
+ }
+
+ public bool RegressionTest
+ {
+ get { return m_RegTest; }
+ set { m_RegTest = value; }
+ }
+
+ public bool Debug
+ {
+ get { return ((DebugType == TargetDebugType.Debug) || (DebugType == TargetDebugType.KernelDebug)); }
+ }
+
+ public bool KernelDebug
+ {
+ get { return (DebugType == TargetDebugType.KernelDebug); }
+ }
+
+ public TargetType Type
+ {
+ get { return m_Type; }
+ set { m_Type = value; }
+ }
+
+ public TargetDebugType DebugType
+ {
+ get { return m_DebugType; }
+ set { m_DebugType = value; }
+ }
+
+ public TargetDebugOutputType DebugOutputType
+ {
+ get { return m_DebugOutputType; }
+ set { m_DebugOutputType = value; }
+ }
+
+ public TargetPlatformType PlatformType
+ {
+ get { return m_PlatformType; }
+ set { m_PlatformType = value; }
+ }
+
+ public TargetArchitectureType ArchitectureType
+ {
+ get { return m_ArchitectureType; }
+ set { m_ArchitectureType = value; }
+ }
+
+ public TargetOptimizeLevelType OptimizeType
+ {
+ get { return m_OptimizeLevelType; }
+ set { m_OptimizeLevelType = value; }
+ }
+
+ public TargetWindowsSPType WindowsServicePack
+ {
+ get
+ {
+ switch (PlatformType)
+ {
+ case TargetPlatformType.NT4:
+ case TargetPlatformType.NT5:
+ case TargetPlatformType.NT51:
+ case TargetPlatformType.NT52:
+ case TargetPlatformType.NT6:
+ return TargetWindowsSPType.NoServicePack;
+ case TargetPlatformType.NT4_SP1:
+ case TargetPlatformType.NT5_SP1:
+ case TargetPlatformType.NT51_SP1:
+ case TargetPlatformType.NT52_SP1:
+ return TargetWindowsSPType.ServicePack1;
+ case TargetPlatformType.NT4_SP2:
+ case TargetPlatformType.NT5_SP2:
+ case TargetPlatformType.NT51_SP2:
+ case TargetPlatformType.NT52_SP2:
+ return TargetWindowsSPType.ServicePack2;
+ case TargetPlatformType.NT4_SP3:
+ case TargetPlatformType.NT5_SP3:
+ return TargetWindowsSPType.ServicePack3;
+ case TargetPlatformType.NT4_SP4:
+ case TargetPlatformType.NT5_SP4:
+ return TargetWindowsSPType.ServicePack4;
+ case TargetPlatformType.NT4_SP5:
+ return TargetWindowsSPType.ServicePack5;
+ case TargetPlatformType.NT4_SP6:
+ return TargetWindowsSPType.ServicePack6;
+ default:
+ throw new Exception("");
+ }
+ }
+ }
+
+ public TargetWindowsPlatformType WindowsPlatfom
+ {
+ get
+ {
+ switch (PlatformType)
+ {
+ case TargetPlatformType.NT4:
+ case TargetPlatformType.NT4_SP1:
+ case TargetPlatformType.NT4_SP2:
+ case TargetPlatformType.NT4_SP3:
+ case TargetPlatformType.NT4_SP4:
+ case TargetPlatformType.NT4_SP5:
+ case TargetPlatformType.NT4_SP6:
+ return TargetWindowsPlatformType.WindowsNT4;
+ case TargetPlatformType.NT5:
+ case TargetPlatformType.NT5_SP1:
+ case TargetPlatformType.NT5_SP2:
+ case TargetPlatformType.NT5_SP3:
+ case TargetPlatformType.NT5_SP4:
+ return TargetWindowsPlatformType.Windows2000;
+ case TargetPlatformType.NT51:
+ case TargetPlatformType.NT51_SP1:
+ case TargetPlatformType.NT51_SP2:
+ return TargetWindowsPlatformType.WindowsXP;
+ case TargetPlatformType.NT52:
+ case TargetPlatformType.NT52_SP1:
+ case TargetPlatformType.NT52_SP2:
+ return TargetWindowsPlatformType.Windows2003;
+ case TargetPlatformType.NT6:
+ return TargetWindowsPlatformType.WindowsVista;
+ default:
+ throw new Exception("");
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/RBuildUnAttendSetup.cs b/reactos/tools/sysgen/RosFramework/RBuildUnAttendSetup.cs
new file mode 100644
index 00000000000..a240dbda757
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/RBuildUnAttendSetup.cs
@@ -0,0 +1,102 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public enum InstallType : int
+ {
+ SkipMBRInstall = 0,
+ FloppyMBRInstall = 1,
+ HDDMBRInstall = 2
+ }
+
+ public class RBuildUnAttendSetup
+ {
+ private InstallType m_InstallType = InstallType.HDDMBRInstall;
+ private int m_DestinationDiskNumber = 0;
+ private int m_DestinationPartitionNumber = 1;
+ private bool m_FormatPartition;
+ private bool m_AutoPartition;
+ private bool m_DisableVmwDriverInstall;
+ private bool m_Enabled = false;
+ private string m_InstallDirectory;
+ private string m_FullName;
+ private string m_OrgName;
+ private string m_ComputerName;
+ private string m_AdminPassword;
+
+ public InstallType InstallType
+ {
+ get { return m_InstallType; }
+ set { m_InstallType = value; }
+ }
+
+ public int DestinationDiskNumber
+ {
+ get { return m_DestinationDiskNumber; }
+ set { m_DestinationDiskNumber = value; }
+ }
+
+ public int DestinationPartitionNumber
+ {
+ get { return m_DestinationPartitionNumber; }
+ set { m_DestinationPartitionNumber = value; }
+ }
+
+ public string InstallDirectory
+ {
+ get { return m_InstallDirectory; }
+ set { m_InstallDirectory = value; }
+ }
+
+ public string FullName
+ {
+ get { return m_FullName; }
+ set { m_FullName = value; }
+ }
+
+ public string OrgName
+ {
+ get { return m_OrgName; }
+ set { m_OrgName = value; }
+ }
+
+ public string ComputerName
+ {
+ get { return m_ComputerName; }
+ set { m_ComputerName = value; }
+ }
+
+ public string AdminPassword
+ {
+ get { return m_AdminPassword; }
+ set { m_AdminPassword = value; }
+ }
+
+ public bool FormatPartition
+ {
+ get { return m_FormatPartition; }
+ set { m_FormatPartition = value; }
+ }
+
+ public bool AutoPartition
+ {
+ get { return m_AutoPartition; }
+ set { m_AutoPartition = value; }
+ }
+
+ public bool DisableVmwDriverInstall
+ {
+ get { return m_DisableVmwDriverInstall; }
+ set { m_DisableVmwDriverInstall = value; }
+ }
+
+ public bool Enabled
+ {
+ get { return m_Enabled; }
+ set { m_Enabled = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj
new file mode 100644
index 00000000000..6ccaf2fe069
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj
@@ -0,0 +1,117 @@
+
+
+ Debug
+ AnyCPU
+ 9.0.30729
+ 2.0
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ Library
+ Properties
+ SysGen.RBuild.Framework
+ SysGen.RBuild.Framework
+
+
+ 2.0
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj.user b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj.user
new file mode 100644
index 00000000000..6a34e7dcdf5
--- /dev/null
+++ b/reactos/tools/sysgen/RosFramework/SysGen.RBuild.Framework.csproj.user
@@ -0,0 +1,5 @@
+
+
+ ShowAllFiles
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SYSGen/Backends/Backend.cs b/reactos/tools/sysgen/SYSGen/Backends/Backend.cs
new file mode 100644
index 00000000000..849137aa76d
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Backends/Backend.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SYSGen.Backends
+{
+ public abstract class Backend
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Backends/Catalog/CatalogBackend.cs b/reactos/tools/sysgen/SYSGen/Backends/Catalog/CatalogBackend.cs
new file mode 100644
index 00000000000..52bd011dd41
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Backends/Catalog/CatalogBackend.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SYSGen.Backends;
+
+namespace SYSGen.Backends.Catalog
+{
+ class CatalogBackend : Backend
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Backends/Mingw/MingwBackend.cs b/reactos/tools/sysgen/SYSGen/Backends/Mingw/MingwBackend.cs
new file mode 100644
index 00000000000..73c2ae3a7bd
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Backends/Mingw/MingwBackend.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SYSGen.Backends;
+
+namespace SYSGen.Backends.Mingw
+{
+ class MingwBackend : Backend
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Program.cs b/reactos/tools/sysgen/SYSGen/Program.cs
new file mode 100644
index 00000000000..c49fc075055
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Program.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SYSGen
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SYSGen/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/SYSGen/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..04c75a90f62
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SYSGen")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("SYSGen")]
+[assembly: AssemblyCopyright("Copyright © Sand 2007")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("eb4b0be6-5b08-4933-b932-61bf335383db")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/SYSGen/SYSGen.csproj b/reactos/tools/sysgen/SYSGen/SYSGen.csproj
new file mode 100644
index 00000000000..93452a30484
--- /dev/null
+++ b/reactos/tools/sysgen/SYSGen/SYSGen.csproj
@@ -0,0 +1,56 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {5AEA291F-D79C-4FC1-AA60-96C591658B85}
+ Exe
+ Properties
+ SYSGen
+ sysgen
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ RosFramework
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementArrayAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementArrayAttribute.cs
new file mode 100644
index 00000000000..3e2e2155fe8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementArrayAttribute.cs
@@ -0,0 +1,33 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Ian MacLean ( ian@maclean.ms )
+
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ /// Indicates that property should be treated as a xml arrayList for the task.
+ [AttributeUsage(AttributeTargets.Property, Inherited=true)]
+ public class BuildElementArrayAttribute : BuildElementAttribute {
+
+ public BuildElementArrayAttribute(string name) : base(name) {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementAttribute.cs
new file mode 100644
index 00000000000..5b453a063f2
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/BuildElementAttribute.cs
@@ -0,0 +1,50 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Ian MacLean ( ian@maclean.ms )
+
+namespace SysGen.BuildEngine.Attributes
+{
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml file set for the task.
+ [AttributeUsage(AttributeTargets.Property, Inherited=true)]
+ public class BuildElementAttribute : Attribute
+ {
+
+ string _name;
+ bool _required;
+
+ public BuildElementAttribute(string name)
+ {
+ Name = name;
+ }
+
+ public string Name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+ public bool Required
+ {
+ get { return _required; }
+ set { _required = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/ElementNameAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/ElementNameAttribute.cs
new file mode 100644
index 00000000000..a52f72ef520
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/ElementNameAttribute.cs
@@ -0,0 +1,45 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Ian MacLean (ian_maclean@another.com)
+
+namespace SysGen.BuildEngine.Attributes {
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that class should be treated as a NAnt element.
+ ///
+ /// Attach this attribute to a subclass of Element to have NAnt be able
+ /// to recognize it. The name should be short but must not confict
+ /// with any other element already in use.
+ ///
+ [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
+ public class ElementNameAttribute : Attribute {
+
+ string _name;
+
+ public ElementNameAttribute(string name) {
+ _name = name;
+ }
+
+ public string Name {
+ get { return _name; }
+ set { _name = value; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionAttribute.cs
new file mode 100644
index 00000000000..506cab8a400
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionAttribute.cs
@@ -0,0 +1,60 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ ///
+ /// Indicates that the method should be exposed as a function in NAnt build
+ /// files.
+ ///
+ ///
+ /// Attach this attribute to a method of a class that derives from
+ /// to have NAnt be able to recognize it.
+ ///
+ [AttributeUsage(AttributeTargets.Method, Inherited=false, AllowMultiple=false)]
+ public sealed class FunctionAttribute : Attribute {
+ #region Public Instance Constructors
+
+ ///
+ /// Initializes a new instance of the
+ /// class with the specified name.
+ ///
+ /// The name of the function.
+ /// is .
+ /// is a zero-length .
+ public FunctionAttribute(string name) {
+ if (name == null) {
+ throw new ArgumentNullException("name");
+ }
+
+ if (name.Trim().Length == 0) {
+ throw new ArgumentOutOfRangeException("name", name, "A zero-length string is not an allowed value.");
+ }
+
+ _name = name;
+ }
+
+ #endregion Public Instance Constructors
+
+ #region Public Instance Properties
+
+ ///
+ /// Gets or sets the name of the function.
+ ///
+ ///
+ /// The name of the function.
+ ///
+ public string Name {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ #endregion Public Instance Properties
+
+ #region Private Instance Fields
+
+ private string _name;
+
+ #endregion Private Instance Fields
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionSetAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionSetAttribute.cs
new file mode 100644
index 00000000000..0ac033f07e0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/FunctionSetAttribute.cs
@@ -0,0 +1,90 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ ///
+ /// Indicates that class should be treated as a set of functions.
+ ///
+ ///
+ /// Attach this attribute to a class that derives from
+ /// to have NAnt be able to recognize it as containing custom functions.
+ ///
+ [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
+ public sealed class FunctionSetAttribute : Attribute {
+ #region Public Instance Constructors
+
+ ///
+ /// Initializes a new instance of the
+ /// class with the specified name.
+ ///
+ /// The prefix used to distinguish the functions.
+ /// The category of the functions.
+ ///
+ /// is .
+ /// -or-
+ /// is .
+ ///
+ ///
+ /// is a zero-length .
+ /// -or-
+ /// is a zero-length .
+ ///
+ public FunctionSetAttribute(string prefix, string category) {
+ if (prefix == null) {
+ throw new ArgumentNullException("prefix");
+ }
+ if (category == null) {
+ throw new ArgumentNullException("category");
+ }
+
+ if (prefix.Trim().Length == 0) {
+ throw new ArgumentOutOfRangeException("prefix", prefix, "A zero-length string is not an allowed value.");
+ }
+ if (category.Trim().Length == 0) {
+ throw new ArgumentOutOfRangeException("category", category, "A zero-length string is not an allowed value.");
+ }
+
+ _prefix = prefix;
+ _category = category;
+ }
+
+ #endregion Public Instance Constructors
+
+ #region Public Instance Properties
+
+ ///
+ /// Gets or sets the category of the function set.
+ ///
+ ///
+ /// The name of the category of the function set.
+ ///
+ ///
+ /// This will be displayed in the user docs.
+ ///
+ public string Category {
+ get { return _category; }
+ set { _category = value; }
+ }
+
+ ///
+ /// Gets or sets the prefix of all functions in this function set.
+ ///
+ ///
+ /// The prefix of the functions in this function set.
+ ///
+ public string Prefix {
+ get { return _prefix; }
+ set { _prefix = value; }
+ }
+
+ #endregion Public Instance Properties
+
+ #region Private Instance Fields
+
+ private string _prefix;
+ private string _category;
+
+ #endregion Private Instance Fields
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskAttributeAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskAttributeAttribute.cs
new file mode 100644
index 00000000000..3242801bf09
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskAttributeAttribute.cs
@@ -0,0 +1,43 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml attribute for the task.
+ ///
+ /// Examples of how to specify task attributes
+ ///
+ /// // task XmlType default is string
+ /// [TaskAttribute("out", Required=true)]
+ /// string _out = null; // assign default value here
+ ///
+ /// [TaskAttribute("optimize")]
+ /// [BooleanValidator()]
+ /// // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)
+ /// string _optimize = Boolean.FalseString;
+ ///
+ /// [TaskAttribute("warnlevel")]
+ /// [Int32Validator(0,4)] // limit values to 0-4
+ /// // during ExecuteTask you can safely use Convert.ToInt32(_optimize)
+ /// string _warnlevel = "0";
+ ///
+ /// [FileSet("sources")]
+ /// FileSet _sources = new FileSet();
+ ///
+ /// NOTE: Attribute values must be of type of string if you want
+ /// to be able to have macros. The field stores the exact value during
+ /// InitializeTask. Just before ExecuteTask is called NAnt will expand
+ /// all the macros with the current values.
+ ///
+ [AttributeUsage( AttributeTargets.Property, Inherited=true)]
+ public class TaskAttributeAttribute : TaskPropertyAttribute {
+
+ public TaskAttributeAttribute(string name) : base(name){
+ }
+
+ public override TaskPropertyLocation Location
+ {
+ get { return TaskPropertyLocation.Attribute; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskFileSetAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskFileSetAttribute.cs
new file mode 100644
index 00000000000..fd9ad0cad05
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskFileSetAttribute.cs
@@ -0,0 +1,33 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Gerry Shaw (gerry_shaw@yahoo.com)
+// Ian MacLean ( ian@maclean.ms )
+
+namespace SysGen.BuildEngine.Attributes {
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml file set for the task.
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited=true)]
+ public class FileSetAttribute : BuildElementAttribute {
+
+ public FileSetAttribute(string name) : base(name) {
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskNameAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskNameAttribute.cs
new file mode 100644
index 00000000000..d46357f6892
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskNameAttribute.cs
@@ -0,0 +1,46 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ /// Indicates that class should be treated as a task.
+ ///
+ /// Attach this attribute to a subclass of Task to have NAnt be able
+ /// to recognize it. The name should be short but must not confict
+ /// with any other task already in use.
+ ///
+ [AttributeUsage(AttributeTargets.Class, Inherited=false, AllowMultiple=false)]
+ public class TaskNameAttribute : Attribute
+ {
+ private string m_Namespace = null;
+ private string m_Name = null;
+
+ public TaskNameAttribute(string name)
+ {
+ m_Name = name;
+ }
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string Namespace
+ {
+ get { return m_Namespace; }
+ set { m_Namespace = value; }
+ }
+
+ public string FullTaskName
+ {
+ get
+ {
+ if (Namespace != null)
+ return string.Format("{0}:{1}", Namespace, Name);
+
+ return Name;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskOptionSetAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskOptionSetAttribute.cs
new file mode 100644
index 00000000000..c62c48f3312
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskOptionSetAttribute.cs
@@ -0,0 +1,32 @@
+// NAnt - A .NET build tool
+// Copyright (C) 2001 Gerry Shaw
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// Tomas Restrepo (tomasr@mvps.org)
+
+namespace SysGen.BuildEngine.Attributes {
+
+ using System;
+ using System.Reflection;
+
+ /// Indicates that field should be treated as a xml option set for the task.
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited=true)]
+ public class OptionSetAttribute : BuildElementAttribute {
+
+ public OptionSetAttribute(string name) : base(name) {
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskPropertyAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskPropertyAttribute.cs
new file mode 100644
index 00000000000..6ee83ec2058
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskPropertyAttribute.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ public enum TaskPropertyLocation
+ {
+ Attribute,
+ Node
+ }
+
+ /// Indicates that field should be treated as a xml attribute for the task.
+ ///
+ /// Examples of how to specify task attributes
+ ///
+ /// // task XmlType default is string
+ /// [BuildAttribute("out", Required=true)]
+ /// string _out = null; // assign default value here
+ ///
+ /// [BuildAttribute("optimize")]
+ /// [BooleanValidator()]
+ /// // during ExecuteTask you can safely use Convert.ToBoolean(_optimize)
+ /// string _optimize = Boolean.FalseString;
+ ///
+ /// [BuildAttribute("warnlevel")]
+ /// [Int32Validator(0,4)] // limit values to 0-4
+ /// // during ExecuteTask you can safely use Convert.ToInt32(_optimize)
+ /// string _warnlevel = "0";
+ ///
+ /// [FileSet("sources")]
+ /// FileSet _sources = new FileSet();
+ ///
+ /// NOTE: Attribute values must be of type of string if you want
+ /// to be able to have macros. The field stores the exact value during
+ /// InitializeTask. Just before ExecuteTask is called NAnt will expand
+ /// all the macros with the current values.
+ ///
+ [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field , Inherited=true)]
+ public abstract class TaskPropertyAttribute : Attribute
+ {
+ string _name;
+ bool _required = false;
+ bool _expandProperties = true;
+
+ public TaskPropertyAttribute(string name) {
+ _name = name;
+ }
+
+ public string Name {
+ get { return _name; }
+ set { _name = value; }
+ }
+
+ public bool Required {
+ get { return _required; }
+ set { _required = value; }
+ }
+
+ public bool ExpandProperties {
+ get { return _expandProperties; }
+ set { _expandProperties = value; }
+ }
+
+ public abstract TaskPropertyLocation Location { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskValueAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskValueAttribute.cs
new file mode 100644
index 00000000000..9a00b764e17
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/TaskValueAttribute.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ [AttributeUsage(AttributeTargets.Property, Inherited = true)]
+ public class TaskValueAttribute : TaskPropertyAttribute
+ {
+ public TaskValueAttribute()
+ : base(null)
+ {
+ }
+
+ public override TaskPropertyLocation Location
+ {
+ get { return TaskPropertyLocation.Node; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Base/ValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Base/ValidatorAttribute.cs
new file mode 100644
index 00000000000..21592caa508
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Base/ValidatorAttribute.cs
@@ -0,0 +1,16 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ public abstract class ValidatorAttribute : Attribute
+ {
+ ///
+ /// Validates the object.
+ ///
+ /// The object to be validated
+ /// Throws a ValidationException when validation fails.
+ /// Returns an indication of the result.
+ public abstract bool Validate(object value);
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/BooleanValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/BooleanValidatorAttribute.cs
new file mode 100644
index 00000000000..a77c4044db3
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/BooleanValidatorAttribute.cs
@@ -0,0 +1,21 @@
+namespace SysGen.BuildEngine.Attributes
+{
+ using System;
+ using System.Reflection;
+
+ ///
+ /// Indicates that field should be able to be converted into a Boolean.
+ ///
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property , Inherited=true)]
+ public class BooleanValidatorAttribute : ValidatorAttribute
+ {
+ public BooleanValidatorAttribute()
+ {
+ }
+
+ public override bool Validate(object value)
+ {
+ return SysGenConversion.ToBolean(value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Int32ValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Int32ValidatorAttribute.cs
new file mode 100644
index 00000000000..0336016ff3d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/Int32ValidatorAttribute.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ ///
+ /// Indicates that field should be able to be converted into a Int32 within the given range.
+ ///
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
+ public class Int32ValidatorAttribute : ValidatorAttribute
+ {
+ int _minValue = Int32.MinValue;
+ int _maxValue = Int32.MaxValue;
+
+ public Int32ValidatorAttribute()
+ {
+ }
+
+ public Int32ValidatorAttribute(int minValue, int maxValue)
+ {
+ MinValue = minValue;
+ MaxValue = maxValue;
+ }
+
+ public int MinValue
+ {
+ get { return _minValue; }
+ set { _minValue = value; }
+ }
+
+ public int MaxValue
+ {
+ get { return _maxValue; }
+ set { _maxValue = value; }
+ }
+
+ public override bool Validate(object value)
+ {
+ try
+ {
+ Int32 intValue = Convert.ToInt32(value);
+ if (intValue < MinValue || intValue > MaxValue)
+ {
+ throw new ValidationException(String.Format("Cannot resolve '{0}' to integer between '{1}' and '{2}'.", value.ToString(), MinValue, MaxValue));
+ }
+ }
+ catch (Exception)
+ {
+ throw new ValidationException(String.Format("Cannot resolve '{0}' to integer value.", value.ToString()));
+ }
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/StringValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/StringValidatorAttribute.cs
new file mode 100644
index 00000000000..be617dee875
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/StringValidatorAttribute.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
+ public class StringValidatorAttribute : ValidatorAttribute
+ {
+ private bool m_AllowEmpty = true;
+ private bool m_AllowSpaces = true;
+
+ public override bool Validate(object value)
+ {
+ if (!AllowSpaces && string.Equals(value, " "))
+ throw new ValidationException("No spaces allowed");
+
+ if (!AllowEmpty && value.ToString().Length == 0)
+ throw new ValidationException("No empty string allowed");
+
+ return true;
+ }
+
+ public bool AllowEmpty
+ {
+ get { return m_AllowEmpty; }
+ set { m_AllowEmpty = value; }
+ }
+
+ public bool AllowSpaces
+ {
+ get { return m_AllowSpaces; }
+ set { m_AllowSpaces = value; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/UriValidatorAttribute.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/UriValidatorAttribute.cs
new file mode 100644
index 00000000000..54da6e52690
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Attributes/Validators/UriValidatorAttribute.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Reflection;
+
+namespace SysGen.BuildEngine.Attributes
+{
+ ///
+ /// Indicates that field should be able to be converted into a Uri.
+ ///
+ [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property, Inherited = true)]
+ public class UriValidatorAttribute : ValidatorAttribute
+ {
+ public override bool Validate(object value)
+ {
+ try
+ {
+ Uri uriValue = new Uri(value.ToString(), UriKind.Relative);
+ }
+ catch (Exception)
+ {
+ throw new ValidationException(String.Format("Cannot resolve '{0}' to Uri.", value.ToString()));
+ }
+
+ return true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/APIDocumentation/APIDocumentation.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/APIDocumentation/APIDocumentation.cs
new file mode 100644
index 00000000000..330f3d65ef6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/APIDocumentation/APIDocumentation.cs
@@ -0,0 +1,395 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class APIDocumentation : HtmlDocumenterBaseBacked
+ {
+ public APIDocumentation(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ if (Directory.Exists(@"C:\rosLib"))
+ Directory.Delete(@"C:\rosLib", true);
+
+ Directory.CreateDirectory(@"C:\rosLib");
+
+ File.Copy(@"c:\style.css", @"c:\rosLib\style.css");
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "APIDocumentation Report"; }
+ }
+
+ private void WriteModuleFunctions()
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.IsDLL || module.IsLibrary)
+ {
+ foreach (RBuildAPIInfo apiInfo in module.ApiInfo)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\" + apiInfo.HtmlDocFileName))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Module");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0} Function", apiInfo.Name);
+ writer.RenderEndTag();
+
+ if (apiInfo.Implemented)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Function '{0}' on '{1}' is currently implemented.",
+ apiInfo.Name,
+ apiInfo.File);
+ writer.RenderEndTag();
+ }
+ else
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Function '{0}' on '{1}' is currently un-implemented.",
+ apiInfo.Name,
+ apiInfo.File);
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ private void WriteModules()
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.IsDLL || module.IsLibrary)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\" + module.HtmlDocFileName))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Module");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0}", module.Name);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Module {0} has a total of {1} functions , {2} implemented and {3} un-implemented ({4}%)",
+ module.Name,
+ module.ApiInfo.TotalFunctions,
+ module.ApiInfo.ImplementedFunctionsCount,
+ module.ApiInfo.UnImplementedFunctionsCount,
+ module.ApiInfo.Percentage);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0} Functions", module.Name);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildAPIInfo apiInfo in module.ApiInfo)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", apiInfo.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(apiInfo.Name);
+ writer.RenderEndTag();
+
+ if (!apiInfo.Implemented)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.B);
+ writer.Write("(UnImplemented)");
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+ }
+
+ private void WriteWelcome()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\welcome.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Warnings");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("ReactOS API Documentation");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Welcome to the ReactOS API documentation website.");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H1);
+ writer.Write("Implementation status Color Key");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "5");
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "0");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ for (int i = 0; i <= 100; i = i + 5)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct" + i);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("{0}%" , i);
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Native DLLs");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.NativeDLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Win32 DLLs");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.Win32DLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void WriteHeader()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\header.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ writer.WriteLine("ReactOS API Documentation
");
+ }
+ }
+ }
+
+ private void WriteFrameSet()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\default.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ writer.WriteLine("");
+ }
+ }
+ }
+
+ private void ReadApiStatusFile()
+ {
+ XmlDocument doc = new XmlDocument();
+
+ //Load the file in to memory
+ doc.Load(@"C:\Ros\clean\reactos\apistatus.xml");
+
+ foreach (XmlNode comp in doc.SelectNodes("/components/component"))
+ {
+ // Get the component name....
+ string modulename = comp.Attributes["name"].InnerText;
+
+ RBuildModule module = Project.Modules.GetByName(modulename);
+
+ if (module != null)
+ {
+ foreach (XmlNode dep in comp.SelectNodes("functions/f"))
+ {
+ // Gets the dependency name
+ string name = dep.Attributes["n"].InnerText;
+ string file = dep.Attributes["f"].InnerText;
+ bool imp = Boolean.Parse(dep.Attributes["i"].InnerText);
+
+ RBuildAPIInfo apiInfo = new RBuildAPIInfo();
+
+ apiInfo.Name = name;
+ apiInfo.File = file;
+ apiInfo.Implemented = imp;
+
+ module.ApiInfo.Add(apiInfo);
+ }
+ }
+ }
+ }
+
+ protected override void Generate()
+ {
+ ReadApiStatusFile();
+ WriteFrameSet();
+ WriteHeader();
+ WriteWelcome();
+ WriteModules();
+ WriteModuleFunctions();
+
+ using (StreamWriter sw = new StreamWriter(@"C:\roslib\tree.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Warnings");
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "2");
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "2");
+ writer.AddAttribute(HtmlTextWriterAttribute.Border, "0");
+ //writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if ((module.IsDLL) || (module.IsLibrary))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+
+ if ((module.ApiInfo.Percentage >= 0) && (module.ApiInfo.Percentage <= 5))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct0");
+ if ((module.ApiInfo.Percentage >= 5) && (module.ApiInfo.Percentage <= 10))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct5");
+ if ((module.ApiInfo.Percentage >= 10) && (module.ApiInfo.Percentage <= 15))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct10");
+ if ((module.ApiInfo.Percentage >= 15) && (module.ApiInfo.Percentage <= 20))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct15");
+ if ((module.ApiInfo.Percentage >= 20) && (module.ApiInfo.Percentage <= 25))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct20");
+ if ((module.ApiInfo.Percentage >= 25) && (module.ApiInfo.Percentage <= 30))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct25");
+ if ((module.ApiInfo.Percentage >= 30) && (module.ApiInfo.Percentage <= 35))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct30");
+ if ((module.ApiInfo.Percentage >= 35) && (module.ApiInfo.Percentage <= 40))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct35");
+ if ((module.ApiInfo.Percentage >= 40) && (module.ApiInfo.Percentage <= 45))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct40");
+ if ((module.ApiInfo.Percentage >= 45) && (module.ApiInfo.Percentage <= 50))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct45");
+ if ((module.ApiInfo.Percentage >= 50) && (module.ApiInfo.Percentage <= 55))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct50");
+ if ((module.ApiInfo.Percentage >= 55) && (module.ApiInfo.Percentage <= 60))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct55");
+ if ((module.ApiInfo.Percentage >= 60) && (module.ApiInfo.Percentage <= 65))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct60");
+ if ((module.ApiInfo.Percentage >= 65) && (module.ApiInfo.Percentage <= 70))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct65");
+ if ((module.ApiInfo.Percentage >= 70) && (module.ApiInfo.Percentage <= 75))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct70");
+ if ((module.ApiInfo.Percentage >= 75) && (module.ApiInfo.Percentage <= 80))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct75");
+ if ((module.ApiInfo.Percentage >= 80) && (module.ApiInfo.Percentage <= 85))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct80");
+ if ((module.ApiInfo.Percentage >= 85) && (module.ApiInfo.Percentage <= 90))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct85");
+ if ((module.ApiInfo.Percentage >= 90) && (module.ApiInfo.Percentage <= 95))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct90");
+ if ((module.ApiInfo.Percentage >= 95) && (module.ApiInfo.Percentage <= 100))
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "pct100");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+
+ if (module.ApiInfo.Count > 0)
+ {
+ writer.AddAttribute("href", module.HtmlDocFileName);
+ writer.AddAttribute("target", "content");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+
+ writer.Write(" (I:{0} U:{1} P:{2}%)",
+ module.ApiInfo.ImplementedFunctionsCount,
+ module.ApiInfo.UnImplementedFunctionsCount,
+ module.ApiInfo.Percentage);
+ }
+ else
+ {
+ writer.Write(module.Name);
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ if (module.ApiInfo.Count > 0)
+ {
+ foreach (RBuildAPIInfo apiInfo in module.ApiInfo)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute("href", apiInfo.HtmlDocFileName);
+ writer.AddAttribute("target", "content");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(apiInfo.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ else
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write("No documentation available yet");
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/Backend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/Backend.cs
new file mode 100644
index 00000000000..5811c6fc253
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/Backend.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Reflection;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Log;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public abstract class Backend
+ {
+ private SysGenEngine m_SysGenEngine = null;
+
+ public Backend(SysGenEngine sysgen)
+ {
+ m_SysGenEngine = sysgen;
+ }
+
+ public SysGenEngine SysGen
+ {
+ get { return m_SysGenEngine; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_SysGenEngine.Project; }
+ }
+
+ public string AppInfo
+ {
+ get { return string.Format("{0} {1}", AppName, AppVersion); }
+ }
+
+ public string AppName
+ {
+ get { return "SysGen"; }
+ }
+
+ public string AppVersion
+ {
+ get
+ {
+ FileVersionInfo info = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
+
+ return string.Format("{0}.{1}.{2}",
+ info.FileMajorPart,
+ info.FileMinorPart,
+ info.FileBuildPart);
+ }
+ }
+
+ protected abstract string FriendlyName { get;}
+ //protected abstract string Name { get;}
+
+ public void Run()
+ {
+ BuildLog.WriteLine();
+ BuildLog.Write("[Backend] {0} running ...", FriendlyName);
+
+ try
+ {
+ //Run current Backend
+ Generate();
+
+ //Report OK
+ BuildLog.Write("{0,30}", "[OK]");
+ }
+ catch (Exception e)
+ {
+ //Report OK
+ BuildLog.Write("{0,30}", "[FAIL]");
+ throw;
+ }
+ }
+
+ protected abstract void Generate();
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/CompilerBaseBacked.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/CompilerBaseBacked.cs
new file mode 100644
index 00000000000..9c1d05417e9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/CompilerBaseBacked.cs
@@ -0,0 +1,160 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public abstract class CompilerBaseBacked : Backend
+ {
+ public CompilerBaseBacked(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ //Initialize();
+ }
+
+ protected override void Generate()
+ {
+ CheckCompiler();
+ GenerateRosCfg();
+ GenerateFolders();
+ //GenerateBuildNumber();
+ //GenerateCompilationUnits();
+ GenerateTxtSetupCustomHive();
+ GenerateSysSetup();
+ GenerateTxtSetup();
+ GenerateDffSetup();
+ }
+
+ protected virtual void GenerateCompilationUnits()
+ {
+ foreach (RBuildModule module in SysGen.Project.Modules)
+ {
+ foreach (RBuildCompilationUnitFile unit in module.CompilationUnits)
+ {
+ using (CompilationUnitFileWriter writer = new CompilationUnitFileWriter(module , unit , SysGen.ResolveRBuildFilePath(unit)))
+ {
+ writer.WriteFile();
+ }
+ }
+ }
+ }
+
+ protected virtual void GenerateRosCfg()
+ {
+ Directory.CreateDirectory (Project.Path + "\\obj-i386\\include\\reactos");
+
+ using (HeaderRosCfgFileWriter writer = new HeaderRosCfgFileWriter(SysGen.Project, Project.Path + "\\obj-i386\\include\\reactos\\roscfg.h"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateDffSetup()
+ {
+ using (DffFileWriter writer = new DffFileWriter(Project, Project.Path + "\\obj-i386\\reactos.dff"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateBuildNumber()
+ {
+ using (DffFileWriter writer = new DffFileWriter(SysGen.Project, "c:\\buildno.h"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateTxtSetup()
+ {
+ using (TxtSetupFileWriter writer = new TxtSetupFileWriter(SysGen.Project, "c:\\txtsetup.sif"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ protected virtual void GenerateTxtSetupCustomHive()
+ {
+ //using (DesktopComponentSetupFileWriter writer = new DesktopComponentSetupFileWriter(SysGen.Project, Project.Path + "\\output-i386\\wallpaper.inf"))
+ //{
+ // writer.WriteFile();
+
+ // RBuildSetup s = new RBuildSetup();
+
+ // s.InstallBase = "inf";
+ // s.Name = "wallpaper.inf";
+ // s.Root = PathRoot.Output;
+
+ // Project.Files.Add(s);
+ //}
+
+ //using (ShellComponentSetupFileWriter writer = new ShellComponentSetupFileWriter(SysGen.Project, Project.Path + "\\output-i386\\shell.inf"))
+ //{
+ // writer.WriteFile();
+
+ // RBuildSetup s1 = new RBuildSetup();
+
+ // s1.InstallBase = "inf";
+ // s1.Name = "shell.inf";
+ // s1.Root = PathRoot.Output;
+
+ // Project.Files.Add(s1);
+ //}
+
+ using (TxtSetupHiveFileWriter writer = new TxtSetupHiveFileWriter(SysGen.Project, Project.Path + "\\output-i386\\hivecst.inf"))
+ {
+ writer.WriteFile();
+ }
+
+ RBuildBootstrapFile bs = new RBuildBootstrapFile();
+
+ bs.InstallBase = "reactos";
+ bs.Name = "hivecst.inf";
+ bs.Root = PathRoot.Output;
+
+ Project.Files.Add(bs);
+ }
+
+ protected virtual void GenerateSysSetup()
+ {
+ Directory.CreateDirectory(Project.Path + "\\output-i386\\media\\inf");
+
+ using (SysSetupFileWriter writer = new SysSetupFileWriter(SysGen.Project, Project.Path + "\\output-i386\\media\\inf\\syssetup.inf"))
+ {
+ writer.WriteFile();
+ }
+ }
+
+ private void GenerateFolders()
+ {
+ //foreach (RBuildModule module in Project.Modules)
+ //{
+ // foreach (RBuildFolder folder in module.Folders)
+ // {
+ // if (folders.Contains(folder) == false)
+ // folders.Add(folder);
+ // }
+ //}
+
+ //foreach (RBuildFolder folder in Project.Folders)
+ //{
+ // if (folders.Contains(folder) == false)
+ // folders.Add(folder);
+ //}
+
+ //foreach (RBuildFolder folder in folders)
+ //{
+ // GenerateFolder(makefile, folder);
+ //}
+ }
+
+ protected virtual void CheckCompiler()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/HtmlDocumenterBaseBacked.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/HtmlDocumenterBaseBacked.cs
new file mode 100644
index 00000000000..aac5117de0d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Base/HtmlDocumenterBaseBacked.cs
@@ -0,0 +1,97 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public abstract class HtmlDocumenterBaseBacked : Backend
+ {
+ public HtmlDocumenterBaseBacked(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ public string ReportFileExtension
+ {
+ get { return "htm"; }
+ }
+
+ protected string GetHtmlFileName(IRBuildNamed namedObject)
+ {
+ return string.Format("{0}.{1}",
+ namedObject.Name,
+ ReportFileExtension);
+ }
+
+ protected void WriteDocumentStart(HtmlTextWriter writer, string title)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Html);//
+ writer.RenderBeginTag(HtmlTextWriterTag.Head);//
+ writer.RenderBeginTag(HtmlTextWriterTag.Title); //
+ writer.Write(title);
+ writer.RenderEndTag(); //
+ writer.AddAttribute(HtmlTextWriterAttribute.Rel, "stylesheet");
+ writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/css");
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "style.css");
+ writer.RenderBeginTag(HtmlTextWriterTag.Link);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag(); //
+ writer.RenderBeginTag(HtmlTextWriterTag.Body);//
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "header");
+ writer.RenderBeginTag(HtmlTextWriterTag.Div);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "default.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("ReactOS RBuild Documentation");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+
+ if (!Project.Properties["ARCH"].IsEmpty)
+ {
+ if (!Project.Properties["SARCH"].IsEmpty)
+ {
+ writer.Write("RBuild Documentation for the '{0}' architecture, sub-architecture '{1}'. Project used '{2}'",
+ Project.Properties["ARCH"].Value,
+ Project.Properties["SARCH"].Value,
+ Project.RBuildFile);
+ }
+ else
+ {
+ writer.Write("RBuild Documentation for the '{0}' architecture. Project used '{1}'",
+ Project.Properties["ARCH"].Value,
+ Project.RBuildFile);
+ }
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ protected void WriteDocumentEnd(HtmlTextWriter writer)
+ {
+ writer.WriteBreak();
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "footer");
+ writer.RenderBeginTag(HtmlTextWriterTag.Div);
+ WriteDocumentLastUpdate(writer);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag(); //
+ writer.RenderEndTag(); //
+ }
+
+ protected void WriteDocumentLastUpdate(HtmlTextWriter writer)
+ {
+ //writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Document last updated on {0}", DateTime.Now);
+ //writer.RenderEndTag();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BaseAddress/BaseAddressReportBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BaseAddress/BaseAddressReportBackend.cs
new file mode 100644
index 00000000000..df0cf9ebc2d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BaseAddress/BaseAddressReportBackend.cs
@@ -0,0 +1,127 @@
+using System;
+using System.Globalization;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class BaseAddressReportBackend : Backend
+ {
+ private List m_Modules = new List ();
+
+ public class BaseAddressModule
+ {
+ private FileInfo m_FileInfo = null;
+ private RBuildModule m_Module = null;
+
+ public BaseAddressModule(RBuildModule module , string file)
+ {
+ m_Module = module;
+ m_FileInfo = new FileInfo(file);
+ }
+
+ public string Name
+ {
+ get { return m_Module.Name; }
+ }
+
+ public string BaseAddress
+ {
+ get { return m_Module.BaseAddress; }
+ }
+
+ public long Size
+ {
+ get { return m_FileInfo.Length; }
+ }
+
+ public string HexBaseAddressStart
+ {
+ get { return m_Module.BaseAddress.Replace("0x", string.Empty); }
+ }
+
+ public long BaseAddressStart
+ {
+ get { return Int64.Parse(HexBaseAddressStart, NumberStyles.AllowHexSpecifier); }
+ }
+
+ public long BaseAddressEnd
+ {
+ get { return m_FileInfo.Length + BaseAddressStart; }
+ }
+ }
+
+ public BaseAddressReportBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Base Address Report"; }
+ }
+
+ protected override void Generate()
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.Win32DLL ||
+ module.Type == ModuleType.Win32OCX)
+ {
+ if (module.BaseAddress != module.DefaultBaseAdress)
+ {
+ BaseAddressModule baseAddressModule = new BaseAddressModule(module , SysGen.ResolveRBuildFilePath (module.TargetFile));
+
+ Console.WriteLine(baseAddressModule.Name);
+
+ Console.WriteLine(" {0} {1}",
+ baseAddressModule.BaseAddressStart,
+ baseAddressModule.BaseAddressEnd);
+
+ m_Modules.Add (baseAddressModule);
+ }
+ }
+
+
+ }
+
+ using (StreamWriter sw = new StreamWriter(Directory.GetCurrentDirectory() + "\\overlapping.txt"))
+ {
+ foreach (BaseAddressModule module in m_Modules)
+ {
+ foreach (BaseAddressModule testModule in m_Modules)
+ {
+ if (module.Name != testModule.Name)
+ {
+ if ((testModule.BaseAddressStart >= module.BaseAddressStart && testModule.BaseAddressStart <= module.BaseAddressEnd) ||
+ (testModule.BaseAddressEnd >= module.BaseAddressStart && testModule.BaseAddressEnd <= module.BaseAddressEnd) ||
+ (testModule.BaseAddressStart <= module.BaseAddressStart && testModule.BaseAddressEnd >= module.BaseAddressEnd))
+ {
+ sw.WriteLine("- Module '{0}' [size '{1} and base address '{2}' [start:{3} end:{4}] is provably being overlapped by module '{5}' [size '{6} and base address '{7}' [start:{3} end:{8}]",
+ module.Name,
+ module.Size,
+ module.BaseAddress,
+ module.BaseAddressStart,
+ module.BaseAddressEnd,
+ testModule.Name,
+ testModule.Size,
+ testModule.BaseAddress,
+ testModule.BaseAddressStart,
+ testModule.BaseAddressEnd);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BuildLogReport/BuildLogReport.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BuildLogReport/BuildLogReport.cs
new file mode 100644
index 00000000000..af1fb660479
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/BuildLogReport/BuildLogReport.cs
@@ -0,0 +1,109 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class BuildLogReportEntry
+ {
+ public string File;
+ public string Message;
+ public string Position;
+ public string Type;
+ }
+
+ public class BuildLogReport : Backend
+ {
+ private List m_Errors = new List();
+
+ public BuildLogReport(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Build Log analizer"; }
+ }
+
+ private List Errors
+ {
+ get { return m_Errors; }
+ }
+
+ protected override void Generate()
+ {
+ using (StreamReader sr = new StreamReader(@"C:\Ros\Trunk\reactos\RosBE-Logs\BuildLog-4.1.3-20070210-0630.txt"))
+ {
+ Regex regex = new Regex(@"(.*?):(.*?): (.*?): (.*?)$",
+ RegexOptions.IgnoreCase |
+ RegexOptions.Multiline |
+ RegexOptions.Compiled);
+
+ MatchCollection matches = regex.Matches(sr.ReadToEnd());
+ foreach (Match match in matches)
+ {
+ BuildLogReportEntry error = new BuildLogReportEntry();
+
+ error.File = match.Groups[1].ToString();
+ error.Position = match.Groups[2].ToString();
+ error.Type = match.Groups[3].ToString();
+ error.Message = match.Groups[4].ToString();
+
+ Errors.Add(error);
+ }
+ }
+
+ using (StreamWriter sw = new StreamWriter(@"C:\rosbuildwarnings.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ writer.WriteLine("{0} Warnings" , Errors.Count);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("File");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Line/Column");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Error");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (BuildLogReportEntry report in m_Errors)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.File);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.Position);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(report.Message);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Catalog/CatalogBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Catalog/CatalogBackend.cs
new file mode 100644
index 00000000000..9e2a499d2b0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Catalog/CatalogBackend.cs
@@ -0,0 +1,69 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class CatalogBackend : Backend
+ {
+ public CatalogBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Component catalog"; }
+ }
+
+ private string CatalogFile
+ {
+ get { return Path.Combine(SysGen.BaseDirectory, "catalog.xml"); }
+ }
+
+ protected override void Generate()
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(CatalogFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteComment("File autogenerated by " + AppInfo);
+ writer.WriteStartElement("modules");
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ writer.WriteStartElement("module");
+ writer.WriteAttributeString("name", module.Name);
+ writer.WriteAttributeString("type", module.Type.ToString());
+ writer.WriteAttributeString("base", module.Base);
+ writer.WriteAttributeString("path", module.Path);
+ writer.WriteAttributeString("desc", module.Description);
+
+ writer.WriteStartElement("dependencies");
+ foreach (RBuildModule library in module.Libraries)
+ {
+ writer.WriteStartElement("dependency");
+ writer.WriteAttributeString("name", library.Name);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ }
+
+ writer.WriteEndElement();
+ writer.WriteEndDocument();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Html/HtmlBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Html/HtmlBackend.cs
new file mode 100644
index 00000000000..02f40a102f9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Html/HtmlBackend.cs
@@ -0,0 +1,2743 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class HtmlBackend : HtmlDocumenterBaseBacked
+ {
+ public HtmlBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ try
+ {
+ if (Directory.Exists(@"C:\rosDoc"))
+ Directory.Delete(@"C:\rosDoc", true);
+
+ Directory.CreateDirectory(@"C:\rosDoc");
+
+ File.Copy(@"c:\style.css", @"c:\rosDoc\style.css");
+ }
+ catch (Exception)
+ {
+ }
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "HTML Report"; }
+ }
+
+ private void GenerateFrontPage()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\default.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "RBuild Auto Documentation");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "platform.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Platform");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Quick platform overview.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "modules.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("ReactOS is a modular operating system, made of components that collaborate with each other.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "baseaddresses.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Base Addresses");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Memory address serving as a reference point for other addresses.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "dllbaseaddresses.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("DLL Base Addresses");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Base addresses used in ReactOS dlls.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "properties.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Properties");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Properties used during the build process.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "defines.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Project Defines");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Global defines.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "depmap.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Dependency map");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Graphically represents interdependencies between modules.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "files.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Files");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Files included for current platform.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "installfolders.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Install Folders");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Install folders created during ReactOS setup.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "installfiles.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Install Files");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Install files created during ReactOS setup.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "authors.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Authors");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Individuals who have contributed time and energy to supporting the ReactOS Project.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "unicodemodules.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Unicode");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Modules supporting UNICODE builds");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "localizations.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Localizations");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Languages and cultures currently supported by ReactOS");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "codestats.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Stats");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Basic ReactOS code base statistics");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "warnings.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("RBuild Warnings");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Warnings and inconsistencies detected by rbuild.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "buildsummary.htm");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("Build Summary");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write("Options and build settings per module.");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateDependencyMap()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\depmap.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Module Dependency Map");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Module Dependency Map");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.B);
+ writer.Write("Direct Dependencies :");
+ writer.RenderEndTag();
+ writer.Write("Dependencies and libraries this module is using");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Br);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.B);
+ writer.Write("Full Dependencies :");
+ writer.RenderEndTag();
+ writer.Write("Dependencies and libraries this module and it's dependencies are using");
+
+ SysGenDependencyTracker dependencyTracker = null;
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ dependencyTracker = new SysGenDependencyTracker(Project, module);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("{0}", module.Name);
+ writer.RenderEndTag();
+
+ writer.AddAttribute("name", module.Name);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Blockquote);
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Direct Dependencies");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule dependency in module.Needs)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "#" + dependency.Name);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("{0} - ({1} Dependencies , {2} Libraries , {3} Requeriments)",
+ dependency.Name,
+ dependency.Dependencies.Count,
+ dependency.Libraries.Count,
+ dependency.Requeriments.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Full Dependencies");
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule dependency in dependencyTracker.DependsOn)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "#" + dependency.Name);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write("{0} - ({1} Dependencies , {2} Libraries , {3} Requeriments)",
+ dependency.Name,
+ dependency.Dependencies.Count,
+ dependency.Libraries.Count,
+ dependency.Requeriments.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+
+ private void GenerateModulesBuildSummary()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\buildsummary.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Modules");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Libraries");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Dependencies");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("CFLAGS");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("LFLAGS");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (RBuildModule library in module.Libraries)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, library.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(library.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (RBuildModule dependency in module.Dependencies)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (string flag in module.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (string flag in module.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateModules()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\modules.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Modules");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Unicode");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("C++");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("PCH");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Target");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("RBuild");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Unicode);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.CPlusPlus);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PCH);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.InstallName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.RBuildPath);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateStats()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\codestats.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Stats");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Stats");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(Project.Modules.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateWarnings()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\warnings.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Warnings");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Warnings");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Unicode == false)
+ {
+ if ((module.Defines.IsDefined("UNICODE")) ||
+ (module.Defines.IsDefined("_UNICODE")) ||
+ (module.Defines.IsDefined("_UNICODE_")))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' has unicode defines but 'Unicode' property set to 'False'", module.Name);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (RBuildDefine define in Project.Defines)
+ {
+ if (module.Defines.IsDefined(define.Name))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' defines '{1}' already inherited from project ", module.Name, define.Name);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (string flag in Project.CompilerFlags)
+ {
+ if (module.CompilerFlags.Contains(flag))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' has compiler flag '{1}' already inherited from project ", module.Name, flag);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (string flag in Project.LinkerFlags)
+ {
+ if (module.LinkerFlags.Contains(flag))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' has linker flag '{1}' already inherited from project ", module.Name, flag);
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (RBuildFolder include in module.IncludeFolders)
+ {
+ if (Project.IncludeFolders.Contains(include))
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' includes folder '({1}){2}' already inherited from project ", module.Name, include.Root, include.FullPath);
+ writer.RenderEndTag();
+ }
+
+ if (include.Root == PathRoot.Default ||
+ include.Root == PathRoot.SourceCode)
+ {
+ if (SysGen.RBuildFolderExists(include) == false)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.WriteLine("Module '{0}' includes folder '({1}){2}' which could not be found ", module.Name, include.Root, include.FullPath);
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateFiles()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\files.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Modules");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Path");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("New Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.NewFile.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.GetType().Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateBaseAddresses()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\baseaddresses.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "BaseAdress");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Base Adress");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildProperty property in SysGen.Project.Properties)
+ {
+ if (property is RBuildBaseAdress)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Value);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateDllBaseAddresses()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\dllbaseaddresses.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Dll's base addresses");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Dll's base addresses");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base Adress");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Is Default");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.IsDLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.BaseAddress);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.IsDefaultBaseAdress);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+ }
+ }
+
+ private void GenerateDefines()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\defines.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Project Defines");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Project Defines");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildDefine define in Project.Defines)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Value);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateProperties()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\properties.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Properties");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Properties");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Read-Only");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Internal");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildProperty property in SysGen.Project.Properties)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Value);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.ReadOnly);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.Internal);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(property.GetType().Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateInstallFiles()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\installfiles.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Install Files");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Install Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ID");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Enabled)
+ {
+ if (module.IsInstallable)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ foreach (RBuildOutputFile file in module.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ }
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(platformFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateInstallFolders()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\installfolders.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Folders");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Install Folders");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ID");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.ID);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateAuthors()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\authors.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Authors");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("ReactOS Authors");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Alias");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Mail");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("City");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Country");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Active");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+
+ if (contributor.Alias != null)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, contributor.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(contributor.Alias);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.FullName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.Mail);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.City);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.Country);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(contributor.Active);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateContributors()
+ {
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ if (contributor.Alias != null)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\" + contributor.HtmlDocFileName))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Authors");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("ReactOS Authors");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Roles");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Authors.GetByName(contributor.Alias) != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildAuthor author in module.Authors)
+ {
+ if (author.Contributor == contributor)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(author.Role);
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ }
+ }
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+ }
+
+ private void GenerateLocalizations()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\localizations.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Translations");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Available Languages");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ID");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ThreeLetter ISO");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Localization by Module");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ RBuildLocalizationFile localization = module.LocalizationFiles.GetByName(language.Name);
+
+ if (localization != null)
+ {
+ if (localization.Dirty)
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "Red");
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("Yes");
+ writer.RenderEndTag();
+ }
+ else
+ {
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "Green");
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("Yes");
+ writer.RenderEndTag();
+ }
+ }
+ else
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write("No");
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GenerateModulePages()
+ {
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\" + module.HtmlDocFileName))
+ {
+ // Creates an XML file is not exist
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, module.Name);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Module : {0}", module.Name);
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Entry Point");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.EntryPoint);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("C++");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.CPlusPlus);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base Adress");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.BaseAddress);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Unicode");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Unicode);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Target Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type.ToString());
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ if (module.Families.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Families this module belong");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildFamily family in module.Families)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, "");
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(family.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Folders.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Folders");
+ writer.RenderEndTag();
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildFolder folder in module.Folders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.IsBuildable)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Output Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("File");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ if (module.TargetFile != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.TargetFile.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.Install != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Install.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Install.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Install.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.PlatformInstall != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PlatformInstall.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PlatformInstall.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PlatformInstall.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Authors.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Authors");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Alias");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Full Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Mail");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Role");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildAuthor author in module.Authors)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, author.Contributor.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(author.Contributor.Alias);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(author.Contributor.FullName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(author.Contributor.Mail);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(author.Role);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Metadata != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Metadata");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Description");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Metadata.Description);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.AutoRegister != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("COM Auto register");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Register Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.AutoRegister.Type.ToString());
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("SysSetup INF Section");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.AutoRegister.InfSection);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.ImportLibrary != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("DLL Import");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.Root);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.Base);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Definition");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.Definition);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Import Dll Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.ImportLibrary.DllName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.Bootstrap != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("CD Bootstrap");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Bootstrap.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Path");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Bootstrap.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("New name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Bootstrap.NewName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (module.Dependencies.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Dependencies");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in module.Dependencies)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Libraries.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Libraries");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in module.Libraries)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Requeriments.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Requeriments");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in module.Requeriments)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ SysGenDependencyTracker dependencyTracker = new SysGenDependencyTracker(Project,module);
+
+ if (dependencyTracker.DependsOn.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Depdends On");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in dependencyTracker.DependsOn)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (dependencyTracker.DependencyOf.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Dependency Of");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildModule dependency in dependencyTracker.DependencyOf)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, dependency.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(dependency.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(dependency.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Include Folders");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildFolder folder in module.IncludeFolders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (RBuildFolder folder in Project.IncludeFolders)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(folder.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.LocalizationFiles.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Localizations");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("ISO Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Resource");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Outdated");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildLocalizationFile localization in module.LocalizationFiles)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.CultureInfo.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.CultureInfo.EnglishName);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(localization.Dirty);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.Defines.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Defines");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Value");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildDefine define in module.Defines)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Value);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (RBuildDefine define in Project.Defines)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Name);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(define.Value);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Linker Flags");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Flag");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (string flag in module.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.LinkerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.LinkerScript != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Linker Script");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.LinkerScript.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.LinkerScript.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("CompilerFlags Flags");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Flag");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Inherited");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (string flag in module.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ foreach (string flag in Project.CompilerFlags)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(flag);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.Files.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Path");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Install Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("New Name");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildOutputFile file in module.Files)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.InstallBase);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.NewFile.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.GetType().Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+ }
+
+ if (module.SourceFiles.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Source Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Source Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Switches");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.FullPath);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(file.Switches);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderEndTag();
+
+ if (module.PreCompiledHeader != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Precompiled Header");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Root");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Source Type");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PreCompiledHeader.Root);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PreCompiledHeader.Type);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.PreCompiledHeader.FullPath);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+ }
+ }
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+ }
+
+ private void GenerateUnicodeModules()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\unicodemodules.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Unicode");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Unicode Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Unicode)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write("Non-Unicode Modules");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Module");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Base");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Type");
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (!module.Unicode)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.Name);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Base);
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(module.Type);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+
+ writer.RenderEndTag();
+
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ private void GeneratePlatformFrontPage()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\rosDoc\platform.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteDocumentStart(writer, "Platform");
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H2);
+ writer.Write(Project.Platform.Name);
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.P);
+ writer.Write(Project.Platform.Description);
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Modules");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.WriteLine("{0} out of {1}", Project.Platform.Modules.Count, Project.Modules.Count);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ if (Project.Platform.Shell != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Shell");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(Project.Platform.Shell.InstallName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (Project.Platform.Screensaver != null)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Screen Saver");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(Project.Platform.Screensaver.InstallName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (Project.Platform.Languages.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Languages");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildLanguage language in Project.Platform.Languages)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(language.Name);
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ if (Project.Platform.DebugChannels.Count > 0)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Debug Channels");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildDebugChannel channel in Project.Platform.DebugChannels)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(channel.Name);
+ writer.RenderEndTag();
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Platform Profiles");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.ModuleGroup)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.Write(module.Description);
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Debug Build");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.TrueString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Kernel Debug");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(bool.FalseString);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.H3);
+ writer.Write("Files");
+ writer.RenderEndTag();
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Class, "table");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("GUI Applications");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Console Applications");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Dlls");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Drivers");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("Keyboard Layouts");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("KernelMode DLLs");
+ writer.RenderEndTag();
+ writer.RenderBeginTag(HtmlTextWriterTag.Th);
+ writer.Write("OCX & TypeLibs");
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32GUI)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32CUI)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32DLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KernelModeDriver)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KernelModeDLL)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.RenderBeginTag(HtmlTextWriterTag.Ul);
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.Win32OCX || module.Type == ModuleType.EmbeddedTypeLib)
+ {
+ writer.RenderBeginTag(HtmlTextWriterTag.Li);
+ writer.AddAttribute(HtmlTextWriterAttribute.Href, module.HtmlDocFileName);
+ writer.RenderBeginTag(HtmlTextWriterTag.A);
+ writer.Write(module.TargetName);
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+
+ writer.RenderEndTag();
+
+ WriteDocumentEnd(writer);
+ }
+ }
+ }
+
+ protected override void Generate()
+ {
+ GenerateFrontPage();
+ GeneratePlatformFrontPage();
+ GenerateModules();
+ GenerateProperties();
+ GenerateModulesBuildSummary();
+ GenerateStats();
+ //GenerateDependencyMap();
+ GenerateWarnings();
+ GenerateFiles();
+ GenerateBaseAddresses();
+ GenerateDllBaseAddresses();
+ GenerateDefines();
+ GenerateInstallFolders();
+ GenerateInstallFiles();
+ GenerateAuthors();
+ GenerateContributors();
+ GenerateLocalizations();
+ GenerateModulePages();
+ GenerateUnicodeModules();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/MSVisualStudio.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/MSVisualStudio.cs
new file mode 100644
index 00000000000..c1744aad138
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/MSVisualStudio.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Framework.VisualStudio;
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MSVisualStudio : Backend
+ {
+ public MSVisualStudio(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Visual Studio 6.0-2005"; }
+ }
+
+ protected override void Generate()
+ {
+ VSSolution solution = new VSSolution();
+
+ solution.Name = "ReactOS";
+ solution.FileName = "reactos.sln";
+
+ foreach (RBuildModule module in SysGen.Project.Modules)
+ {
+ VSProject project = new VSProject();
+
+ //project.Name = module.Name;
+ project.FileName = module.Name + ".vcproj";
+
+ solution.Projects.Add(project);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/VisualStudio/Solution.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/VisualStudio/Solution.cs
new file mode 100644
index 00000000000..00ececbee87
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/MSVisualStudio/VisualStudio/Solution.cs
@@ -0,0 +1,703 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine.Framework.VisualStudio
+{
+ public enum VisualStudioVersion
+ {
+ VS6,
+ VS2002,
+ VS2003,
+ VS2005
+ }
+
+ #region ProjectFile
+ public class ProjectFile
+ {
+ private string relPath = "";
+ private string basePath = "";
+ private string buildAction = "";
+ private string subType = "";
+
+ public string AbsolutePath
+ {
+ get
+ {
+ return Path.Combine(basePath, relPath);
+ }
+ }
+ public string AbsoluteDirectory
+ {
+ get
+ {
+ return Path.GetDirectoryName(Path.Combine(basePath, relPath));
+ }
+ }
+
+ public string RelativePath
+ {
+ get
+ {
+ return relPath;
+ }
+ }
+
+ public string BasePath
+ {
+ get
+ {
+ return basePath;
+ }
+ }
+ public string BuildAction
+ {
+ get
+ {
+ return buildAction;
+ }
+ }
+ public string SubType
+ {
+ get
+ {
+ return subType;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder("\nProject File:");
+ buff.Append("\n\tRelativePath:");
+ buff.Append(relPath);
+ buff.Append("\n\tBuildAction:");
+ buff.Append(buildAction);
+ buff.Append("\n\tSubType:");
+ buff.Append(subType);
+ buff.Append("\n\tBasePath:");
+ buff.Append(basePath);
+ return buff.ToString();
+ }
+
+ public ProjectFile(
+ string relPath,
+ string buildAction,
+ string subType,
+ string basePath)
+ {
+ this.relPath = relPath;
+ this.buildAction = buildAction;
+ this.subType = subType;
+ this.basePath = basePath;
+ }
+ }
+ #endregion
+
+ #region ProjectFileCollection
+ public class ProjectFileCollection : ReadOnlyCollectionBase
+ {
+ public ProjectFile this[int index]
+ {
+ get
+ {
+ return (ProjectFile)this.InnerList[index];
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectFileCollection");
+ foreach (ProjectFile pf in this.InnerList)
+ {
+ buff.Append(pf.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectFileCollection(ProjectFile[] projectFileArray)
+ {
+ foreach (ProjectFile projectFile in projectFileArray)
+ {
+ this.InnerList.Add(projectFile);
+ }
+ }
+
+
+ }
+ #endregion
+
+ #region ProjectReference
+ public class ProjectReference
+ {
+ private string name = "";
+ private string assemblyName = "";
+ private string hintPath = "";
+ private string basePath = "";
+
+ public string Name
+ {
+ get
+ {
+ return this.name;
+
+ }
+ }
+ public string AssemblyName
+ {
+ get
+ {
+ return this.assemblyName;
+ }
+ }
+ public string HintPath
+ {
+ get
+ {
+ return this.hintPath;
+ }
+ }
+ public string AbsolutePath
+ {
+ get
+ {
+ return Path.Combine(this.basePath, this.hintPath);
+ }
+ }
+
+ public string BasePath
+ {
+ get
+ {
+ return this.basePath;
+ }
+ }
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder("\nReference:");
+ buff.Append("\n\tName");
+ buff.Append(name);
+ buff.Append("\n\tAssemblyName");
+ buff.Append(assemblyName);
+ buff.Append("\n\tHintPath:");
+ buff.Append(hintPath);
+ buff.Append("\n\tBasePath:");
+ buff.Append(basePath);
+ return buff.ToString();
+ }
+
+ public ProjectReference(string name,
+ string assemblyName,
+ string hintPath,
+ string basePath)
+ {
+ this.name = name;
+ this.assemblyName = assemblyName;
+ this.hintPath = hintPath;
+ this.basePath = basePath;
+ }
+
+ }
+ #endregion
+
+ #region ProjectReferenceCollection
+ public class ProjectReferenceCollection : ReadOnlyCollectionBase
+ {
+ public ProjectReference this[int index]
+ {
+ get
+ {
+ return (ProjectReference)this.InnerList[index];
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectReferenceCollection");
+ foreach (ProjectReference pr in this.InnerList)
+ {
+ buff.Append(pr.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectReferenceCollection(ProjectReference[]
+ projectReferenceArray)
+ {
+ foreach (ProjectReference projectReference in projectReferenceArray)
+ {
+ this.InnerList.Add(projectReference);
+ }
+ }
+
+ }
+ #endregion
+
+ #region ProjectConfigItem
+ public class ProjectConfigItem
+ {
+ private string key = "";
+ private string keyValue = "";
+
+ public string Key
+ {
+ get
+ {
+ return key;
+ }
+ }
+ public string Value
+ {
+ get
+ {
+ return keyValue;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectConfigItem:");
+ buff.Append("\n\tKey:");
+ buff.Append(key);
+ buff.Append("\n\tValue:");
+ buff.Append(keyValue);
+ return buff.ToString();
+ }
+
+ public ProjectConfigItem(string key, string keyValue)
+ {
+ this.key = key;
+ this.keyValue = keyValue;
+
+ }
+ }
+ #endregion
+
+ #region ProjectConfigItemCollection
+ public class ProjectConfigItemCollection : ReadOnlyCollectionBase
+ {
+ private string basePath = "";
+
+ public string Name
+ {
+ get
+ {
+ string name = "";
+ foreach (ProjectConfigItem pc in this.InnerList)
+ {
+ if (pc.Key.Equals("Name"))
+ {
+ name = pc.Value;
+ break;
+ }
+ }
+ return name;
+ }
+ }
+
+ public string OutputRelPath
+ {
+ get
+ {
+ string relPath = "";
+ foreach (ProjectConfigItem pc in this.InnerList)
+ {
+ if (pc.Key.Equals("OutputPath"))
+ {
+ relPath = pc.Value;
+ break;
+ }
+ }
+ return relPath;
+ }
+ }
+
+ public string OutputAbsolutePath
+ {
+ get
+ {
+ string absPath = OutputRelPath;
+ absPath = Path.Combine(this.basePath, absPath);
+ return absPath.Replace("\\.\\", "");
+ }
+ }
+
+ public ProjectConfigItem this[int index]
+ {
+ get
+ {
+ return (ProjectConfigItem)this.InnerList[index];
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectConfigItemCollection:");
+ foreach (ProjectConfigItem pc in this.InnerList)
+ {
+ buff.Append(pc.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectConfigItemCollection(ProjectConfigItem[]
+ projectConfigItemArray, string basePath)
+ {
+ this.basePath = basePath;
+ foreach (ProjectConfigItem pc in projectConfigItemArray)
+ {
+ this.InnerList.Add(pc);
+ }
+
+ }
+ }
+ #endregion
+
+ #region ProjectConfigCollection
+ public class ProjectConfigCollection : ReadOnlyCollectionBase
+ {
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProjectConfigCollection:");
+ foreach (ProjectConfigItemCollection pc in this.InnerList)
+ {
+ buff.Append(pc.ToString());
+ }
+ return buff.ToString();
+ }
+
+ public ProjectConfigItemCollection this[int index]
+ {
+ get
+ {
+ return (ProjectConfigItemCollection)this.InnerList[index];
+ }
+ }
+
+ public ProjectConfigCollection(XmlNodeList configItems, string basePath)
+ {
+ if (configItems.Count > 0)
+ {
+ foreach (XmlNode configItem in configItems)
+ {
+ // create an array of items:
+ ProjectConfigItem[] projectConfigItemArray = new
+ ProjectConfigItem[configItem.Attributes.Count];
+ int i = 0;
+ foreach (XmlAttribute attrib in configItem.Attributes)
+ {
+ projectConfigItemArray[i] = new
+ ProjectConfigItem(attrib.Name, attrib.Value);
+ i++;
+ }
+ // create a ProjectConfigItemCollection:
+ ProjectConfigItemCollection projectConfigItemCollection = new
+ ProjectConfigItemCollection(projectConfigItemArray, basePath);
+ this.InnerList.Add(projectConfigItemCollection);
+ }
+ }
+ }
+ }
+ #endregion
+
+ #region Project
+ public class VSProject : VSItem
+ {
+ private string basePath = "";
+ private string projectBasePath = "";
+ private string projectFileName = "";
+ private string projectGuid = "";
+ private string projectConfigurationGuid = "";
+ private string projectName = "";
+ private string projectType = "";
+ private ProjectConfigCollection configCollection = null;
+ private ProjectReferenceCollection referenceCollection = null;
+ private ProjectFileCollection fileCollection = null;
+
+ public string AbsolutePath
+ {
+ get
+ {
+ return Path.Combine(basePath, projectFileName);
+ }
+ }
+
+ public string AbsoluteDirectory
+ {
+ get
+ {
+ return basePath;
+ }
+ }
+
+ public ProjectConfigCollection Configurations
+ {
+ get
+ {
+ return configCollection;
+ }
+ }
+ public ProjectReferenceCollection ReferenceCollection
+ {
+ get
+ {
+ return referenceCollection;
+ }
+ }
+ public ProjectFileCollection FileCollection
+ {
+ get
+ {
+ return fileCollection;
+ }
+ }
+
+ public string RelPath
+ {
+ get
+ {
+ return projectFileName;
+ }
+ }
+
+ public string Guid
+ {
+ get
+ {
+ return projectGuid;
+ }
+ }
+
+ public string ConfigurationGuid
+ {
+ get
+ {
+ return projectConfigurationGuid;
+ }
+ }
+
+ public string Name
+ {
+ get
+ {
+ return projectName;
+ }
+ }
+
+ public string ProjectType
+ {
+ get
+ {
+ return projectType;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProject:");
+ buff.Append("\n\tName:");
+ buff.Append(projectName);
+ buff.Append("\n\tFileName:");
+ buff.Append(projectFileName);
+ buff.Append("\n\tBasePath:");
+ buff.Append(basePath);
+ buff.Append("\n\tGuid:");
+ buff.Append(projectGuid);
+ buff.Append("\nConfiguration:");
+ buff.Append(configCollection.ToString());
+ buff.Append("\nReferences:");
+ buff.Append(referenceCollection.ToString());
+ buff.Append("\nFiles:");
+ buff.Append(fileCollection.ToString());
+ return buff.ToString();
+ }
+ }
+ #endregion
+
+ #region ProjectCollection
+ public class ProjectCollection : List
+ {
+ public override string ToString()
+ {
+ StringBuilder buff = new StringBuilder();
+ buff.Append("\nProject Collection:");
+ foreach (VSProject p in this)
+ {
+ buff.Append(p.ToString());
+ }
+ return buff.ToString();
+ }
+ }
+ #endregion
+
+ #region Solution
+ public class VSSolution : VSItem
+ {
+ private string solutionFileName = "";
+ private string solutionDirectory = "";
+ private string solutionFileVersion = "";
+ private ProjectCollection projectCollection = null;
+
+ public string LongestSharedPath
+ {
+ get
+ {
+ // find the longest path which is shared by all of the
+ // objects in the project (if any)
+ string longestSharedPath = solutionDirectory;
+ foreach (VSProject p in projectCollection)
+ {
+ string projectDir = p.AbsoluteDirectory;
+ longestSharedPath = getMinimumSharedPath(longestSharedPath,
+ projectDir);
+ foreach (ProjectFile pf in p.FileCollection)
+ {
+ string fileDir = pf.AbsoluteDirectory;
+ longestSharedPath = getMinimumSharedPath(longestSharedPath,
+ fileDir);
+ }
+ }
+ return longestSharedPath;
+ }
+ }
+
+ private string getMinimumSharedPath(
+ string sharedPath,
+ string newPath
+ )
+ {
+ string retSharedPath = "";
+ if (sharedPath.Length > 0)
+ {
+ string[] sharedPathParts = sharedPath.Split(
+ (new char[] {Path.DirectorySeparatorChar,
+ Path.AltDirectorySeparatorChar }));
+ string[] newPathParts = newPath.Split(
+ (new char[] {Path.DirectorySeparatorChar,
+ Path.AltDirectorySeparatorChar}));
+ int max = Math.Min(sharedPathParts.Length, newPathParts.Length);
+ int sharedCount = 0;
+ for (int i = 0; i < max; i++)
+ {
+ if
+ (!sharedPathParts[i].ToUpper().Equals(newPathParts[i].ToUpper())
+ )
+ {
+ break;
+ }
+ else
+ {
+ sharedCount = i + 1;
+ }
+ }
+ if (sharedCount == 0)
+ {
+ return "";
+ }
+ else
+ {
+ for (int i = 0; i < sharedCount; i++)
+ {
+ if (retSharedPath.Length > 0)
+ {
+ retSharedPath += Path.DirectorySeparatorChar;
+ }
+ retSharedPath += sharedPathParts[i];
+ }
+ }
+ }
+ return retSharedPath;
+ }
+
+ public string FileVersion
+ {
+ get
+ {
+ return solutionFileVersion;
+ }
+ }
+
+ public ProjectCollection Projects
+ {
+ get
+ {
+ return projectCollection;
+ }
+ }
+
+ public string FileName
+ {
+ get
+ {
+ return solutionFileName;
+ }
+ set
+ {
+ solutionFileName = value;
+ }
+ }
+
+ public string BasePath
+ {
+ get
+ {
+ return solutionDirectory;
+ }
+ }
+
+ public override string ToString()
+ {
+ StringBuilder s = new StringBuilder();
+ s.Append("\nSolution:");
+ s.Append("\nFileName:");
+ s.Append(solutionFileName);
+ s.Append("\nVersion:");
+ s.Append(solutionFileVersion);
+ if (projectCollection != null)
+ {
+ s.Append(projectCollection.ToString());
+ }
+ return s.ToString();
+ }
+
+ public VSSolution()
+ {
+ }
+
+ public VSSolution(string fileName)
+ {
+ solutionFileName = fileName;
+ }
+ }
+ #endregion
+
+ public class VSItem
+ {
+ private string m_Name = null;
+ private string m_FileName = null;
+
+ public string Name
+ {
+ get { return m_Name; }
+ set { m_Name = value; }
+ }
+
+ public string FileName
+ {
+ get { return m_FileName; }
+ set { m_FileName = value; }
+ }
+
+ public void SaveAs(VisualStudioVersion version)
+ {
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/CompilableFile.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/CompilableFile.cs
new file mode 100644
index 00000000000..c4451fceeab
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/CompilableFile.cs
@@ -0,0 +1,621 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class BackedBuildIncludeFolder : BackedBuildFolder
+ {
+ public BackedBuildIncludeFolder(RBuildFolder folder, SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = folder;
+ }
+ }
+
+ public class BackendBuildFile : BackendBuildFileSystemInfo
+ {
+ public BackendBuildFile(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = new RBuildFile();
+ }
+
+ public string GetPathWithNewExtension(PathRoot root, string newExtension)
+ {
+ return GetPath(root, BuildFile.Name, newExtension);
+ }
+
+ public string GetPathWithNewName(PathRoot root, string newName)
+ {
+ return GetPath(root, newName, Path.GetExtension(BuildFile.Name));
+ }
+
+ public string GetPath(PathRoot root, string newName, string newExtension)
+ {
+ return Path.Combine(SysGen.GetPathRoot(root), Path.ChangeExtension(newName, newExtension));
+ }
+
+ public string IntermediateFolderFullPath
+ {
+ get { return Path.Combine(SysGen.GetPathRoot(PathRoot.Intermediate), BuildFile.Base) /*+ @"\."*/; }
+ }
+
+ public string BaseFolderFullPath
+ {
+ get { return Path.Combine(SysGen.GetPathRoot(PathRoot.SourceCode), BuildFile.Base) /*+ @"\."*/; }
+ }
+
+ public RBuildFile BuildFile
+ {
+ get { return m_RBuildFile as RBuildFile; }
+ }
+ }
+
+ public class BackedBuildFolder : BackendBuildFileSystemInfo
+ {
+ public BackedBuildFolder(RBuildFolder folder, SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = folder;
+ }
+
+ public BackedBuildFolder(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ m_RBuildFile = new RBuildFolder();
+ }
+
+ public RBuildFolder BuildFolder
+ {
+ get { return m_RBuildFile as RBuildFolder; }
+ }
+ }
+
+ public abstract class BackendBuildFileSystemInfo
+ {
+ protected RBuildFileSystemInfo m_RBuildFile = null;
+ protected SysGenEngine m_SysGenEngine = null;
+
+ public BackendBuildFileSystemInfo(SysGenEngine sysgen)
+ {
+ m_SysGenEngine = sysgen;
+ }
+
+ public SysGenEngine SysGen
+ {
+ get { return m_SysGenEngine; }
+ }
+
+ public string RelativePath
+ {
+ get { return SysGen.NormalizePath(m_RBuildFile.FullPath); }
+ }
+
+ public string GetPath(PathRoot root)
+ {
+ return Path.Combine(SysGen.GetPathRoot(root), RelativePath);
+ }
+
+ public string OriginalFullPath
+ {
+ get { return Path.Combine(SysGen.GetPathRoot(m_RBuildFile.Root), RelativePath); }
+ }
+
+ public string BaseFullPath
+ {
+ get { return Path.Combine(SysGen.BaseDirectory, RelativePath); }
+ }
+
+ public string IntermediateFullPath
+ {
+ get { return Path.Combine(SysGen.IntermediateDirectory, RelativePath); }
+ }
+
+ public string OutputFullPath
+ {
+ get { return Path.Combine(SysGen.OutputDirectory, RelativePath); }
+ }
+
+ public string BootCDOutputDirectory
+ {
+ get { return Path.Combine(SysGen.BootCDOutputDirectory, RelativePath); }
+ }
+
+ public string TemporaryFullPath
+ {
+ get { return Path.Combine(SysGen.TemporaryDirectory, RelativePath); }
+ }
+
+ public string InstallFullPath
+ {
+ get { return Path.Combine(SysGen.InstallDirectory, RelativePath); }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_RBuildFile.Element as RBuildModule; }
+ }
+ }
+
+ public class SourceFile : BackendBuildModule
+ {
+ RBuildSourceFile m_File = null;
+ BackendBuildFile m_SourceCodeFile = null;
+ BackendBuildFile m_SourceCodeObjectFile = null;
+ BackendBuildFile m_SourceCodeActualFile = null;
+ BackendBuildFile m_SourceCodeHeaderFile = null;
+ BackendBuildFile m_SourceCodePCHeaderFile = null;
+ BackendBuildFile m_SourceRpcClientHeaderFile = null;
+ BackendBuildFile m_SourceRpcServerHeaderFile = null;
+ BackendBuildFile m_SourceMessageTableHeaderFile = null;
+ BackendBuildFile m_SourceMessageTableResourceFile = null;
+ BackendBuildFile m_PCH = null;
+ BackendBuildFile m_PCHTemp = null;
+
+ public SourceFile(RBuildSourceFile file, RBuildModule module, SysGenEngine sysgen)
+ : base(module, sysgen)
+ {
+ m_File = file;
+
+ m_SourceCodeFile = new BackendBuildFile(sysgen);
+ m_SourceCodeFile.BuildFile.Name = file.Name;
+ m_SourceCodeFile.BuildFile.Element = module;
+ m_SourceCodeFile.BuildFile.Base = file.Base;
+ m_SourceCodeFile.BuildFile.Root = file.Root;
+
+ m_SourceCodeObjectFile = new BackendBuildFile(sysgen);
+ m_SourceCodeObjectFile.BuildFile.Name = GetObjectFileName(file);
+ m_SourceCodeObjectFile.BuildFile.Element = module;
+ m_SourceCodeObjectFile.BuildFile.Base = file.Base;
+
+ m_SourceCodeActualFile = new BackendBuildFile(sysgen);
+ m_SourceCodeActualFile.BuildFile.Name = GetActualSourceFile(file);
+ m_SourceCodeActualFile.BuildFile.Element = module;
+ m_SourceCodeActualFile.BuildFile.Base = file.Base;
+
+ m_SourceCodeHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceCodeHeaderFile.BuildFile.Name = GetHeaderFile(file);
+ m_SourceCodeHeaderFile.BuildFile.Element = module;
+ m_SourceCodeHeaderFile.BuildFile.Base = file.Base;
+
+ m_SourceRpcClientHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceRpcClientHeaderFile.BuildFile.Name = GetRpcClientHeaderFile(file);
+ m_SourceRpcClientHeaderFile.BuildFile.Element = module;
+ m_SourceRpcClientHeaderFile.BuildFile.Base = file.Base;
+
+ m_SourceRpcServerHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceRpcServerHeaderFile.BuildFile.Name = GetRpcServerHeaderFile(file);
+ m_SourceRpcServerHeaderFile.BuildFile.Element = module;
+ m_SourceRpcServerHeaderFile.BuildFile.Base = file.Base;
+
+ m_SourceMessageTableHeaderFile = new BackendBuildFile(sysgen);
+ m_SourceMessageTableHeaderFile.BuildFile.Name = GetMessageTableHeaderFile(file);
+ m_SourceMessageTableHeaderFile.BuildFile.Element = module;
+ m_SourceMessageTableHeaderFile.BuildFile.Base = /*file.Base; //*/ "include/reactos";
+
+ m_SourceMessageTableResourceFile = new BackendBuildFile(sysgen);
+ m_SourceMessageTableResourceFile.BuildFile.Name = GetMessageTableResourceFile(file);
+ m_SourceMessageTableResourceFile.BuildFile.Element = module;
+ m_SourceMessageTableResourceFile.BuildFile.Base = file.Base;
+ }
+
+ public string GetMessageTableResourceFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + ".rc";
+ }
+
+ public string GetMessageTableHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + ".h";
+ }
+
+ public string GetRpcServerHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + "_s.h";
+ }
+
+ public string GetRpcClientHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + "_c.h";
+ }
+
+ public string GetRpcProxyHeaderFile(RBuildFile file)
+ {
+ return Path.GetFileNameWithoutExtension(file.Name) + "_p.h";
+ }
+
+ private string GetHeaderFile(RBuildFile file)
+ {
+ switch (file.Extension)
+ {
+ case ".idl":
+ {
+ if (Module.Type == ModuleType.RpcServer)
+ return GetRpcServerHeaderFile(file);
+
+ if (Module.Type == ModuleType.RpcClient)
+ return GetRpcClientHeaderFile(file);
+
+ if (Module.Type == ModuleType.RpcProxy)
+ return GetRpcProxyHeaderFile(file);
+
+ return Path.ChangeExtension(file.Name, ".h");
+ }
+ break;
+ default:
+ return file.Name;
+ }
+ }
+
+ private string GetActualSourceFile(RBuildFile file)
+ {
+ switch (file.Extension)
+ {
+ case ".spec":
+ return Path.ChangeExtension(file.Name, ".stubs.c");
+ break;
+ case ".idl":
+ {
+ if (Module.Type == ModuleType.RpcServer)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_s.c";
+
+ if (Module.Type == ModuleType.RpcClient)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_c.c";
+
+ if (Module.Type == ModuleType.RpcProxy)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_p.c";
+
+ return Path.ChangeExtension(file.Name, ".h");
+ }
+ break;
+ default:
+ return file.Name;
+ }
+ }
+
+ private string GetObjectFileName(RBuildFile file)
+ {
+ string filename = null;
+ switch (file.Extension)
+ {
+ case ".h":
+ filename = Path.ChangeExtension(file.Name, ".h.gch");
+ break;
+ case ".mc":
+ filename = Path.ChangeExtension(file.Name, ".rc");
+ break;
+ case ".rc":
+ filename = Path.ChangeExtension(file.Name, ".coff");
+ break;
+ case ".spec":
+ filename = Path.ChangeExtension(file.Name, ".stubs.o");
+ break;
+ case ".idl":
+ {
+ if (Module.Type == ModuleType.RpcServer)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_s.o";
+
+ if (Module.Type == ModuleType.RpcClient)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_c.o";
+
+ if (Module.Type == ModuleType.RpcProxy)
+ return Path.GetFileNameWithoutExtension(file.Name) + "_p.o";
+
+ /*
+ if (Module.Type == ModuleType.EmbeddedTypeLib)
+ return Path.GetFileNameWithoutExtension(file.Name) + ".tlb";
+ */
+
+ filename = Path.ChangeExtension(file.Name, ".h");
+ }
+ break;
+ //case ".c":
+ //case ".cpp":
+ //case ".cxx":
+ // {
+ // filename = Path.ChangeExtension(file.Name, ".o");
+ // }
+ // break;
+ default:
+ filename = Path.ChangeExtension(file.Name, ".o");
+
+ //HACK:
+ if (Module.Type == ModuleType.BootSector)
+ return filename;
+
+ //filename = string.Format("{1}_{0}{2}",
+ // Module.Name,
+ // Path.GetFileNameWithoutExtension(filename),
+ // Path.GetExtension(filename));
+ break;
+ }
+
+ if (file.Extension == ".mc" ||
+ file.Extension == ".rc" ||
+ file.Extension == ".c" ||
+ file.Extension == ".cpp" ||
+ file.Extension == ".cxx" ||
+ file.Extension == ".asm" ||
+ file.Extension == ".s")
+ {
+ filename = string.Format("{0}_{1}{2}",
+ Path.GetFileNameWithoutExtension(filename),
+ Module.Name,
+ Path.GetExtension(filename));
+ }
+ else if (file.Extension == ".h")
+ {
+ return filename;
+ }
+
+ return filename;
+ }
+
+ public BackendBuildFile SourceCodeFile
+ {
+ get { return m_SourceCodeFile; }
+ }
+
+ public BackendBuildFile SourceCodeHeaderFile
+ {
+ get { return m_SourceCodeHeaderFile; }
+ }
+
+ public BackendBuildFile SourceCodeObjectFile
+ {
+ get { return m_SourceCodeObjectFile; }
+ }
+
+ public BackendBuildFile SourceCodeActualFile
+ {
+ get { return m_SourceCodeActualFile; }
+ }
+
+ public BackendBuildFile SourceRpcClientHeaderFile
+ {
+ get { return m_SourceRpcClientHeaderFile; }
+ }
+
+ public BackendBuildFile SourceRpcServerHeaderFile
+ {
+ get { return m_SourceRpcServerHeaderFile; }
+ }
+
+ public BackendBuildFile SourceCodePCHeaderFile
+ {
+ get { return m_SourceCodePCHeaderFile; }
+ }
+
+ public RBuildSourceFile File
+ {
+ get { return m_File; }
+ }
+
+ public BackendBuildFile MessageTableHeaderFile
+ {
+ get { return m_SourceMessageTableHeaderFile; }
+ }
+
+ public BackendBuildFile MessageTableResourceFile
+ {
+ get { return m_SourceMessageTableResourceFile; }
+ }
+ }
+
+ public class LibraryModule : BackendBuildModule
+ {
+ BackendBuildFile m_Dependency = null;
+
+ public LibraryModule(RBuildModule module, SysGenEngine sysgen) : base (module , sysgen)
+ {
+ m_Dependency = new BackendBuildFile(sysgen);
+ m_Dependency.BuildFile.Name = module.DependencyName;
+ m_Dependency.BuildFile.Element = module;
+ m_Dependency.BuildFile.Base = module.Base;
+ }
+
+ public BackendBuildFile Dependency
+ {
+ get { return m_Dependency; }
+ }
+ }
+
+ public class BackendBuildModule
+ {
+ SysGenEngine m_SysGenEngine = null;
+ RBuildModule m_Module = null;
+ BackendBuildFile m_Target = null;
+ BackendBuildFile m_TargetNoStrip = null;
+ BackendBuildFile m_Dependency = null;
+ BackendBuildFile m_Definition = null;
+
+ public BackendBuildModule(RBuildModule module, SysGenEngine sysgen)
+ {
+ m_Module = module;
+ m_SysGenEngine = sysgen;
+
+ m_Target = new BackendBuildFile(sysgen);
+ m_Target.BuildFile.Name = module.TargetFile.Name; //module.TargetName;
+ m_Target.BuildFile.Element = module;
+ m_Target.BuildFile.Base = module.TargetFile.Base; //module.Base;
+
+ m_TargetNoStrip = new BackendBuildFile(sysgen);
+ m_TargetNoStrip.BuildFile.Name = GetNoStripTargetName(module);
+ m_TargetNoStrip.BuildFile.Element = module;
+ m_TargetNoStrip.BuildFile.Base = module.Base;
+
+ m_Dependency = new BackendBuildFile(sysgen);
+ m_Dependency.BuildFile.Name = module.DependencyName;
+ m_Dependency.BuildFile.Element = module;
+ m_Dependency.BuildFile.Base = module.Base;
+
+
+ m_Definition = new BackendBuildFile(sysgen);
+ m_Definition.BuildFile.Element = module;
+
+ if (module.ImportLibrary == null)
+ {
+ m_Definition.BuildFile.Name = "tools/rbuild/empty.def";
+ m_Definition.BuildFile.Base = sysgen.BaseDirectory;
+ }
+ else
+ {
+ if (IsWineModule)
+ m_Definition.BuildFile.Root = PathRoot.Intermediate;
+
+ m_Definition.BuildFile.Name = module.ImportLibrary.Definition;
+ m_Definition.BuildFile.Base = module.ImportLibrary.Base;
+ }
+ }
+
+ public bool IsWineModule
+ {
+ get
+ {
+ if (Module.ImportLibrary == null)
+ return false;
+
+ return ((Module.ImportLibrary.Definition != null) &&
+ (Module.ImportLibrary.Definition != string.Empty) &&
+ (Module.ImportLibrary.Definition.Contains(".spec.def")));
+ }
+ }
+
+ public string GetNoStripTargetName(RBuildModule module)
+ {
+ return string.Format("{0}.nostrip{1}",
+ Path.GetFileNameWithoutExtension(module.TargetName),
+ Path.GetExtension(module.TargetName));
+ }
+
+ public string LibTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".temp.a");
+ }
+ }
+
+ public string ExpTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".temp.exp");
+ }
+ }
+
+ public string JunkTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".junk.tmp");
+ }
+ }
+
+ public string RcTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".rci.tmp");
+ }
+ }
+
+ public string ResTempFileName
+ {
+ get
+ {
+ if (m_Module.Type == ModuleType.StaticLibrary)
+ return m_Module.TargetName;
+
+ return Path.ChangeExtension(m_Module.TargetName, ".res.tmp");
+ }
+ }
+
+ public string JunkTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.SourceCode), JunkTempFileName); }
+ }
+
+ public string RcTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Temporary), RcTempFileName); }
+ }
+
+ public string ResTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), ResTempFileName); }
+ }
+
+ public string ExpTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.SourceCode), ExpTempFileName); }
+ }
+
+ public string LibTempFileNameFullPath
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), LibTempFileName); }
+ }
+
+ public string ModuleIntermediateLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), Module.Base); }
+ }
+
+ public string ModuleOutputLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Output), Module.Base); }
+ }
+
+ public string ModuleBaseIntermediateLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Intermediate), Module.Base); }
+ }
+
+ public string ModuleBaseOutputLocation
+ {
+ get { return Path.Combine(m_SysGenEngine.GetPathRoot(PathRoot.Output), Module.Base); }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public BackendBuildFile Target
+ {
+ get { return m_Target; }
+ }
+
+ public BackendBuildFile Dependency
+ {
+ get { return m_Dependency; }
+ }
+
+ public BackendBuildFile Definition
+ {
+ get { return m_Definition; }
+ }
+
+ public BackendBuildFile TargetNoStrip
+ {
+ get { return m_TargetNoStrip; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwBackend.cs
new file mode 100644
index 00000000000..356dde7aa9a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwBackend.cs
@@ -0,0 +1,504 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Backends;
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBackend : CompilerBaseBacked
+ {
+ public const string ECHO_AR_MACRO = "$(ECHO_AR)";
+ public const string ECHO_CC_MACRO = "$(ECHO_CC)";
+ public const string ECHO_LD_MACRO = "$(ECHO_LD)";
+ public const string ECHO_WRC_MACRO = "$(ECHO_WRC)";
+
+ public const string EMPTY_DEF_FILE = "tools\\rbuild\\empty.def";
+
+ protected bool m_UsePipe = false;
+ protected bool m_UsePch = false;
+ protected bool m_ManualBinUtilsSetting = false;
+
+ protected List m_ModuleHandlers = new List();
+
+ public MingwBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "MINGW32 Backend"; }
+ }
+
+ private void WriteXmlRBuildFiles(MakefileWriter makefile, RBuildProject project)
+ {
+ foreach (string xmlBuildFile in SysGen.BuildFiles)
+ {
+ makefile.WriteIndentedLine(xmlBuildFile);
+ }
+ }
+
+ protected List ModuleHandlers
+ {
+ get { return m_ModuleHandlers; }
+ }
+
+ protected override void Generate()
+ {
+ base.Generate();
+
+ using (MakefileWriter makefile = new MakefileWriter(Directory.GetCurrentDirectory() + "\\" + Project.MakeFile))
+ {
+ makefile.WriteComplexComment("THIS FILE IS AUTOMATICALLY GENERATED, EDIT " + Project.XmlFile + " INSTEAD");
+ makefile.WriteLine();
+
+ makefile.WriteProperty("nasm", "nasm");
+ makefile.WriteProperty("ARCH", "i386");
+
+ foreach (RBuildProperty property in SysGen.Project.Properties)
+ {
+ if (property.Internal == false)
+ {
+ if (property.Value != null)
+ {
+ makefile.WriteProperty(
+ property.Name.ToString(),
+ property.Value.ToString());
+ }
+ }
+ }
+
+ makefile.WriteComplexComment("XML rbuild files");
+
+ makefile.WritePropertyListStart("XMLBUILDFILES");
+ WriteXmlRBuildFiles(makefile, Project);
+ makefile.WritePropertyListEnd();
+
+ MingwRBuildElementHandler projectHandler = new MingwRBuildProjectHandler(Project);
+
+ projectHandler.Makefile = makefile;
+ projectHandler.SysGen = SysGen;
+ projectHandler.GenerateMakeFile();
+
+ //BackendBuildModule cModule;
+ SourceFile cFile;
+ MingwRBuildModuleHandler moduleHandler = null;
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ makefile.WritePropertyListStart(module.MakeFileSources);
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ makefile.WriteIndentedLine(file.FullPath);
+ }
+ makefile.WritePropertyListEnd();
+ }
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.RpcClient)
+ {
+ makefile.WritePropertyListStart(module.MakeFileRPCHeaders);
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceRpcClientHeaderFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFileRPCSources);
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeActualFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ }
+
+ if (module.Type == ModuleType.RpcClient ||
+ module.Type == ModuleType.RpcServer ||
+ module.Type == ModuleType.RpcProxy)
+ {
+ makefile.WritePropertyListStart(module.MakeFileObjs);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ // Luego compilamos el resto de fuentes
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (!cFile.File.IsWidl && !cFile.File.IsMessageTable)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ }
+ else
+ {
+ makefile.WritePropertyListStart(module.MakeFileHeaders);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (module.Type == ModuleType.EmbeddedTypeLib)
+ {
+ /* idl files in EmbeddedTypeLib modules do not generate header files */
+ }
+ else
+ {
+ if (cFile.File.IsWidl)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFilePCHHeaders);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsHeader)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFileMCHeaders);
+
+ // Procesamos primero los .idl que generan .h que pueden
+ // ser luego requeridos para compilar el resto del módulo.
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+
+ if (cFile.File.IsMessageTable)
+ {
+ makefile.WriteIndentedLine(cFile.MessageTableHeaderFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ makefile.WritePropertyListStart(module.MakeFileObjs);
+
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ cFile = new SourceFile(file, module, SysGen);
+ //if (cFile.File.IsCompilable)
+ if (!cFile.File.IsWidl && !cFile.File.IsMessageTable &&!cFile.File.IsHeader)
+ {
+ makefile.WriteIndentedLine(cFile.SourceCodeObjectFile.IntermediateFullPath);
+ }
+ }
+
+ makefile.WritePropertyListEnd();
+ }
+ }
+
+ makefile.WriteLine();
+
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ moduleHandler = null;
+
+ switch (module.Type)
+ {
+ case ModuleType.RpcClient:
+ moduleHandler = new MingwRpcClientHeaderModuleHandler(module);
+ break;
+ case ModuleType.RpcServer:
+ moduleHandler = new MingwRpcServerHeaderModuleHandler(module);
+ break;
+ case ModuleType.RpcProxy:
+ moduleHandler = new MingwRpcProxyModuleHandler(module);
+ break;
+ case ModuleType.BootLoader:
+ moduleHandler = new MingwBootLoaderModuleHandler(module);
+ break;
+ case ModuleType.BootSector:
+ moduleHandler = new MingwBootSectorModuleHandler(module);
+ break;
+ case ModuleType.IdlHeader:
+ moduleHandler = new MingwIdlHeaderModuleHandler(module);
+ break;
+ case ModuleType.Win32CUI:
+ moduleHandler = new MingwWin32CUIModuleHandler(module);
+ break;
+ case ModuleType.Win32SCR:
+ case ModuleType.Win32GUI:
+ moduleHandler = new MingwWin32GUIModuleHandler(module);
+ break;
+ case ModuleType.Win32DLL:
+ moduleHandler = new MingwWin32DLLModuleHandler(module);
+ break;
+ case ModuleType.Win32OCX:
+ moduleHandler = new MingwWin32OCXModuleHandler(module);
+ break;
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ moduleHandler = new MingwKernelModeDLLModuleHandler(module);
+ break;
+ case ModuleType.KernelModeDriver:
+ moduleHandler = new MingwKernelModeDriverModuleHandler(module);
+ break;
+ case ModuleType.Kernel:
+ moduleHandler = new MingwKernelModuleHandler(module);
+ break;
+ case ModuleType.NativeCUI:
+ moduleHandler = new MingwNativeCUIModuleHandler(module);
+ break;
+ case ModuleType.NativeDLL:
+ moduleHandler = new MingwNativeDLLModuleHandler(module);
+ break;
+ case ModuleType.ObjectLibrary:
+ moduleHandler = new MingwObjectLibraryModuleHandler(module);
+ break;
+ case ModuleType.StaticLibrary:
+ moduleHandler = new MingwStaticLibraryModuleHandler(module);
+ break;
+ case ModuleType.EmbeddedTypeLib:
+ moduleHandler = new MingwEmbeddedTypeLibModuleHandler(module);
+ break;
+ case ModuleType.HostStaticLibrary:
+ moduleHandler = new MingwHostStaticLibraryModuleHandler(module);
+ break;
+ case ModuleType.BuildTool:
+ moduleHandler = new MingwBuildToolModuleHandler(module);
+ break;
+ case ModuleType.Cabinet:
+ moduleHandler = new MingwCabinetModuleHandler(module);
+ break;
+ case ModuleType.Iso:
+ moduleHandler = new MingwBootCDTargetHandler(module);
+ break;
+ case ModuleType.LiveIso:
+ moduleHandler = new MingwLiveCDTargetHandler(module);
+ break;
+ case ModuleType.IsoRegTest:
+ moduleHandler = new MingwBootCDRegTestTargetHandler(module);
+ break;
+ case ModuleType.LiveIsoRegTest:
+ moduleHandler = new MingwLiveCDRegTestTargetHandler(module);
+ break;
+ case ModuleType.MessageHeader:
+ moduleHandler = new MingwMessageHeaderModuleHandler(module);
+ break;
+ case ModuleType.Package:
+ moduleHandler = new MingwPackageModuleHandler(module);
+ break;
+ }
+
+ if (moduleHandler != null)
+ {
+ moduleHandler.SysGen = SysGen;
+ moduleHandler.Makefile = makefile;
+ moduleHandler.Project = Project;
+
+ ModuleHandlers.Add(moduleHandler);
+ }
+
+ }
+
+ foreach (MingwRBuildModuleHandler moduleHandler2 in ModuleHandlers)
+ {
+ if (moduleHandler2.Module.IsBuildable) // Hack
+ {
+ makefile.WriteProperty(moduleHandler2.Module.MakeFileTarget, moduleHandler2.ModuleTarget);
+ }
+ }
+
+ foreach (MingwRBuildModuleHandler moduleHandler2 in ModuleHandlers)
+ {
+ if (moduleHandler2.Module.IsBuildable) // Hack
+ {
+ makefile.WriteComplexComment("Buid instructions for module '{0}' on '{1}' [{2}]",
+ moduleHandler2.Module.Name,
+ moduleHandler2.Module.Base,
+ moduleHandler2.Module.Type);
+
+ moduleHandler2.GenerateMakeFile();
+
+ makefile.WritePhonyTarget(moduleHandler2.Module.MakeFileMakeTarget);
+ makefile.WriteRule(moduleHandler2.Module.Name, moduleHandler2.Module.MakeFileTargetMacro);
+ makefile.WriteLine();
+
+ makefile.WriteSingleLineTarget(moduleHandler2.Module.MakeFileInfoTarget);
+ makefile.WriteLine("\t@echo =======================Module Info============================");
+ makefile.WriteLine("\t@echo Name: '{0}'", moduleHandler2.Module.Name);
+ makefile.WriteLine("\t@echo Type: '{0}'", moduleHandler2.Module.Type);
+ makefile.WriteLine("\t@echo Base: '{0}'", moduleHandler2.Module.Base);
+ makefile.WriteLine("\t@echo XML: '{0}'", moduleHandler2.Module.RBuildPath);
+ makefile.WriteLine("\t@echo Target: '{0}'", moduleHandler2.Module.TargetName);
+ makefile.WriteLine("\t@echo ===============================================================");
+ makefile.WriteLine();
+
+ makefile.WriteSingleLineTarget(moduleHandler2.Module.MakeFileFlagDebugTarget);
+ makefile.WriteLine("\t@echo =======================Module Debug Info=======================");
+ makefile.WriteLine("\t@echo CFLAGS: '{0}'", moduleHandler2.Module.MakeFileCFlagsMacro);
+ makefile.WriteLine("\t@echo LFLAGS: '{0}'", moduleHandler2.Module.MakeFileLFlagsMacro);
+ makefile.WriteLine("\t@echo LIBS: '{0}'", moduleHandler2.Module.MakeFileLibsMacro);
+ makefile.WriteLine("\t@echo LINKDEPS: '{0}'", moduleHandler2.Module.MakeFileLinkDepsMacro);
+ makefile.WriteLine("\t@echo NASM: '{0}'", moduleHandler2.Module.MakeFileNASMMacro);
+ makefile.WriteLine("\t@echo OBJS: '{0}'", moduleHandler2.Module.MakeFileObjsMacro);
+ makefile.WriteLine("\t@echo RCFLAGS: '{0}'", moduleHandler2.Module.MakeFileRCFlagsMacro);
+ makefile.WriteLine("\t@echo TARGET: '{0}'", moduleHandler2.Module.MakeFileTargetMacro);
+ makefile.WriteLine("\t@echo WIDL: '{0}'", moduleHandler2.Module.MakeFileWIDLFlagsMacro);
+ makefile.WriteLine("\t@echo ===============================================================");
+ makefile.WriteLine();
+ }
+ }
+
+ GenerateAllTarget(makefile);
+ GenerateCleanTarget(makefile);
+ GenerateInstallTarget(makefile);
+ GenerateTestTarget(makefile);
+ }
+ }
+
+ private void GenerateAllTarget(MakefileWriter makefile)
+ {
+ makefile.WriteComplexComment("Generate the ALL target");
+ makefile.WriteTarget("all");
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if ((module.Enabled) && (module.IncludeInAllTarget))
+ {
+ makefile.WriteIndentedLine(module.MakeFileTargetMacro);
+ }
+ }
+ }
+
+ private void GenerateCleanTarget(MakefileWriter makefile)
+ {
+ makefile.WriteComplexComment("Generate the CLEAN target");
+ makefile.WriteTarget("clean");
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ makefile.WriteIndentedLine(module.MakeFileCleanTarget);
+ }
+ }
+
+ private void GenerateInstallTarget(MakefileWriter makefile)
+ {
+ makefile.WriteComplexComment("Generate the INSTALL target");
+ makefile.WriteTarget("install");
+
+ //foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ //{
+ // makefile.WriteIndentedLine(module.MakeFileCleanTarget);
+ //}
+ }
+
+ private void GenerateTestTarget(MakefileWriter makefile)
+ {
+ RBuildFolderCollection folders = new RBuildFolderCollection();
+
+ makefile.WriteComplexComment("Generate the TEST target");
+ makefile.WriteSingleLineTarget("test");
+
+ foreach (RBuildFolder folder in Project.Folders)
+ {
+ if (folders.Contains(folder) == false)
+ folders.Add(folder);
+ }
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ foreach (RBuildFolder folder in module.Folders)
+ {
+ if (folders.Contains(folder) == false)
+ folders.Add(folder);
+ }
+ }
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ if (folders.Contains(folder) == false)
+ folders.Add(folder);
+ }
+
+ foreach (RBuildFolder folder in folders)
+ {
+ GenerateFolder(makefile, folder);
+ }
+ }
+
+ private void GenerateFolder(MakefileWriter makefile, RBuildFolder folder)
+ {
+ if ((folder.Root == PathRoot.Default) ||
+ (folder.Root == PathRoot.SourceCode))
+ {
+ makefile.WriteLine("{0}: | {1}",
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Intermediate, folder.FullPath)),
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Intermediate, folder.Parent.FullPath)));
+
+ makefile.WriteSingleLineIndented("$(ECHO_MKDIR)");
+ makefile.WriteSingleLineIndented("$(mkdir) $@");
+
+ makefile.WriteLine("{0}: | {1}",
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Output, folder.FullPath)),
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(PathRoot.Output, folder.Parent.FullPath)));
+
+ makefile.WriteSingleLineIndented("$(ECHO_MKDIR)");
+ makefile.WriteSingleLineIndented("$(mkdir) $@");
+ }
+
+ //Create the install and output folders
+ if (folder.Root == PathRoot.Output ||
+ folder.Root == PathRoot.Install)
+ {
+ makefile.WriteLine("{0}: | {1}",
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(folder.Root, folder.FullPath)),
+ SysGen.ResolveRBuildFilePath(new RBuildFolder(folder.Root, folder.Parent.FullPath)));
+
+ makefile.WriteSingleLineIndented("$(ECHO_MKDIR)");
+ makefile.WriteSingleLineIndented("$(mkdir) $@");
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwRBuildElementHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwRBuildElementHandler.cs
new file mode 100644
index 00000000000..f76bcc21151
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/MingwRBuildElementHandler.cs
@@ -0,0 +1,923 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public enum LinkerSubSystem
+ {
+ Windows,
+ Console,
+ Native
+ }
+
+ public abstract class MingwRBuildMakefileGenerator
+ {
+ protected SysGenEngine m_SysGenEngine = null;
+ protected MakefileWriter m_Makefile = null;
+
+ public SysGenEngine SysGen
+ {
+ get { return m_SysGenEngine; }
+ set { m_SysGenEngine = value; }
+ }
+
+ public MakefileWriter Makefile
+ {
+ get { return m_Makefile; }
+ set { m_Makefile = value; }
+ }
+
+ protected virtual string ResolveRBuildFilePath(RBuildFile file)
+ {
+ return SysGen.ResolveRBuildFilePath(file);
+ }
+
+ protected virtual string ResolveRBuildFolderPath(RBuildFolder folder)
+ {
+ return SysGen.ResolveRBuildFolderPath(folder);
+ }
+
+ public virtual string ResolveRBuildFilePath(PathRoot root, RBuildFileSystemInfo file)
+ {
+ return SysGen.ResolveRBuildFilePath(root , file);
+ }
+
+ public abstract void GenerateMakeFile();
+ }
+
+ public abstract class MingwRBuildElementHandler : MingwRBuildMakefileGenerator
+ {
+ protected RBuildElement m_BuildElement = null;
+
+ public MingwRBuildElementHandler(RBuildElement element)
+ {
+ m_BuildElement = element;
+ }
+
+ public override void GenerateMakeFile()
+ {
+ /* Do checking */
+ CheckSourceFiles();
+
+ /* Do makefile generation */
+ WriteCommon();
+ WriteSpecific();
+ //WritePCHFiles();
+ WriteFiles();
+ WriteLinker();
+ WriteImportLibrary();
+ WriteCleanTarget();
+ }
+
+ protected virtual void WriteFolders()
+ {
+ Makefile.WritePropertyListStart(BuildElement.MakeFileFolders);
+ WriteElementFolders(Makefile, BuildElement);
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected virtual void CheckSourceFiles()
+ {
+ }
+
+ protected virtual void WriteCommon()
+ {
+ WriteFolders();
+ WriteCFlags();
+ WriteRCFlags();
+ WriteLFlags();
+ WriteWIDLFlags();
+ }
+
+ protected virtual void WriteStrip()
+ {
+ }
+
+ protected virtual void WriteNonSymbolStripped()
+ {
+ }
+
+ protected virtual void WriteRsym()
+ {
+ }
+
+ protected virtual void WriteImportLibrary()
+ {
+ }
+
+ protected virtual void WriteLinker()
+ {
+ }
+
+ protected virtual void WriteCleanTarget()
+ {
+ }
+
+ protected virtual void WriteSpecific()
+ {
+ }
+
+ protected virtual void WriteFiles()
+ {
+ }
+
+ protected virtual void WritePCHFiles()
+ {
+ }
+
+ protected virtual void WriteCFlags()
+ {
+ Makefile.WritePropertyListStart(BuildElement.MakeFileCFlags);
+ WriteElementIncludes(Makefile, BuildElement);
+ WriteElementDefines(Makefile, BuildElement);
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected virtual void WriteLFlags()
+ {
+ Makefile.WritePropertyListStart(BuildElement.MakeFileLFlags);
+ WriteLinkerFlags(Makefile, BuildElement);
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected virtual void WriteRCFlags()
+ {
+ Makefile.WriteProperty(BuildElement.MakeFileRCFlags, BuildElement.MakeFileCFlagsMacro);
+ }
+
+ protected virtual void WriteWIDLFlags()
+ {
+ Makefile.WriteProperty(BuildElement.MakeFileWIDLFlags, BuildElement.MakeFileCFlagsMacro);
+ }
+
+ protected void WriteElementDefines(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (RBuildDefine define in element.Defines)
+ {
+ if (!define.IsEmpty)
+ {
+ makefile.WriteIndentedLine("-D" + define.Name + "=" + define.Value);
+ }
+ else
+ makefile.WriteIndentedLine("-D" + define.Name);
+ }
+ }
+
+ protected void WriteElementDependencyFlags(MakefileWriter makefile, RBuildModule module)
+ {
+ foreach (RBuildModule dependency in module.Dependencies)
+ {
+ Makefile.WriteIndentedLine(dependency.MakeFileTargetMacro);
+ }
+ }
+
+ protected void WriteElementIncludes(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (RBuildFolder includeFolder in element.IncludeFolders)
+ {
+ Makefile.WriteIndentedLine("-I" + ResolveRBuildFolderPath(includeFolder));
+ }
+ }
+
+ protected void WriteElementFolders(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (RBuildFolder folder in element.Folders)
+ {
+ Makefile.WriteIndentedLine(ResolveRBuildFolderPath(folder));
+ }
+ }
+
+ protected void WriteModuleAssemblyFlags(MakefileWriter makefile, RBuildModule module)
+ {
+ foreach (string assemblyFlag in module.AssemblyFlags)
+ {
+ Makefile.WriteIndentedLine(assemblyFlag);
+ }
+ }
+
+ protected void WriteCompilerFlags(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (string compilerFlag in element.CompilerFlags)
+ {
+ Makefile.WriteIndentedLine(compilerFlag);
+ }
+ }
+
+ protected void WriteLinkerFlags(MakefileWriter makefile, RBuildElement element)
+ {
+ foreach (string linkerFlag in element.LinkerFlags)
+ {
+ Makefile.WriteIndentedLine(linkerFlag);
+ }
+ }
+
+ public RBuildElement BuildElement
+ {
+ get { return m_BuildElement; }
+ }
+ }
+
+ public abstract class MingwRBuildModuleHandler : MingwRBuildElementHandler
+ {
+ private RBuildProject m_Project = null;
+ private RBuildModule m_Module = null;
+
+ private BackendBuildModule m_CompModule = null;
+ private BackedBuildFolder m_Folder = null;
+
+ public MingwRBuildModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ m_Module = module;
+ }
+
+ ////Para que sirve?
+ //public bool ReferenceObjects
+ //{
+ // get
+ // {
+ // switch (Module.Type)
+ // {
+ // case ModuleType.RpcServer:
+ // case ModuleType.RpcClient:
+ // case ModuleType.RpcProxy:
+ // case ModuleType.ObjectLibrary:
+ // //case ModuleType.IdlHeader:
+ // //case ModuleType.MessageHeader:
+ // return true;
+ // }
+
+ // return false;
+ // }
+ //}
+
+ public string ModuleTarget
+ {
+ get
+ {
+ if (Module.Type == ModuleType.IdlHeader)
+ return Module.MakeFileHeadersMacro;
+
+ if (Module.Type == ModuleType.MessageHeader)
+ return Module.MakeFileMCHeadersMacro;
+
+ if (Module.Type == ModuleType.RpcServer ||
+ Module.Type == ModuleType.RpcClient ||
+ Module.Type == ModuleType.RpcProxy ||
+ Module.Type == ModuleType.ObjectLibrary)
+ {
+ return Module.MakeFileObjsMacro;
+ }
+
+ if (Module.TargetFile.Root == PathRoot.Intermediate ||
+ Module.TargetFile.Root == PathRoot.Output ||
+ Module.TargetFile.Root == PathRoot.Default)
+ {
+ return ResolveRBuildFilePath(Module.TargetFile);
+ }
+ else
+ throw new BuildException("Don't know module target");
+ }
+ }
+
+ public override void GenerateMakeFile()
+ {
+ //m_Project = SysGen.Project;
+
+ m_CompModule = new BackendBuildModule(Module, SysGen);
+ m_Folder = new BackedBuildFolder(SysGen);
+ m_Folder.BuildFolder.Base = Module.Folder.Base;
+ m_Folder.BuildFolder.Name = Module.Folder.Name;
+ m_Folder.BuildFolder.Element = Module;
+
+ // Si se trata de un WinModule agregamos un include a la carpeta intermedia
+ // ya que algunas dlls de wine generan ahi sus recursos incrustrados como iconos
+ // o bitmaps
+ if (CompilableModule.IsWineModule)
+ {
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.Intermediate, Module.Base));
+ }
+
+ // Llamamos a la clase base
+ base.GenerateMakeFile();
+ }
+
+ protected override void WriteFiles()
+ {
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile sourceFile = new SourceFile(file, Module, SysGen);
+
+ if (CanCompile(file))
+ {
+ WriteFileBuildInstructions(sourceFile);
+ }
+ else
+ throw new Exception("Don't know how to write build instructions for '" + sourceFile.SourceCodeFile.OriginalFullPath + "' on module '" + Module.Name + "'");
+ }
+ }
+
+ protected abstract void WriteFileBuildInstructions(SourceFile sourceFile);
+
+ protected abstract bool CanCompile(RBuildSourceFile file);
+
+ protected override void WriteSpecific()
+ {
+ WriteModuleCommon();
+ WritePreconditions();
+ }
+
+ protected virtual void WritePreconditions()
+ {
+ Makefile.WritePropertyAppendListStart(Module.MakeFilePreCondition);
+ WriteElementDependencyFlags(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+ Makefile.WriteLine();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ if (file.IsCompilable)
+ {
+ Makefile.WriteLine("{0}: {1}", ResolveRBuildFilePath(file), Module.MakeFilePreConditionMacro);
+ }
+ }
+
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWidl()
+ {
+ Makefile.WritePropertyListStart(Module.MakeFileWIDLFlags);
+ WriteElementIncludes(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+
+ Makefile.WritePropertyAppend(Module.MakeFileWIDLFlags, Project.MakeFileWIDLFlagsMacro);
+ }
+
+ protected virtual void WriteLibs()
+ {
+ Makefile.WritePropertyListStart(Module.MakeFileLibs);
+
+ foreach (RBuildModule dependency in Module.Libraries)
+ {
+ if (dependency.IsDLL || dependency.IsLibrary || dependency.IsRPC)
+ {
+ if (dependency.Type == ModuleType.ObjectLibrary ||
+ dependency.Type == ModuleType.RpcClient ||
+ dependency.Type == ModuleType.RpcServer ||
+ dependency.Type == ModuleType.RpcProxy)
+ {
+ Makefile.WriteIndentedLine(dependency.MakeFileTargetMacro);
+ }
+ else
+ {
+ Makefile.WriteIndentedLine(ResolveRBuildFilePath(dependency.Dependency));
+ }
+ }
+ }
+
+ Makefile.WritePropertyListEnd();
+ }
+
+ protected void WriteModuleCommon()
+ {
+ WriteLibs();
+ WriteWidl();
+
+ if (Module.Host == false)
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileCFlags, Project.MakeFileCFlagsMacro);
+ Makefile.WritePropertyAppend(Module.MakeFileRCFlags, Project.MakeFileRCFlagsMacro);
+ Makefile.WritePropertyAppend(Module.MakeFileLFlags, Project.MakeFileLFlagsMacro);
+ }
+ else
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileLFlags, "$(HOST_LFLAGS)");
+ }
+
+ WriteLinkDeps();
+
+ if (Module.AssemblyFlags.Count > 0)
+ {
+ Makefile.WritePropertyListStart(Module.MakeFileNASMFlags);
+ WriteModuleAssemblyFlags(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+ }
+
+ Makefile.WritePropertyAppendListStart(Module.MakeFileCFlags);
+ WriteCompilerFlags(Makefile, Module);
+ Makefile.WritePropertyListEnd();
+
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteLinkDeps()
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileLinkDeps, Module.MakeFileLibsMacro);
+ }
+
+ public virtual string RpcHeaderDependencies
+ {
+ get
+ {
+ string dependencies = string.Empty;
+
+ foreach (RBuildModule module in Module.Libraries)
+ {
+ if ((module.Type == ModuleType.RpcClient) ||
+ (module.Type == ModuleType.RpcServer) ||
+ (module.Type == ModuleType.IdlHeader)) /// se puede eliminar esta linea?
+ {
+ foreach (RBuildSourceFile file in module.SourceFiles)
+ {
+ SourceFile sourceFile = new SourceFile(file, module, SysGen);
+
+ if (file.IsWidl)
+ {
+ if (module.Type == ModuleType.RpcClient)
+ dependencies += " " + sourceFile.SourceRpcClientHeaderFile.IntermediateFullPath;
+
+ if (module.Type == ModuleType.RpcServer)
+ dependencies += " " + sourceFile.SourceRpcServerHeaderFile.IntermediateFullPath;
+
+ //dependencies += " " + sourceFile.SourceCodeHeaderFile.IntermediateFullPath;
+ }
+ }
+ }
+ }
+
+ return dependencies;
+ }
+ }
+
+ public virtual string DefinitionDependencies
+ {
+ get
+ {
+ string dependencies = string.Empty;
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile sourceFile = new SourceFile(file, Module, SysGen);
+
+ if (file.IsWineBuild)
+ {
+ dependencies += " " + CompilableModule.Definition.OriginalFullPath;
+ dependencies += " " + sourceFile.SourceCodeActualFile.IntermediateFullPath;
+ }
+ else if (file.IsWidl)
+ {
+ if (Module.Type == ModuleType.RpcClient ||
+ Module.Type == ModuleType.RpcServer)
+ {
+ dependencies += " " + sourceFile.SourceCodeActualFile.IntermediateFullPath;
+ }
+ }
+ }
+
+ return dependencies;
+ }
+ }
+
+ public string Linker
+ {
+ get
+ {
+ if (Module.CPlusPlus)
+ return CPPCompiler;
+
+ return CCompiler;
+ }
+ }
+
+ public string PCHCompiler
+ {
+ get
+ {
+ if (Module.CPlusPlus)
+ return CPPCompiler;
+
+ return CCompiler;
+ }
+ }
+
+ public string CCompiler
+ {
+ get { return (Module.Host ? "$(host_gcc)" : "$(gcc)"); }
+ }
+
+ public string CPPCompiler
+ {
+ get { return (Module.Host ? "$(host_gpp)" : "$(gpp)"); }
+ }
+
+ public string ArchiveCompiler
+ {
+ get { return (Module.Host ? "$(host_ar)" : "$(ar)"); }
+ }
+
+ protected virtual void WriteAr()
+ {
+ Makefile.WriteLine(m_CompModule.Target.IntermediateFullPath + ": " + Module.MakeFileObjsMacro + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_AR)");
+
+ if (Module.Type == ModuleType.StaticLibrary ||
+ Module.Type == ModuleType.HostStaticLibrary)
+ {
+ if (Module.ImportLibrary != null)
+ {
+ Makefile.WriteLine("\t${dlltool} --dllname " + Module.ImportLibrary.DllName + " --def " + CompilableModule.Definition.OriginalFullPath + " --output-lib $@ " + MangledSymbols + " " + UnderscoreSymbols);
+ }
+ }
+
+ Makefile.WriteLine("\t${ar} -rc $@ " + Module.MakeFileObjsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWindResCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " $(wrc_TARGET) " + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_WRC)");
+ Makefile.WriteLine("\t" + CCompiler + " -xc -E -DRC_INVOKED " + Module.MakeFileRCFlagsMacro + " " + sourceFile.SourceCodeFile.OriginalFullPath + " > " + CompilableModule.RcTempFileNameFullPath);
+ Makefile.WriteLine("\t$(Q)$(wrc_TARGET) " + Module.MakeFileRCFlagsMacro + " " + CompilableModule.RcTempFileNameFullPath + " " + CompilableModule.ResTempFileNameFullPath);
+ Makefile.WriteLine("\t-@${rm} " + CompilableModule.RcTempFileNameFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t${windres} " + CompilableModule.ResTempFileNameFullPath + " -o $@");
+ Makefile.WriteLine("\t-@${rm} " + CompilableModule.ResTempFileNameFullPath + " 2>$(NUL)");
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWIDLTypeLibrary(SourceFile file)
+ {
+ Makefile.WriteLine(file.Target.IntermediateFullPath + ": " + file.SourceCodeFile.OriginalFullPath + " $(widl_TARGET) " + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WIDL)");
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + Module.MakeFileWIDLFlagsMacro + " -t -T " + file.Target.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWIDLHeader(SourceFile file)
+ {
+ Makefile.WriteLine(file.SourceCodeObjectFile.IntermediateFullPath + ": " + file.SourceCodeFile.OriginalFullPath + " $(widl_TARGET) " + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WIDL)");
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeObjectFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWIDLRpcHeader(SourceFile file)
+ {
+ Makefile.WriteLine(file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeHeaderFile.IntermediateFullPath + ": " + file.SourceCodeFile.OriginalFullPath + " $(widl_TARGET) | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WIDL)");
+
+ if (Module.Type == ModuleType.RpcServer)
+ {
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + file.File.Switches + " " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeHeaderFile.IntermediateFullPath + " -s -S " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+ else if (Module.Type == ModuleType.RpcClient)
+ {
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + file.File.Switches + " " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeHeaderFile.IntermediateFullPath + " -c -C " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+ else if (Module.Type == ModuleType.RpcProxy)
+ {
+ Makefile.WriteLine("\t$(Q)$(widl_TARGET) " + file.File.Switches + " " + Module.MakeFileWIDLFlagsMacro + " -h -H " + file.SourceCodeHeaderFile.IntermediateFullPath + " -p -P " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ if (Module.Type == ModuleType.RpcServer ||
+ Module.Type == ModuleType.RpcClient)
+ {
+ Makefile.WriteLine(file.SourceCodeObjectFile.IntermediateFullPath + ": " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceRpcServerHeaderFile.IntermediateFullPath + " " + file.SourceRpcClientHeaderFile.IntermediateFullPath + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+ else if (Module.Type == ModuleType.RpcProxy)
+ {
+ Makefile.WriteLine(file.SourceCodeObjectFile.IntermediateFullPath + ": " + file.SourceCodeActualFile.IntermediateFullPath + " " + file.SourceCodeHeaderFile.IntermediateFullPath + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+ }
+
+ protected virtual void WriteWineBuild(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(CompilableModule.Definition.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " $(winebuild_TARGET) | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_WINEBLD)");
+ Makefile.WriteLine("\t$(Q)$(winebuild_TARGET) $(WINEBUILD_FLAGS) -o " + CompilableModule.Definition.IntermediateFullPath + " --def -E " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+
+ Makefile.WriteLine(sourceFile.SourceCodeActualFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " $(winebuild_TARGET)");
+ Makefile.WriteLine("\t$(ECHO_WINEBLD)");
+ Makefile.WriteLine("\t$(Q)$(winebuild_TARGET) $(WINEBUILD_FLAGS) -o " + sourceFile.SourceCodeActualFile.IntermediateFullPath + " --pedll " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeActualFile.IntermediateFullPath + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WritePCH(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " " + RpcHeaderDependencies + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_PCH)");
+ Makefile.WriteLine("\t" + PCHCompiler + " -o " + sourceFile.SourceCodeObjectFile.IntermediateFullPath + " " + Module.MakeFileCFlagsMacro + " -g " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " " + Module.MakeFileHeadersMacro + " " + PrecompiledHeader + " " + RpcHeaderDependencies + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteWMC(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.MessageTableHeaderFile.IntermediateFullPath + " " + sourceFile.MessageTableResourceFile.IntermediateFullPath + ": " + "$(wmc_TARGET)" + " " + sourceFile.SourceCodeFile.OriginalFullPath + " | " + sourceFile.MessageTableHeaderFile.IntermediateFolderFullPath + " " + sourceFile.MessageTableResourceFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_WMC)");
+ Makefile.WriteLine("\t$(Q)$(wmc_TARGET) -i -H " + sourceFile.MessageTableHeaderFile.IntermediateFullPath + " -o " + sourceFile.MessageTableResourceFile.IntermediateFullPath + " " + sourceFile.SourceCodeFile.OriginalFullPath);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCPPCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " " + Module.MakeFileHeadersMacro + " " + PrecompiledHeader + " " + RpcHeaderDependencies + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath);
+ Makefile.WriteLine("\t$(ECHO_CC)");
+ Makefile.WriteLine("\t" + CPPCompiler + " -c $< -o $@ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteNASMCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath /*+ ModuleFolder.IntermediateFullPath*/);
+ Makefile.WriteLine("\t$(ECHO_NASM)");
+ Makefile.WriteLine("\t$(Q)${nasm} -f win32 $< -o $@ " + Module.MakeFileNASMMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteASMCompiler(SourceFile sourceFile)
+ {
+ Makefile.WriteLine(sourceFile.SourceCodeObjectFile.IntermediateFullPath + ": " + sourceFile.SourceCodeFile.OriginalFullPath + " | " + sourceFile.SourceCodeFile.IntermediateFolderFullPath /*+ ModuleFolder.IntermediateFullPath*/);
+ Makefile.WriteLine("\t$(ECHO_GAS)");
+ Makefile.WriteLine("\t" + CCompiler + " -x assembler-with-cpp -c $< -o $@ -D__ASM__ " + Module.MakeFileCFlagsMacro);
+ Makefile.WriteLine();
+ }
+
+ protected override void WriteRsym()
+ {
+ Makefile.WriteLine("\t$(ECHO_RSYM)");
+ Makefile.WriteLine("\t$(Q)$(RSYM_TARGET) $@ $@");
+ Makefile.WriteLine();
+ }
+
+ protected override void WriteStrip()
+ {
+ if (SysGen.Project.Properties["ROS_LEAN_AND_MEAN"] != null)
+ {
+ //No s'ha provat
+ Makefile.WriteLine("\t$(ECHO_STRIP)");
+ Makefile.WriteLine("\t${strip} -s -x -X $@");
+ Makefile.WriteLine();
+ }
+ }
+
+ protected override void WriteNonSymbolStripped()
+ {
+ if (SysGen.Project.Properties["ROS_BUILDNOSTRIP"] != null)
+ {
+ //No s'ha provat
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + m_CompModule.TargetNoStrip.OutputFullPath + " 1>$(NUL)");
+ Makefile.WriteLine();
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ //Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + CompilableModule.Definition.OriginalFullPath + " " + Module.MakeFileLinkDepsMacro + " " + Module.MakeFileObjsMacro + " $(RSYM_TARGET) $(PEFIXUP_TARGET) | " + /*ModuleFolder.TemporaryFullPath*/ ModuleFolder.OutputFullPath);
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + Definition + " " + Module.MakeFileLinkDepsMacro + " " + Module.MakeFileObjsMacro + " $(RSYM_TARGET) $(PEFIXUP_TARGET) | " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_LD)");
+
+ if (Module.IsDLL)
+ {
+ Makefile.WriteLine("\t${dlltool} --dllname " + Module.TargetName + " --def " + CompilableModule.Definition.OriginalFullPath + " --output-exp " + m_CompModule.ExpTempFileNameFullPath + " " + MangledSymbols + " " + UnderscoreSymbols);
+ }
+
+ Makefile.WriteLine("\t" + Linker + " " + LinkerParameters);
+
+ if (Module.IsDLL)
+ {
+ Makefile.WriteLine("\t$(Q)$(PEFIXUP_TARGET) " + Module.MakeFileTargetMacro + " -exports" + " " + PefixupParameters);
+ Makefile.WriteLine("\t-@${rm} " + m_CompModule.ExpTempFileNameFullPath + " 2>$(NUL)");
+ }
+
+ Makefile.WriteLine();
+
+ WriteRsym();
+ WriteStrip();
+ WriteNonSymbolStripped();
+ }
+
+ public string Definition
+ {
+ get
+ {
+ if (Module.ImportLibrary != null)
+ return CompilableModule.Definition.OriginalFullPath;
+
+ return string.Empty;
+ }
+ }
+
+ public virtual string PefixupParameters
+ {
+ get
+ {
+ if ((Module.Type == ModuleType.Kernel) ||
+ (Module.Type == ModuleType.KernelModeDLL) ||
+ (Module.Type == ModuleType.KernelModeDriver) ||
+ (Module.Type == ModuleType.KeyboardLayout))
+ {
+ return "-sections";
+ }
+
+ return string.Empty;
+ }
+ }
+
+ public string LinkerScript
+ {
+ get
+ {
+ if (Module.LinkerScript != null)
+ return string.Format("-Wl,-T,{0}", Module.LinkerScript.FullPath);
+
+ return string.Empty;
+ }
+ }
+
+ public string MangledSymbols
+ {
+ get
+ {
+ if (Module.MangledSymbols)
+ return string.Empty;
+
+ return "--kill-at";
+ }
+ }
+
+ public string UnderscoreSymbols
+ {
+ get
+ {
+ if (Module.UnderscoreSymbols)
+ return "--add-underscore";
+
+ return string.Empty;
+ }
+ }
+
+
+ protected string PrecompiledHeader
+ {
+ get
+ {
+ if (Module.PreCompiledHeader != null)
+ return Module.MakeFilePCHMacro;
+
+ return string.Empty;
+ }
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ Makefile.WritePhonyTarget(Module.MakeFileCleanTarget);
+ Makefile.WriteSingleLineTarget(Module.MakeFileCleanTarget);
+
+ if (Module.Type != ModuleType.Cabinet) //Hack:
+ {
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeObjectFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ Makefile.WriteLine("\t-@$(rm) " + Module.MakeFileTargetMacro + " 2>$(NUL)");
+ Makefile.WriteLine();
+ }
+
+ protected override void WriteImportLibrary ()
+ {
+ if (Module.HasImportLibrary)
+ {
+ Makefile.WriteComment("IMPORT LIBRARY RULE");
+ Makefile.WriteLine(ResolveRBuildFilePath(Module.Dependency) + ": " + CompilableModule.Definition.OriginalFullPath + " " + DefinitionDependencies + " | " + ModuleFolder.IntermediateFullPath);
+ Makefile.WriteLine("\t$(ECHO_DLLTOOL)");
+ Makefile.WriteLine("\t$(dlltool) --dllname " + Module.TargetName + " --def " + CompilableModule.Definition.OriginalFullPath + " --output-lib " + /*CompilableModule.Dependency.IntermediateFullPath*/ ResolveRBuildFilePath(Module.Dependency) + " " + MangledSymbols + " " + UnderscoreSymbols);
+ Makefile.WriteLine();
+ }
+ }
+
+ protected virtual string LinkerParameters
+ {
+ get
+ {
+ return string.Format("-Wl,--subsystem," + SubSystem + " -Wl,--entry,{0} -Wl,--image-base,{1} " + AdditionalParameters2 + " -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 " + " " + NoStartFiles + " " + Shared + " " + LinkerScript + " " + AdditionalParamters + " -o {2} {3} {4} {5}",
+ Module.LinkerEntryPoint,
+ Module.BaseAddress,
+ Module.MakeFileTargetMacro,
+ Module.MakeFileObjsMacro,
+ Module.MakeFileLibsMacro,
+ Module.MakeFileLFlagsMacro);
+ }
+ }
+
+ protected virtual string AdditionalParameters2
+ {
+ get { return string.Empty; }
+ }
+
+ //Fixme:
+ protected virtual LinkerSubSystem LinkerSubsystem
+ {
+ get { return LinkerSubSystem.Console; }
+ }
+
+ protected virtual string SubSystem
+ {
+ get { return "console"; }
+ }
+
+ protected virtual string NoStartFiles
+ {
+ get
+ {
+ if (Module.Type == ModuleType.NativeCUI ||
+ Module.Type == ModuleType.NativeDLL ||
+ Module.Type == ModuleType.Kernel ||
+ Module.Type == ModuleType.KernelModeDLL ||
+ Module.Type == ModuleType.KernelModeDriver ||
+ Module.Type == ModuleType.KeyboardLayout)
+ {
+ return "-nostartfiles";
+ }
+
+ return string.Empty;
+ }
+ }
+
+ protected virtual string Shared
+ {
+ get
+ {
+ if (Module.IsDLL)
+ return "-shared";
+
+ return string.Empty;
+ }
+ }
+
+ protected virtual string AdditionalParamters
+ {
+ get
+ {
+ if (Module.IsDLL)
+ return m_CompModule.ExpTempFileNameFullPath;
+
+ return string.Empty;
+ }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_BuildElement as RBuildModule; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ set { m_Project = value; }
+ }
+
+ public BackendBuildModule CompilableModule
+ {
+ get { return m_CompModule; }
+ }
+
+ public BackedBuildFolder ModuleFolder
+ {
+ get { return m_Folder; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/Misc/MakefileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/Misc/MakefileWriter.cs
new file mode 100644
index 00000000000..5dbb01e08fb
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/Misc/MakefileWriter.cs
@@ -0,0 +1,99 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MakefileWriter : StreamWriter
+ {
+ public MakefileWriter(string path)
+ : base(path)
+ {
+ }
+
+ public void WriteComment(string text)
+ {
+ WriteLine("# {0}" , text);
+ }
+
+ public void WriteComplexComment(string text, params object[] args)
+ {
+ WriteComplexComment(string.Format(text, args));
+ }
+
+ public void WriteComplexComment(string text)
+ {
+ WriteLine();
+ WriteLine("#===================================================================================");
+ WriteLine("# {0}", text);
+ WriteLine("#===================================================================================");
+ WriteLine();
+ }
+
+ public void WriteIndentedLine(string text , params object[] args)
+ {
+ WriteIndentedLine(string.Format(text, args));
+ WriteLine();
+ }
+
+ public void WriteSingleLineIndented(string text)
+ {
+ WriteLine("\t{0}", text);
+ }
+
+ public void WriteIndentedLine(string text)
+ {
+ WriteLine("\t{0} \\", text);
+ }
+
+ public void WriteProperty(string propertyName , string propertyValue)
+ {
+ WriteLine("{0} := {1}" ,
+ propertyName ,
+ propertyValue);
+ }
+
+ public void WritePropertyAppend(string propertyName, string propertyValue)
+ {
+ WriteLine("{0} += {1}",
+ propertyName,
+ propertyValue);
+ }
+
+ public void WritePropertyAppendListStart(string propertyName)
+ {
+ WriteLine("{0} += \\", propertyName);
+ }
+
+ public void WritePropertyListStart(string propertyName)
+ {
+ WriteLine("{0} := \\", propertyName);
+ }
+
+ public void WritePropertyListEnd()
+ {
+ WriteLine();
+ }
+
+ public void WritePhonyTarget(string targetName)
+ {
+ WriteLine(".PHONY: {0}", targetName);
+ }
+
+ public void WriteSingleLineTarget(string targetName)
+ {
+ WriteLine("{0}:", targetName);
+ }
+
+ public void WriteTarget(string targetName)
+ {
+ WriteLine("{0}: \\", targetName);
+ }
+
+ public void WriteRule(string targetName , string targetName2)
+ {
+ WriteLine("{0}: {1}", targetName, targetName2);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/Base/MingwRBuildModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/Base/MingwRBuildModuleHandler.cs
new file mode 100644
index 00000000000..d599896ff49
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/Base/MingwRBuildModuleHandler.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootLoaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootLoaderModuleHandler.cs
new file mode 100644
index 00000000000..a3642c0d0e4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootLoaderModuleHandler.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBootLoaderModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwBootLoaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return false;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + Module.MakeFileObjsMacro + " " + Module.MakeFileLinkDepsMacro + " | " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_LD)");
+ //Makefile.WriteLine("\t$(ld) {0} -N -Ttext=0x8000 -o {1} {2} {3}", Module.MakeFileLFlagsMacro, CompilableModule.JunkTempFileNameFullPath, Module.MakeFileObjsMacro, Module.MakeFileLinkDepsMacro);
+ Makefile.WriteLine("\t$(gcc) -Wl,--subsystem,native -Wl,-N -Ttext=0x8000 -o {0} {1} {2} {3}", CompilableModule.JunkTempFileNameFullPath, Module.MakeFileObjsMacro, Module.MakeFileLinkDepsMacro, Module.MakeFileLFlagsMacro);
+ Makefile.WriteLine("\t$(objcopy) -O binary {0} $@", CompilableModule.JunkTempFileNameFullPath);
+ Makefile.WriteLine("\t-@$(rm) {0} 2>$(NUL)", CompilableModule.JunkTempFileNameFullPath);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootSectorModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootSectorModuleHandler.cs
new file mode 100644
index 00000000000..8db44129cf8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBootSectorModuleHandler.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBootSectorModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwBootSectorModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsNASM);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsNASM)
+ {
+ WriteNASMCompiler(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBuildToolModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBuildToolModuleHandler.cs
new file mode 100644
index 00000000000..ac8a70ff4a9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwBuildToolModuleHandler.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwBuildToolModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwBuildToolModuleHandler(RBuildModule module)
+ : base(module)
+
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsC || file.IsCPP);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + Module.MakeFileObjsMacro + " " + Module.MakeFileLinkDepsMacro + " | " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_LD)");
+ Makefile.WriteLine("\t" + Linker + " " + Module.MakeFileLFlagsMacro + " -o $@ " + Module.MakeFileObjsMacro + " " + Module.MakeFileLibsMacro );
+ Makefile.WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwCabinetModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwCabinetModuleHandler.cs
new file mode 100644
index 00000000000..8bc979878c7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwCabinetModuleHandler.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwCabinetModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwCabinetModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return true;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ base.WriteSpecific();
+
+ Makefile.WriteLine(Module.MakeFileTargetMacro + ": $(cabman_TARGET) " + ModuleFolder.OutputFullPath);
+ Makefile.WriteLine("\t$(ECHO_CABMAN)");
+ Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -M raw -S " + Module.MakeFileTargetMacro + " " + Module.MakeFileSourcesMacro);
+ Makefile.WriteLine();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwEmbeddedTypeLibModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwEmbeddedTypeLibModuleHandler.cs
new file mode 100644
index 00000000000..752cfaf896b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwEmbeddedTypeLibModuleHandler.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwEmbeddedTypeLibModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwEmbeddedTypeLibModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void CheckSourceFiles()
+ {
+ if (Module.SourceFiles.Count > 1)
+ {
+ throw new BuildException("Modules of type 'EmbeddedTypeLib' can only contain 1 source file , this module contains '{0}", Module.SourceFiles.Count);
+ }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLTypeLibrary(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ //WriteAr();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwHostStaticLibraryModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwHostStaticLibraryModuleHandler.cs
new file mode 100644
index 00000000000..3a70452326f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwHostStaticLibraryModuleHandler.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwHostStaticLibraryModuleHandler : MingwStaticLibraryModuleHandler
+ {
+ public MingwHostStaticLibraryModuleHandler(RBuildModule module)
+ : base(module)
+
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwIdlHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwIdlHeaderModuleHandler.cs
new file mode 100644
index 00000000000..f831d9b6199
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwIdlHeaderModuleHandler.cs
@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class MingwMessageHeaderModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwMessageHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteCommon()
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ WritePreconditions();
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDLLModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDLLModuleHandler.cs
new file mode 100644
index 00000000000..e0d03fe16d0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDLLModuleHandler.cs
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwKernelModeDLLModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwKernelModeDLLModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource || file.IsAssembler || file.IsWidl || file.IsNASM || file.IsWineBuild);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsNASM)
+ {
+ WriteNASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLHeader(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDriverModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDriverModuleHandler.cs
new file mode 100644
index 00000000000..ebbda411189
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModeDriverModuleHandler.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwKernelModeDriverModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwKernelModeDriverModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsC || file.IsWindResource || file.IsCPP || file.IsAssembler || file.IsWineBuild || file.IsHeader);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModuleHandler.cs
new file mode 100644
index 00000000000..c432f7f0c3c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwKernelModuleHandler.cs
@@ -0,0 +1,68 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwKernelModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwKernelModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsWindResource || file.IsCPP || file.IsAssembler || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+ }
+
+ protected override string AdditionalParameters2
+ {
+ get
+ {
+ return "";
+ //return "-Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -shared";
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwMessageHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwMessageHeaderModuleHandler.cs
new file mode 100644
index 00000000000..c08b9098994
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwMessageHeaderModuleHandler.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class MingwIdlHeaderModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwIdlHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteCommon()
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ WriteWIDLFlags();
+// WriteTarget();
+ WritePreconditions();
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteWIDLFlags()
+ {
+ Makefile.WriteLine(Module.MakeFileWIDLFlags + " := " + Project.MakeFileWIDLFlagsMacro + " -I" + ModuleFolder.BaseFullPath);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLHeader(sourceFile);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeCUIModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeCUIModuleHandler.cs
new file mode 100644
index 00000000000..4a8f5ee3436
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeCUIModuleHandler.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwNativeCUIModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwNativeCUIModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsWindResource);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeDLLModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeDLLModuleHandler.cs
new file mode 100644
index 00000000000..3f23397da34
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwNativeDLLModuleHandler.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwNativeDLLModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwNativeDLLModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsC || file.IsWindResource || file.IsAssembler || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwObjectLibraryModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwObjectLibraryModuleHandler.cs
new file mode 100644
index 00000000000..b95d425e431
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwObjectLibraryModuleHandler.cs
@@ -0,0 +1,58 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwObjectLibraryModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwObjectLibraryModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsNASM || file.IsAssembler || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsNASM)
+ {
+ WriteNASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override string SubSystem
+ {
+ get { return "console"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwPackageModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwPackageModuleHandler.cs
new file mode 100644
index 00000000000..ce2f83a2108
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwPackageModuleHandler.cs
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwPackageModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwPackageModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return true;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ }
+
+ protected override void WriteLinker()
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ base.WriteSpecific();
+
+ //Makefile.WriteLine(Module.MakeFileTargetMacro + ": $(cabman_TARGET) " + ModuleFolder.OutputFullPath);
+ //Makefile.WriteLine("\t$(ECHO_CABMAN)");
+ //Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -M raw -S " + Module.MakeFileTargetMacro + " " + Module.MakeFileSourcesMacro);
+ //Makefile.WriteLine();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRBuildProjectHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRBuildProjectHandler.cs
new file mode 100644
index 00000000000..4f7cfaaff47
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRBuildProjectHandler.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRBuildProjectHandler : MingwRBuildElementHandler
+ {
+ public MingwRBuildProjectHandler(RBuildProject project)
+ : base(project)
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ Makefile.WritePropertyListStart(Project.MakeFileGCCOptions);
+ WriteCompilerFlags(Makefile, Project);
+ Makefile.WritePropertyListEnd();
+
+ Makefile.WritePropertyAppend(Project.MakeFileCFlags, "-Wall");
+
+ if (Project.Properties["OARCH"].Value != string.Empty)
+ {
+ Makefile.WritePropertyAppend(Project.MakeFileCFlags, "-march=$(OARCH)");
+ }
+
+ Makefile.WritePropertyAppend(Project.MakeFileCFlags, Project.MakeFileGCCOptionsMacro);
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_BuildElement as RBuildProject; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcClientHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcClientHeaderModuleHandler.cs
new file mode 100644
index 00000000000..c4fa641f31e
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcClientHeaderModuleHandler.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRpcClientHeaderModuleHandler : MingwRpcServerHeaderModuleHandler
+ {
+ public MingwRpcClientHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ base.WriteCleanTarget();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeHeaderFile.IntermediateFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeObjectFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLRpcHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcProxyModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcProxyModuleHandler.cs
new file mode 100644
index 00000000000..f15d03d9301
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcProxyModuleHandler.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRpcProxyModuleHandler : MingwRpcServerHeaderModuleHandler
+ {
+ public MingwRpcProxyModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ base.WriteCleanTarget();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeHeaderFile.IntermediateFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeObjectFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLRpcHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcServerHeaderModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcServerHeaderModuleHandler.cs
new file mode 100644
index 00000000000..a09bbb3069a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwRpcServerHeaderModuleHandler.cs
@@ -0,0 +1,49 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwRpcServerHeaderModuleHandler : MingwIdlHeaderModuleHandler
+ {
+ public MingwRpcServerHeaderModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteSpecific()
+ {
+ WriteCFlags();
+ base.WriteSpecific();
+ WriteModuleCommon();
+ }
+
+ protected override void WriteCleanTarget()
+ {
+ base.WriteCleanTarget();
+
+ foreach (RBuildSourceFile file in Module.SourceFiles)
+ {
+ SourceFile cFile = new SourceFile(file, Module, SysGen);
+
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeHeaderFile.IntermediateFullPath + " 2>$(NUL)");
+ Makefile.WriteLine("\t-@$(rm) " + cFile.SourceCodeActualFile.IntermediateFullPath + " 2>$(NUL)");
+ }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsWidl);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLRpcHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwStaticLibraryModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwStaticLibraryModuleHandler.cs
new file mode 100644
index 00000000000..f915a86b2f0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwStaticLibraryModuleHandler.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwStaticLibraryModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwStaticLibraryModuleHandler(RBuildModule module)
+ : base(module)
+
+ {
+ }
+
+ /*
+ protected override void WriteLibs(RBuildModule module)
+ {
+ }
+ */
+
+ protected override void WriteCFlags()
+ {
+ base.WriteCFlags();
+
+ if (Module.IsStartupLib)
+ {
+ Makefile.WritePropertyAppend(Module.MakeFileCFlags, "-Wno-main");
+ }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader ||file.IsC || file.IsAssembler);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+ }
+
+ protected override void WriteLinker()
+ {
+ WriteAr();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32CUIModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32CUIModuleHandler.cs
new file mode 100644
index 00000000000..5097b3971c0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32CUIModuleHandler.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class MingwWin32CUIModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32CUIModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32DLLModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32DLLModuleHandler.cs
new file mode 100644
index 00000000000..a8b29f0a082
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32DLLModuleHandler.cs
@@ -0,0 +1,64 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwWin32DLLModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32DLLModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource || file.IsAssembler || file.IsWineBuild || file.IsWidl || file.IsMessageTable);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsAssembler)
+ {
+ WriteASMCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsMessageTable)
+ {
+ WriteWMC(sourceFile);
+ }
+
+ if (sourceFile.File.IsWidl)
+ {
+ WriteWIDLHeader(sourceFile);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32GUIModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32GUIModuleHandler.cs
new file mode 100644
index 00000000000..b6687778a5d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32GUIModuleHandler.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwWin32GUIModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32GUIModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader || file.IsC || file.IsCPP || file.IsWindResource || file.IsWineBuild);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "windows"; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32OCXModuleHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32OCXModuleHandler.cs
new file mode 100644
index 00000000000..7fe4f0b9c1a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/ModuleHandlers/MingwWin32OCXModuleHandler.cs
@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwWin32OCXModuleHandler : MingwRBuildModuleHandler
+ {
+ public MingwWin32OCXModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return (file.IsHeader ||file.IsC || file.IsWindResource || file.IsCPP || file.IsWineBuild);
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ if (sourceFile.File.IsHeader)
+ {
+ WritePCH(sourceFile);
+ }
+
+ if (sourceFile.File.IsC)
+ {
+ WriteCCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWindResource)
+ {
+ WriteWindResCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsCPP)
+ {
+ WriteCPPCompiler(sourceFile);
+ }
+
+ if (sourceFile.File.IsWineBuild)
+ {
+ WriteWineBuild(sourceFile);
+ }
+ }
+
+ protected override string SubSystem
+ {
+ get { return "native"; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/TargetsHandlers/Base/MingwRBuildTargetHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/TargetsHandlers/Base/MingwRBuildTargetHandler.cs
new file mode 100644
index 00000000000..b99413d3724
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/Mingw/TargetsHandlers/Base/MingwRBuildTargetHandler.cs
@@ -0,0 +1,307 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class MingwLiveCDTargetHandler : MingwRBuildIsoModuleHandler
+ {
+ public MingwLiveCDTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void AddAditionalFiles()
+ {
+ //RBuildCDFile livecdBootIni = new RBuildCDFile();
+
+ //livecdBootIni.Base = "boot\bootdata";
+ //livecdBootIni.Name = "livecd.ini";
+ //livecdBootIni.NewName = "";
+ }
+
+ protected override void WriteCabinetManager()
+ {
+ // Not required
+ }
+
+ protected override void WriteMakeHive()
+ {
+ Makefile.WriteLine("\t$(ECHO_MKHIVE)");
+ Makefile.WriteLine("\t$(mkhive_TARGET) boot\bootdata " + @"$(OUTPUT)\livecd\reactos\system32\config boot\bootdata\livecd.inf boot\bootdata\hiveinst.inf");
+ }
+
+ protected override void WriteCopyCDFiles()
+ {
+ foreach (RBuildOutputFile platformFile in SysGen.Project.Files)
+ {
+ if (platformFile is RBuildPlatformFile || platformFile is RBuildCDFile)
+ {
+ }
+ else
+ {
+ RBuildCDFile cdFile = new RBuildCDFile();
+
+ cdFile.Root = PathRoot.LiveCD;
+ cdFile.Name = platformFile.Name;
+ cdFile.Base = platformFile.InstallBase;
+
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(platformFile) + " " + ResolveRBuildFilePath(cdFile) + " 1>$(NUL)");
+ }
+ }
+
+ foreach (RBuildModule module in SysGen.Project.Modules)
+ {
+ if (module.IsInstallable)
+ {
+ RBuildCDFile cdFile = new RBuildCDFile();
+
+ cdFile.Root = PathRoot.LiveCD;
+ cdFile.Name = module.TargetFile.Name;
+ cdFile.Base = "reactos" + "//" + module.InstallBase;
+
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(module.TargetFile) + " " + ResolveRBuildFilePath(cdFile) + " 1>$(NUL)");
+ }
+ }
+
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t${cp} " + @"boot\bootdata\livecd.ini $(OUTPUT)\livecd\freeldr.ini 1>$(NUL)");
+ }
+
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output, "LiveCD"); }
+ }
+
+ protected override string ResolveRBuildFilePath(RBuildFile file)
+ {
+ if (file.Root == PathRoot.CDOutput)
+ return Path.Combine(SysGen.LiveCDOutputDirectory, file.FullPath);
+
+ return SysGen.ResolveRBuildFilePath(file);
+ }
+ }
+
+ public class MingwLiveCDRegTestTargetHandler : MingwLiveCDTargetHandler
+ {
+ public MingwLiveCDRegTestTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output, "livecdregtest"); }
+ }
+ }
+
+ public class MingwBootCDRegTestTargetHandler : MingwBootCDTargetHandler
+ {
+ public MingwBootCDRegTestTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output , "cdregtest"); }
+ }
+ }
+
+ public class MingwBootCDTargetHandler : MingwRBuildIsoModuleHandler
+ {
+ public MingwBootCDTargetHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected override void WriteCopyCDFiles()
+ {
+ base.WriteCopyCDFiles();
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if ((module.Enabled) && (module.IsBootstrap))
+ {
+ RBuildBootstrapFile bootstrapFile = module.Bootstrap;
+
+ if (bootstrapFile != null)
+ {
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(bootstrapFile) + " " + ResolveRBuildFilePath(bootstrapFile.CDNewFile) + " 1>$(NUL)");
+ }
+ }
+ }
+
+ foreach (RBuildOutputFile file in SysGen.Project.Files)
+ {
+ RBuildBootstrapFile bootstrapFile = file as RBuildBootstrapFile;
+
+ if (bootstrapFile != null)
+ {
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(bootstrapFile) + " " + ResolveRBuildFilePath(bootstrapFile.CDNewFile) + " 1>$(NUL)");
+ }
+ }
+ }
+
+ protected override void AddFolders()
+ {
+ //Ensure folder exists
+ base.AddFolders();
+
+ Module.Folders.Add(new RBuildFolder(WorkingFolder, "loader"));
+ Module.Folders.Add(new RBuildFolder(WorkingFolder, "reactos"));
+ Module.Folders.Add(new RBuildFolder(WorkingFolder, "reactos/system32"));
+ }
+
+ protected override string ResolveRBuildFilePath(RBuildFile file)
+ {
+ if (file.Root == PathRoot.CDOutput)
+ return SysGen.NormalizePath(Path.Combine(SysGen.BootCDOutputDirectory, file.FullPath));
+
+ return SysGen.ResolveRBuildFilePath(file);
+ }
+
+ public override RBuildFolder WorkingFolder
+ {
+ get { return new RBuildFolder(PathRoot.Output , "cd"); }
+ }
+ }
+
+ public abstract class MingwRBuildIsoModuleHandler : MingwRBuildModuleHandler
+ {
+ private const string PROFILES_FOLDER = "Profiles";
+ private const string ALL_USERS_FOLDER = "All Users";
+ private const string DEFAULT_USER_FOLDER = "Default User";
+ private const string DESKTOP_FOLDER = "Desktop";
+ private const string MY_DOCUMENTS_FOLDER = "My Documents";
+
+ protected List m_BuildTools = new List();
+
+ public MingwRBuildIsoModuleHandler(RBuildModule module)
+ : base(module)
+ {
+ }
+
+ protected List BuildTools
+ {
+ get { return m_BuildTools; }
+ }
+
+ public override void GenerateMakeFile()
+ {
+ AddAditionalFiles();
+ AddFolders();
+
+ WriteFolders();
+ WriteTarget();
+ WriteCabinetManager();
+ WriteCopyCDFiles();
+ WriteMakeRegistryHives();
+ WriteMakeHive();
+ WriteCDMake();
+ WriteCleanTarget();
+ }
+
+ protected virtual void AddAditionalFiles()
+ {
+ }
+
+ protected virtual void WriteMakeHive()
+ {
+ }
+
+ protected virtual void AddFolders()
+ {
+ Module.Folders.Add(WorkingFolder);
+ }
+
+ protected virtual void WriteTarget()
+ {
+ Makefile.WriteTarget(Module.MakeFileTargetMacro);
+ Makefile.WriteIndentedLine("all");
+ Makefile.WriteIndentedLine("$(cabman_TARGET)");
+ Makefile.WriteIndentedLine("$(cdmake_TARGET)");
+ Makefile.WriteIndentedLine("$(mkhive_TARGET)");
+ Makefile.WriteIndentedLine(Module.MakeFileFoldersMacro);
+
+ foreach (RBuildModule module in SysGen.Project.Platform.Modules)
+ {
+ if ((module.Enabled) && (module.IsBootstrap))
+ {
+ Makefile.WriteIndentedLine(module.MakeFileTargetMacro);
+ }
+ }
+
+ Makefile.WriteIndentedLine(BootModule.MakeFileTargetMacro);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteMakeRegistryHives()
+ {
+ }
+
+ protected virtual void WriteCabinetManager()
+ {
+ Makefile.WriteLine("\t$(ECHO_CABMAN)");
+ Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -C " + SysGen.Project.PackagesFile + @" -L $(OUTPUT)\cd\reactos -I -P $(OUTPUT)");
+ Makefile.WriteLine("\t$(Q)$(cabman_TARGET) -C " + SysGen.Project.PackagesFile + @" -RC $(OUTPUT)\cd\reactos\reactos.inf -L $(OUTPUT)\cd\reactos -N -P $(OUTPUT)");
+ Makefile.WriteLine("\t-@${rm} " + @"$(OUTPUT)\cd\reactos\reactos.inf" + " 2>$(NUL)");
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCDMake()
+ {
+ Makefile.WriteLine("\t$(ECHO_CDMAKE)");
+ Makefile.WriteLine("\t$(Q)$(cdmake_TARGET) -v -j -m -b " + ResolveRBuildFilePath(BootModule.TargetFile) + " " + ResolveRBuildFolderPath(WorkingFolder) + " " + CDLabel + " " + IsoImage);
+ Makefile.WriteLine();
+ }
+
+ protected virtual void WriteCopyCDFiles()
+ {
+ foreach (RBuildOutputFile file in SysGen.Project.Files)
+ {
+ RBuildCDFile cdFile = file as RBuildCDFile;
+
+ if (cdFile != null)
+ {
+ Makefile.WriteLine("\t$(ECHO_CP)");
+ Makefile.WriteLine("\t$(cp) " + ResolveRBuildFilePath(cdFile) + " " + ResolveRBuildFilePath(cdFile.CDNewFile) + " 1>$(NUL)");
+ }
+ }
+ }
+
+ protected virtual RBuildModule BootModule
+ {
+ get { return Module.BootSector; }
+ }
+
+ public abstract RBuildFolder WorkingFolder { get; }
+
+ public virtual string IsoImage
+ {
+ get { return ResolveRBuildFilePath(Module.TargetFile); }
+ }
+
+ public virtual string CDLabel
+ {
+ get { return Module.CDLabel; }
+ }
+
+ protected override bool CanCompile(RBuildSourceFile file)
+ {
+ return false;
+ }
+
+ protected override void WriteFileBuildInstructions(SourceFile sourceFile)
+ {
+ throw new Exception("The method or operation is not implemented.");
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/ProjectTreeReport/ProjectTreeReport.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/ProjectTreeReport/ProjectTreeReport.cs
new file mode 100644
index 00000000000..3952090f289
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/ProjectTreeReport/ProjectTreeReport.cs
@@ -0,0 +1,66 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class ProjectTreeReport : Backend
+ {
+ public ProjectTreeReport(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Tree Report"; }
+ }
+
+ protected override void Generate()
+ {
+ using (StreamWriter sw = new StreamWriter(@"C:\resTree.htm"))
+ {
+ using (HtmlTextWriter writer = new HtmlTextWriter(sw))
+ {
+ WriteModule(SysGen.RootTask , writer);
+ }
+ }
+ }
+
+ private void WriteModule(Task task, HtmlTextWriter writer)
+ {
+ ITaskContainer container = task as ITaskContainer;
+
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellpadding, "5");
+ writer.AddAttribute(HtmlTextWriterAttribute.Cellspacing, "5");
+ writer.AddAttribute(HtmlTextWriterAttribute.Border, "1");
+ writer.AddAttribute(HtmlTextWriterAttribute.Bordercolor, "#000000");
+ writer.RenderBeginTag(HtmlTextWriterTag.Table);
+ writer.RenderBeginTag(HtmlTextWriterTag.Tr);
+ writer.RenderBeginTag(HtmlTextWriterTag.Td);
+ writer.Write(task.Name);
+
+ if (container != null)
+ {
+ if (container.ChildTasks.Count > 0)
+ {
+ foreach (Task childTask in container.ChildTasks)
+ {
+ WriteModule(childTask, writer);
+ }
+ }
+ }
+
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ writer.RenderEndTag();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RBuildDB/RBuildDBBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RBuildDB/RBuildDBBackend.cs
new file mode 100644
index 00000000000..032af573ba7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RBuildDB/RBuildDBBackend.cs
@@ -0,0 +1,102 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class RBuildDBBackend : Backend
+ {
+ public RBuildDBBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "RBuild Database"; }
+ }
+
+ private string RBuildDBFile
+ {
+ get { return Path.Combine(SysGen.BaseDirectory, "rbuilddb.xml"); }
+ }
+
+ protected override void Generate()
+ {
+ // Creates an XML file is not exist
+ using (XmlTextWriter writer = new XmlTextWriter(RBuildDBFile, Encoding.ASCII))
+ {
+ writer.Indentation = 4;
+ writer.Formatting = Formatting.Indented;
+
+ // Starts a new document
+ writer.WriteStartDocument();
+ writer.WriteComment("File autogenerated by SysGen");
+ writer.WriteStartElement("catalog");
+
+ writer.WriteStartElement("modules");
+ foreach (RBuildModule module in Project.Modules)
+ {
+ writer.WriteStartElement("module");
+ writer.WriteAttributeString("name", module.Name);
+ writer.WriteAttributeString("type", module.Type.ToString());
+ writer.WriteAttributeString("base", module.Base);
+ writer.WriteAttributeString("desc", module.Description);
+ writer.WriteAttributeString("path", module.CatalogPath);
+ writer.WriteAttributeString("enabled", module.Enabled.ToString());
+
+ writer.WriteStartElement("libraries");
+
+ foreach (RBuildModule library in module.Libraries)
+ writer.WriteElementString("library", library.Name);
+
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("dependencies");
+
+ foreach (RBuildModule dependency in module.Dependencies)
+ writer.WriteElementString("dependency", dependency.Name);
+
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("requeriments");
+
+ foreach (RBuildModule requirement in module.Requeriments)
+ writer.WriteElementString("requires", requirement.Name);
+
+ writer.WriteEndElement();
+
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("languages");
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ writer.WriteStartElement("language");
+ writer.WriteAttributeString("name", language.Name);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+
+ writer.WriteStartElement("debugchannels");
+ foreach (RBuildDebugChannel language in Project.DebugChannels)
+ {
+ writer.WriteStartElement("debugchannel");
+ writer.WriteAttributeString("name", language.Name);
+ writer.WriteEndElement();
+ }
+ writer.WriteEndElement();
+ writer.WriteEndElement();
+
+ writer.WriteEndDocument();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RGenStats/RGenStatBackend.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RGenStats/RGenStatBackend.cs
new file mode 100644
index 00000000000..113f0fd290c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/RGenStats/RGenStatBackend.cs
@@ -0,0 +1,110 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class RGenStatBackend : Backend
+ {
+ public RGenStatBackend(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "RGenStat Report"; }
+ }
+
+ protected override void Generate()
+ {
+ using (StreamWriter sw = new StreamWriter(Directory.GetCurrentDirectory() + "\\apistatus.lst"))
+ {
+ sw.WriteLine("; Format:");
+ sw.WriteLine("; COMPONENT_NAME PATH_TO_COMPONENT_SOURCES");
+ sw.WriteLine();
+ sw.WriteLine("; Where:");
+ sw.WriteLine("; COMPONENT_NAME - Name of the module. Eg. kernel32.");
+ sw.WriteLine("; PATH_TO_COMPONENT_SOURCES - Relative path to sources (relative to where rgenstat is run from).");
+ sw.WriteLine();
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Type == ModuleType.Kernel ||
+ module.Type == ModuleType.KernelModeDLL ||
+ module.Type == ModuleType.KernelModeDriver ||
+ module.Type == ModuleType.StaticLibrary ||
+ module.Type == ModuleType.ObjectLibrary ||
+ module.Type == ModuleType.Win32DLL ||
+ module.Type == ModuleType.Win32OCX ||
+ module.Type == ModuleType.KeyboardLayout)
+ {
+ sw.WriteLine("{0} {1}",
+ module.Name,
+ module.BaseURI.ToString().Replace("\\", "/"));
+ }
+ }
+ }
+
+ //using (StreamWriter sw = new StreamWriter(Directory.GetCurrentDirectory() + "\\descriptions.rbuild"))
+ //{
+ // sw.WriteLine("");
+ // sw.WriteLine("");
+ // sw.WriteLine("");
+ // sw.WriteLine("");
+
+ // foreach (RBuildModule module in Project.Modules)
+ // {
+ // if (module.Type == ModuleType.Kernel ||
+ // module.Type == ModuleType.KernelModeDLL ||
+ // module.Type == ModuleType.KernelModeDriver ||
+ // module.Type == ModuleType.BootLoader ||
+ // module.Type == ModuleType.BootProgram ||
+ // module.Type == ModuleType.BootSector ||
+ // module.Type == ModuleType.BuildTool ||
+ // module.Type == ModuleType.Cabinet ||
+ // module.Type == ModuleType.EmbeddedTypeLib ||
+ // module.Type == ModuleType.HostStaticLibrary ||
+ // module.Type == ModuleType.IdlHeader ||
+ // module.Type == ModuleType.NativeCUI ||
+ // module.Type == ModuleType.NativeDLL ||
+ // module.Type == ModuleType.ObjectLibrary ||
+ // module.Type == ModuleType.Package ||
+ // module.Type == ModuleType.RpcClient ||
+ // module.Type == ModuleType.RpcProxy ||
+ // module.Type == ModuleType.RpcServer ||
+ // module.Type == ModuleType.StaticLibrary ||
+ // module.Type == ModuleType.Win32CUI ||
+ // module.Type == ModuleType.Win32DLL ||
+ // module.Type == ModuleType.Win32GUI ||
+ // module.Type == ModuleType.Win32OCX ||
+ // module.Type == ModuleType.Win32SCR ||
+ // module.Type == ModuleType.KeyboardLayout)
+
+ // {
+ // sw.WriteLine("",
+ // module.Name.ToUpper(),
+ // module.Name);
+ // }
+ // }
+
+ // sw.WriteLine("");
+ //}
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Backends/WarningReport/WarningReport.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/WarningReport/WarningReport.cs
new file mode 100644
index 00000000000..5b48f103ae1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Backends/WarningReport/WarningReport.cs
@@ -0,0 +1,82 @@
+using System;
+using System.Web.UI;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+
+namespace SysGen.BuildEngine.Backends
+{
+ public class WarningReport : Backend
+ {
+ public WarningReport(SysGenEngine sysgen)
+ : base(sysgen)
+ {
+ }
+
+ protected override string FriendlyName
+ {
+ get { return "Warning report"; }
+ }
+
+ protected override void Generate()
+ {
+ //using (StreamWriter sw = new StreamWriter(@"C:\roswarning.txt"))
+ //{
+ // foreach (RBuildModule module in Project.Modules)
+ // {
+ // if (module.Unicode == false)
+ // {
+ // if ((module.Defines.ContainsKey("UNICODE")) ||
+ // (module.Defines.ContainsKey("_UNICODE")) ||
+ // (module.Defines.ContainsKey("_UNICODE_")))
+ // {
+ // sw.WriteLine("- Module '{0}' has unicode defines but 'Unicode' property set to 'False'", module.Name);
+ // }
+ // }
+
+ // foreach (KeyValuePair define in Project.Defines)
+ // {
+ // if (module.Defines.ContainsKey(define.Key))
+ // {
+ // sw.WriteLine("- Module '{0}' already define '{1}' inherited from project ", module.Name, define.Key);
+ // }
+ // }
+
+ // foreach (string flag in Project.CompilerFlags)
+ // {
+ // if (module.CompilerFlags.Contains(flag))
+ // {
+ // sw.WriteLine("- Module '{0}' already has compiler flag '{1}' inherited from project ", module.Name, flag);
+ // }
+ // }
+
+ // foreach (string flag in Project.LinkerFlags)
+ // {
+ // if (module.LinkerFlags.Contains(flag))
+ // {
+ // sw.WriteLine("- Module '{0}' already has linker flag '{1}' inherited from project ", module.Name, flag);
+ // }
+ // }
+
+ // foreach (RBuildFolder include in module.IncludeFolders)
+ // {
+ // if (Project.IncludeFolders.Contains(include))
+ // {
+ // sw.WriteLine("- Module '{0}' already has include folder '{1}' inherited from project ", module.Name, include.RelativePath);
+ // }
+
+ // if (SysGen.RBuildFolderExists(include) == false)
+ // {
+ // sw.WriteLine("- Module '{0}' includes folder '{1}' which could not be found ", module.Name, include.RelativePath);
+ // }
+ // }
+ // }
+ //}
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/BackendCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/BackendCollection.cs
new file mode 100644
index 00000000000..c2df8997b68
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/BackendCollection.cs
@@ -0,0 +1,22 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Backends;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class BackendCollection : List
+ {
+ public void Generate()
+ {
+ foreach (Backend backend in this)
+ {
+ backend.Run();
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/DefineCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/DefineCollection.cs
new file mode 100644
index 00000000000..e05ada2c171
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/DefineCollection.cs
@@ -0,0 +1,23 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public class DefineCollection : Dictionary
+ {
+ public void Add(string name)
+ {
+ Add(name, string.Empty);
+ }
+
+ public void Add(string name , string value)
+ {
+ if (!ContainsKey(name))
+ base.Add(name, value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/FileHandlerCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/FileHandlerCollection.cs
new file mode 100644
index 00000000000..ec7b65a5c86
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/FileHandlerCollection.cs
@@ -0,0 +1,24 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Log;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class FileHandlerCollection : List
+ {
+ public void ProcessFiles(RBuildPlatformFileCollection files)
+ {
+ foreach (RBuildFile file in files)
+ {
+ foreach (IFileHandler handler in this)
+ {
+ handler.Process(file);
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/LogListenerCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/LogListenerCollection.cs
new file mode 100644
index 00000000000..7d907c3fe93
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/LogListenerCollection.cs
@@ -0,0 +1,14 @@
+using System;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Log;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class LogListenerCollection : List
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskBuilderCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskBuilderCollection.cs
new file mode 100644
index 00000000000..386c0b04c24
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskBuilderCollection.cs
@@ -0,0 +1,33 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace SysGen.BuildEngine
+{
+ public class TaskBuilderCollection : List
+ {
+ public bool Add(TaskBuilder builder)
+ {
+ // prevent adding duplicate builders with the same task name
+ if (FindBuilderForTask(builder.TaskName) == null)
+ {
+ base.Add(builder);
+ return true;
+ }
+
+ return false;
+ }
+
+ public TaskBuilder FindBuilderForTask(string taskName)
+ {
+ foreach (TaskBuilder builder in this)
+ {
+ if (builder.TaskName == taskName)
+ {
+ return builder;
+ }
+ }
+ return null;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskCollection.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskCollection.cs
new file mode 100644
index 00000000000..a10cf92f4f1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Collections/TaskCollection.cs
@@ -0,0 +1,10 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace SysGen.BuildEngine
+{
+ public sealed class TaskCollection : List
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Elements/Base/Element.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Elements/Base/Element.cs
new file mode 100644
index 00000000000..3de1765b291
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Elements/Base/Element.cs
@@ -0,0 +1,306 @@
+using System;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine
+{
+ /// Models a NAnt XML element in the build file.
+ ///
+ /// Automatically validates attributes in the element based on Attribute settings in the derived class.
+ ///
+ public class Element : IElement
+ {
+ protected Location _location = Location.UnknownLocation;
+ protected SysGenEngine _sysgen = null;
+ protected RBuildProject _project = null;
+ protected XmlNode _xmlNode = null;
+ protected IElement _parent = null;
+ protected bool m_FailOnMissingRequired = true;
+
+ ///
+ /// The default contstructor.
+ ///
+ public Element()
+ {
+ }
+
+ /// A copy contstructor.
+ protected Element(Element element) : this()
+ {
+ _location = element._location;
+ _sysgen = element._sysgen;
+ _xmlNode = element._xmlNode;
+ }
+
+ /// in the build file where the element is defined.
+ protected virtual Location Location {
+ get { return _location; }
+ set { _location = value; }
+ }
+
+ ///
+ /// The Parent object. This will be your parent Task, Target, or Project depeding on where the element is defined.
+ ///
+ public IElement Parent { get { return _parent; } set { _parent = value; } }
+
+ /// Name of the XML element used to initialize this element.
+ public virtual string Name
+ {
+ get {
+ ElementNameAttribute elementNameAttribute = (ElementNameAttribute)
+ Attribute.GetCustomAttribute(GetType(), typeof(ElementNameAttribute));
+
+ string name = null;
+ if (elementNameAttribute != null) {
+ name = elementNameAttribute.Name;
+ }
+ return name;
+ }
+ }
+
+ ///
+ /// The this element belongs to.
+ ///
+ public virtual SysGenEngine SysGen
+ {
+ get { return _sysgen; }
+ set { _sysgen = value; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return _project; }
+ set { _project = value; }
+ }
+
+ public RBuildModule Module
+ {
+ get
+ {
+ RBuildModule module = RBuildElement as RBuildModule;
+
+ if (module == null)
+ throw new BuildException(String.Format("Task <{0} ... \\> is not child of any ModuleTask." , Name), Location);
+
+ return module;
+ }
+ }
+
+ ///
+ /// this element belongs to.
+ ///
+ public virtual RBuildElement RBuildElement
+ {
+ get
+ {
+ IElement element = this;
+ while (element != null)
+ {
+ if (element is ISysGenObject)
+ return ((ISysGenObject)element).RBuildElement;
+
+ //Set to his parent
+ element = element.Parent;
+ }
+
+ return SysGen.Project;
+ }
+ }
+
+ public string BaseBuildLocation
+ {
+ get { return Path.GetDirectoryName(new Uri(_xmlNode.BaseURI).LocalPath); }
+ }
+
+ public XmlNode XmlNode
+ {
+ get { return _xmlNode; }
+ }
+
+ ///
+ /// Initializes all build attributes.
+ ///
+ private void InitializeProperties(XmlNode elementNode)
+ {
+ // Get the current element Type
+ Type currentType = GetType();
+
+ PropertyInfo[] propertyInfoArray = currentType.GetProperties(BindingFlags.Public|BindingFlags.Instance);
+ foreach (PropertyInfo propertyInfo in propertyInfoArray )
+ {
+ // process all TaskPropertyAttribute attributes
+ TaskPropertyAttribute[] propertyAttributes = (TaskPropertyAttribute[])
+ Attribute.GetCustomAttributes(propertyInfo, typeof(TaskPropertyAttribute) , false);
+
+ foreach(TaskPropertyAttribute propertyAttribute in propertyAttributes)
+ {
+ string propertyValue = null;
+
+ if (propertyAttribute.Location == TaskPropertyLocation.Attribute)
+ {
+ if (elementNode.Attributes[propertyAttribute.Name] != null)
+ {
+ propertyValue = elementNode.Attributes[propertyAttribute.Name].Value;
+ }
+ }
+ else if (propertyAttribute.Location == TaskPropertyLocation.Node)
+ {
+ propertyValue = elementNode.InnerText;
+ }
+
+ // check if its required
+ if (propertyValue == null && propertyAttribute.Required && m_FailOnMissingRequired)
+ {
+ throw new BuildException(String.Format("'{0}' is a required '{1}' of <{2} ... \\>.", propertyAttribute.Name, propertyAttribute.Location , Name), Location);
+ }
+
+ if (propertyValue != null)
+ {
+ //string attrValue = attributeNode.Value;
+ if (propertyAttribute.ExpandProperties)
+ {
+ // expand attribute properites
+ propertyValue = SysGen.ExpandProperties(propertyValue);
+ }
+
+ if (propertyInfo.CanWrite)
+ {
+ // set the property value instead
+ MethodInfo info = propertyInfo.GetSetMethod();
+ object[] paramaters = new object[1];
+
+ Type propertyType = propertyInfo.PropertyType;
+
+ // If the object is an emum
+ if (propertyType.IsSubclassOf(typeof(System.Enum)))
+ {
+ try
+ {
+ paramaters[0] = Enum.Parse(propertyType, propertyValue, true);
+ }
+ catch (Exception)
+ {
+ // catch type conversion exceptions here
+ string message = string.Format("Invalid value '{0}'. Valid values for this attribute are:\n", propertyValue);
+ foreach (object value in Enum.GetValues(propertyType))
+ {
+ message += string.Format("\t{0}\n", value.ToString());
+ }
+ throw new BuildException(message, Location);
+ }
+ }
+ else
+ {
+ //validate attribute value with custom ValidatorAttribute(ors)
+ ValidatorAttribute[] validateAttributes = (ValidatorAttribute[])
+ Attribute.GetCustomAttributes(propertyInfo, typeof(ValidatorAttribute));
+ try
+ {
+ foreach (ValidatorAttribute validator in validateAttributes)
+ validator.Validate(propertyValue);
+ }
+ catch (ValidationException ve)
+ {
+ throw new ValidationException(ve.Message, Location);
+ }
+
+ if (propertyType == typeof(System.Boolean))
+ {
+ paramaters[0] = Convert.ChangeType(SysGenConversion.ToBolean(propertyValue), propertyInfo.PropertyType);
+ }
+ else
+ {
+ paramaters[0] = Convert.ChangeType(propertyValue, propertyInfo.PropertyType);
+ }
+ }
+
+ info.Invoke(this, paramaters);
+ }
+ else
+ {
+ new BuildException(string.Format("Property '{0}' was found but '{1}' does no implement Set", propertyAttribute.Name, Name));
+ }
+ }
+ }
+
+ // now do nested BuildElements
+ BuildElementAttribute buildElementAttribute = (BuildElementAttribute)
+ Attribute.GetCustomAttribute(propertyInfo, typeof(BuildElementAttribute));
+
+ if (buildElementAttribute != null)
+ {
+ // get value from xml node
+ XmlNode nestedElementNode = elementNode[buildElementAttribute.Name, elementNode.OwnerDocument.DocumentElement.NamespaceURI];
+ // check if its required
+ if (nestedElementNode == null && buildElementAttribute.Required) {
+ throw new BuildException(String.Format("'{0}' is a required element of <{1} ...//>.", buildElementAttribute.Name, this.Name), Location);
+ }
+ if (nestedElementNode != null) {
+ Element childElement = (Element)propertyInfo.GetValue(this, null);
+ // Sanity check: Ensure property wasn't null.
+ if ( childElement == null )
+ throw new BuildException(String.Format("Property '{0}' value cannot be null for <{1} ...//>", propertyInfo.Name, this.Name), Location);
+ childElement.SysGen = SysGen;
+ childElement.Initialize(nestedElementNode);
+ }
+ }
+ }
+ }
+
+ /// Performs default initialization.
+ ///
+ /// Derived classes that wish to add custom initialization should override .
+ ///
+ public void Initialize(XmlNode elementNode)
+ {
+ if (SysGen == null)
+ throw new InvalidOperationException("Element has invalid BuildFileLoader property.");
+
+ // Save the element node
+ _xmlNode = elementNode;
+
+ // Save position in buildfile for reporting useful error messages.
+ try
+ {
+ _location = SysGen.LocationMap.GetLocation(elementNode);
+ }
+ catch(ArgumentException ae)
+ {
+ BuildLog.WriteLineIf(SysGen.Verbose, ae.ToString());
+ }
+
+ InitializeProperties(elementNode);
+
+ OnInit();
+
+ // Allow inherited classes a chance to do some custom initialization.
+ InitializeElement(elementNode);
+
+ // The Element has been completly initialized
+ OnLoad();
+ }
+
+ ///
+ /// Allows derived classes to provide extra initialization and validation not covered by the base class.
+ ///
+ /// The xml node of the element to use for initialization.
+ protected virtual void InitializeElement(XmlNode elementNode)
+ {
+ }
+
+ protected virtual void OnLoad()
+ {
+ }
+
+ protected virtual void OnInit()
+ {
+ }
+
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/BuildException.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/BuildException.cs
new file mode 100644
index 00000000000..b8b422221be
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/BuildException.cs
@@ -0,0 +1,101 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Thrown whenever an error occurs during the build.
+ ///
+ [Serializable]
+ public class BuildException : ApplicationException
+ {
+ private Location _location = Location.UnknownLocation;
+
+ ///
+ /// Constructs a build exception with no descriptive information.
+ ///
+ public BuildException() : base() {
+ }
+
+ public BuildException(String message, params object[] args)
+ : base(string.Format(message, args))
+ {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message.
+ ///
+ public BuildException(String message) : base(message) {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message and an
+ /// instance of the Exception that is the cause of the current Exception.
+ ///
+ public BuildException(Exception e, String message) : base(message, e) {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message and an
+ /// instance of the Exception that is the cause of the current Exception.
+ ///
+ public BuildException(Exception e, String message,params object[] args)
+ : base(string.Format(message , args), e)
+ {
+ }
+
+ ///
+ /// Constructs an exception with a descriptive message and location
+ /// in the build file that caused the exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ public BuildException(String message, Location location) : base(message) {
+ _location = location;
+ }
+
+ ///
+ /// Constructs an exception with the given descriptive message, the
+ /// location in the build file and an instance of the Exception that
+ /// is the cause of the current Exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ /// An instance of Exception that is the cause of the current Exception.
+ public BuildException(String message, Location location, Exception e) : base(message, e) {
+ _location = location;
+ }
+
+ /// Initializes a new instance of the BuildException class with serialized data.
+ public BuildException(SerializationInfo info, StreamingContext context) : base(info, context) {
+ /*
+ string fileName = info.GetString("Location.FileName");
+ int lineNumber = info.GetInt32("Location.LineNumber");
+ int columnNumber = info.GetInt32("Location.ColumnNumber");
+ */
+ _location = info.GetValue("Location", _location.GetType()) as Location;
+ }
+
+ /// Sets the SerializationInfo object with information about the exception.
+ /// The object that holds the serialized object data.
+ /// The contextual information about the source or destination.
+ /// For more information, see SerializationInfo in the Microsoft documentation.
+ public override void GetObjectData(SerializationInfo info, StreamingContext context) {
+ base.GetObjectData(info, context);
+ info.AddValue("Location", _location);
+ }
+
+ public override string Message {
+ get {
+ string message = base.Message;
+
+ // only include location string if not empty
+ string locationString = _location.ToString();
+ if (locationString != String.Empty) {
+ message = locationString + "\n " + message;
+ }
+ return message;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/ValidationException.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/ValidationException.cs
new file mode 100644
index 00000000000..0150c5c79f0
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Exceptions/ValidationException.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Runtime.Serialization;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// This exception indicates that an error has occured while performing a validate operation.
+ /// The ValidationEventHandler can cause this exception to be thrown during the validate operations
+ ///
+ [Serializable]
+ public class ValidationException : BuildException
+ {
+ ///
+ /// Constructs a build exception with no descriptive information.
+ ///
+ public ValidationException() : base() {}
+
+ ///
+ /// Constructs an exception with a descriptive message.
+ ///
+ public ValidationException(String message) : base(message) {}
+
+ ///
+ /// Constructs an exception with a descriptive message and an
+ /// instance of the Exception that is the cause of the current Exception.
+ ///
+ public ValidationException(String message, Exception e) : base(e, message) {}
+
+ ///
+ /// Constructs an exception with a descriptive message and location
+ /// in the build file that caused the exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ public ValidationException(String message, Location location) : base(message, location) {}
+
+ ///
+ /// Constructs an exception with the given descriptive message, the
+ /// location in the build file and an instance of the Exception that
+ /// is the cause of the current Exception.
+ ///
+ /// The error message that explains the reason for the exception.
+ /// Location in the build file where the exception occured.
+ /// An instance of Exception that is the cause of the current Exception.
+ public ValidationException(String message, Location location, Exception e) : base(message, location, e) {}
+
+ /// Initializes a new instance of the ValidationException class with serialized data.
+ public ValidationException(SerializationInfo info, StreamingContext context) : base(info, context) {}
+
+ /// Sets the SerializationInfo object with information about the exception.
+ /// The object that holds the serialized object data.
+ /// The contextual information about the source or destination.
+ /// For more information, see SerializationInfo in the Microsoft documentation.
+ public override void GetObjectData(SerializationInfo info, StreamingContext context) {}
+
+ public override string Message {
+ get {
+ return base.Message;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedCFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedCFileWriter.cs
new file mode 100644
index 00000000000..9f37bd4c0e5
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedCFileWriter.cs
@@ -0,0 +1,30 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class AutoGeneratedCFileWriter : AutoGeneratedFileWriter
+ {
+ public AutoGeneratedCFileWriter(RBuildModule module, string file)
+ : base(module , file)
+ {
+ }
+
+ protected virtual void WriteHeader()
+ {
+ WriteLine("/* This file is automatically generated. */");
+ WriteLine();
+ }
+
+ protected virtual void WriteFooter()
+ {
+ WriteLine("/* EOF */");
+ WriteLine();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedFileWriter.cs
new file mode 100644
index 00000000000..02a03e04fe3
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedFileWriter.cs
@@ -0,0 +1,39 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class AutoGeneratedFileWriter : StreamWriter
+ {
+ RBuildProject m_Project = null;
+ RBuildModule m_Module = null;
+
+ public AutoGeneratedFileWriter(RBuildProject project, string file)
+ : base(file)
+ {
+ m_Project = project;
+ }
+
+ public AutoGeneratedFileWriter(RBuildModule module, string file)
+ : base(file)
+ {
+ m_Module = module;
+ }
+
+ protected RBuildProject Project
+ {
+ get { return m_Project; }
+ }
+
+ protected RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public abstract void WriteFile();
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedInfFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedInfFileWriter.cs
new file mode 100644
index 00000000000..93135c8771b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/Base/AutoGeneratedInfFileWriter.cs
@@ -0,0 +1,54 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class AutoGeneratedInfFileWriter : AutoGeneratedFileWriter
+ {
+ public AutoGeneratedInfFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ protected virtual void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$Windows NT$\"");
+ WriteLine("ClassGUID = {00000000-0000-0000-0000-000000000000}");
+ WriteLine();
+ }
+
+ protected void WriteSection(string sectionName)
+ {
+ WriteLine("[{0}]", sectionName);
+ }
+
+ protected void WriteComment (string comment)
+ {
+ WriteLine("; {0}", comment);
+ }
+
+ protected void WriteAssignment(string name , string value)
+ {
+ WriteLine("{0} = {1}",
+ name ,
+ value);
+ }
+
+ protected void WriteBooleanAssignment(string name, bool value)
+ {
+ if (value)
+ {
+ WriteAssignment(name, "yes");
+ }
+ else
+ {
+ WriteAssignment(name, "no");
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/BuildNumberFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/BuildNumberFileWriter.cs
new file mode 100644
index 00000000000..330c9162ded
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/BuildNumberFileWriter.cs
@@ -0,0 +1,45 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.Framework;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.Framework
+{
+ public class BuildNumberFileWriter : AutoGeneratedCFileWriter
+ {
+ public BuildNumberFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteCompilationUnit();
+ WriteFooter();
+ }
+
+ private void WriteBuildNumber()
+ {
+ WriteLine("#ifndef _INC_REACTOS_BUILDNO");
+ WriteLine("#define _INC_REACTOS_BUILDNO");
+ WriteLine("#define KERNEL_VERSION_BUILD 20080427");
+ WriteLine("#define KERNEL_VERSION_BUILD_HEX 0x8187");
+ WriteLine("#define KERNEL_VERSION_BUILD_STR \"20080427-r33159\"");
+ WriteLine("#define KERNEL_VERSION_BUILD_RC \"20080427-r33159\0\"");
+ WriteLine("#define KERNEL_RELEASE_RC \"0.4-SVN\0\"");
+ WriteLine("#define KERNEL_RELEASE_STR \"0.4-SVN\"");
+ WriteLine("#define KERNEL_VERSION_RC \"0.4-SVN\0\"");
+ WriteLine("#define KERNEL_VERSION_STR \"0.4-SVN\"");
+ WriteLine("#define REACTOS_DLL_VERSION_MAJOR 42");
+ WriteLine("#define REACTOS_DLL_RELEASE_RC \"42.4-SVN\0\"");
+ WriteLine("#define REACTOS_DLL_RELEASE_STR \"42.4-SVN\"");
+ WriteLine("#define REACTOS_DLL_VERSION_RC \"42.4-SVN\0\"");
+ WriteLine("#define REACTOS_DLL_VERSION_STR \"42.4-SVN\"");
+ WriteLine("#endif");
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/CompilationUnitFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/CompilationUnitFileWriter.cs
new file mode 100644
index 00000000000..e0dd0063b8c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/CompilationUnitFileWriter.cs
@@ -0,0 +1,42 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class CompilationUnitFileWriter : AutoGeneratedCFileWriter
+ {
+ private RBuildCompilationUnitFile m_CompilationUnit = null;
+
+ public CompilationUnitFileWriter(RBuildModule module, RBuildCompilationUnitFile unit , string file)
+ : base(module , file)
+ {
+ m_CompilationUnit = unit;
+ }
+
+ protected override void WriteHeader()
+ {
+ base.WriteHeader();
+
+ WriteLine("#define ONE_COMPILATION_UNIT");
+ WriteLine();
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteCompilationUnit();
+ }
+
+ private void WriteCompilationUnit()
+ {
+ foreach (RBuildSourceFile file in m_CompilationUnit.SourceFiles)
+ {
+ WriteLine("#include <{0}>", file.FullPath);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DefinitionFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DefinitionFileWriter.cs
new file mode 100644
index 00000000000..d0d11a5073b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DefinitionFileWriter.cs
@@ -0,0 +1,21 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class DefinitionFileWriter : AutoGeneratedFileWriter
+ {
+ public DefinitionFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DffFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DffFileWriter.cs
new file mode 100644
index 00000000000..ce146aca3bf
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/DffFileWriter.cs
@@ -0,0 +1,139 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class DffFileWriter : AutoGeneratedFileWriter
+ {
+ public DffFileWriter(RBuildProject project , string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteModuleTargets();
+ }
+
+ protected void WriteHeader()
+ {
+ WriteLine("; Main ReactOS package");
+ WriteLine();
+ WriteLine(".Set DiskLabelTemplate=\"ReactOS\" ; Label of disk");
+ WriteLine(".Set CabinetNameTemplate=\"reactos.cab\" ; reactos.cab");
+ WriteLine(".Set InfFileName=\"reactos.inf\" ; reactos.inf");
+ WriteLine();
+ WriteLine(";.Set Cabinet=on");
+ WriteLine(";.Set Compress=on");
+ WriteLine();
+ WriteLine(".InfBegin");
+ WriteLine("[Version]");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ WriteLine("[Directories]");
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ if (folder.Name == string.Empty ||
+ folder.Name == ".")
+ {
+ WriteLine("{0} =",
+ folder.ID);
+ }
+ else
+ WriteLine("{0} = {1}",
+ folder.ID,
+ folder.Name);
+ }
+
+ WriteLine(".InfEnd");
+ WriteLine();
+ WriteLine("; Contents of disk");
+ WriteLine(".InfBegin");
+ WriteLine("[SourceFiles]");
+ WriteLine(".InfEnd");
+ }
+
+ protected void WriteModuleTargets()
+ {
+ RBuildInstallFolder installFolder = null;
+
+ WriteLine();
+ WriteLine(";Module targets");
+ WriteLine();
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Enabled)
+ {
+ if ((module.IsInstallable) && (module.HasInstallBase))
+ {
+ if ((!module.IsBootstrap || module.IsSpecialIncludedBootStrap) && !module.IsSpecialExcludedBootStrap)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(module.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for module '{1}' references a non existant install folder",
+ module.InstallBase,
+ module.Name);
+
+ WriteLine("{0,-90}\t{1,10}",
+ module.TargetFile.FullPath,
+ installFolder.ID);
+ }
+ }
+
+ foreach (RBuildOutputFile file in module.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(file.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for file '{1}' references a non existant install folder",
+ platformFile.InstallBase,
+ platformFile.FullPath);
+
+ WriteLine("{0,-90}\t{1,10}",
+ platformFile.FullPath,
+ installFolder.ID);
+ }
+ }
+ }
+ }
+
+ WriteLine();
+ WriteLine(";Install files");
+ WriteLine();
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ RBuildPlatformFile platformFile = file as RBuildPlatformFile;
+
+ if (platformFile != null)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(file.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for file '{1}' references a non existant install folder",
+ platformFile.InstallBase,
+ platformFile.FullPath);
+
+ WriteLine("{0,-90}\t{1,10}",
+ platformFile.FullPath,
+ installFolder.ID);
+ }
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderCreditsFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderCreditsFileWriter.cs
new file mode 100644
index 00000000000..aa453d2ec5f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderCreditsFileWriter.cs
@@ -0,0 +1,36 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class HeaderCreditsFileWriter : AutoGeneratedFileWriter
+ {
+ public HeaderCreditsFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteLine("/* This file is autogenerated */");
+ WriteLine();
+ WriteLine("const char* szAutoContributors[]=");
+ WriteLine("{");
+
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ WriteLine("\t\t{0},", contributor.FullName);
+ }
+
+ WriteLine("\t0");
+ WriteLine("};");
+
+ // Adds a blank line
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderRosCfgFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderRosCfgFileWriter.cs
new file mode 100644
index 00000000000..5f9a2693b60
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/HeaderRosCfgFileWriter.cs
@@ -0,0 +1,26 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class HeaderRosCfgFileWriter : AutoGeneratedFileWriter
+ {
+ public HeaderRosCfgFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteLine("/* This file is autogenerated */");
+ WriteLine();
+
+ // Adds a blank line
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupComponentSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupComponentSetupFileWriter.cs
new file mode 100644
index 00000000000..f3eaa983bdb
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupComponentSetupFileWriter.cs
@@ -0,0 +1,84 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public abstract class SysSetupComponentSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public SysSetupComponentSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ protected virtual void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$Windows NT$\"");
+ WriteLine();
+ }
+
+ protected virtual void WriteaAddRegDirective()
+ {
+ WriteSection("DefaultInstall");
+ WriteLine("AddReg=Install.Reg");
+ WriteLine();
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteaAddRegDirective();
+ WriteContent();
+ }
+
+ protected abstract void WriteContent();
+ }
+
+ public class DesktopComponentSetupFileWriter : SysSetupComponentSetupFileWriter
+ {
+ public DesktopComponentSetupFileWriter(RBuildProject project, string file)
+ : base(project, file)
+ {
+ }
+
+ protected override void WriteContent()
+ {
+ WriteLine("[Install.Reg]");
+
+ if (Project.Platform.Screensaver != null)
+ {
+ WriteLine("HKU,\"Control Panel\\Desktop\",\"1SCRNSAVE.EXE\",0x00000000,\"{0}\"",
+ Project.Platform.Screensaver.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.Wallpaper != null)
+ {
+ WriteLine("HKU,\"Control Panel\\Desktop\",\"1Wallpaper\",0x00000000,\"{0}\"",
+ Project.Platform.Wallpaper.PlatformInstall.FullPath);
+ }
+ }
+ }
+
+ public class ShellComponentSetupFileWriter : SysSetupComponentSetupFileWriter
+ {
+ public ShellComponentSetupFileWriter(RBuildProject project, string file)
+ : base(project, file)
+ {
+ }
+
+ protected override void WriteContent()
+ {
+ WriteLine("[Install.Reg]");
+
+ if (Project.Platform.Shell != null)
+ {
+ WriteLine("HKLM,\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\\",\"Shell\",0x00020000,\"{0}\"",
+ Project.Platform.Shell.PlatformInstall.FullPath);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupFileWriter.cs
new file mode 100644
index 00000000000..e18646da744
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/SysSetupFileWriter.cs
@@ -0,0 +1,92 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class SysSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public SysSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteInfDevicesSection();
+ WriteInfRegistrationPhase2Section();
+ WriteInfOleControlDllsSection();
+ WriteInfAlwaysSection();
+ }
+
+ protected void WriteInfDevicesSection()
+ {
+ WriteLine("[DeviceInfsToInstall]");
+ WriteLine("cdrom.inf");
+ WriteLine("display.inf");
+ WriteLine("hdc.inf");
+ WriteLine("keyboard.inf");
+ WriteLine("machine.inf");
+ WriteLine("msmouse.inf");
+ WriteLine("NET_NIC.inf");
+ WriteLine("ports.inf");
+ WriteLine("scsi.inf");
+ WriteLine("usbport.inf");
+ WriteLine();
+ }
+
+ protected void WriteInfRegistrationPhase2Section()
+ {
+ WriteLine("[RegistrationPhase2]");
+ WriteLine("RegisterDlls=OleControlDlls");
+ WriteLine();
+ }
+
+ protected void WriteInfOleControlDllsSection()
+ {
+ WriteLine("[OleControlDlls]");
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.AutoRegister != null)
+ {
+ WriteLine("{0},,{1},{2}",
+ "11",
+ module.TargetName,
+ module.AutoRegister.RegistrationType);
+ }
+ }
+ WriteLine();
+ }
+
+ protected void WriteInfAlwaysSection()
+ {
+ WriteLine("[Infs.Always]");
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Setup != null)
+ {
+ WriteLine("{0},{1}",
+ module.Setup.Name,
+ module.Setup.InstallSection);
+ }
+ }
+
+ foreach (RBuildOutputFile file in Project.Files)
+ {
+ RBuildSetupFile setup = file as RBuildSetupFile;
+
+ if (setup != null)
+ {
+ WriteLine("{0},{1}",
+ setup.Name,
+ setup.InstallSection);
+ }
+ }
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtCreditsFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtCreditsFileWriter.cs
new file mode 100644
index 00000000000..280bdba0074
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtCreditsFileWriter.cs
@@ -0,0 +1,52 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class TxtCreditsFileWriter : AutoGeneratedFileWriter
+ {
+ public TxtCreditsFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteLine("ReactOS is available thanks to the work of:");
+ WriteLine();
+
+ foreach (RBuildContributor contributor in Project.Contributors)
+ {
+ if (contributor.HasAlias)
+ {
+ WriteLine("\t{0} ({1})",
+ contributor.FullName,
+ contributor.Alias);
+ }
+ else
+ {
+ WriteLine("\t{0}", contributor.FullName);
+ }
+
+ if (contributor.HasMail)
+ {
+ WriteLine("\t\t{0}", contributor.Mail);
+ }
+
+ if (contributor.HasLocation)
+ {
+ WriteLine("\t\t{0}, {1}",
+ contributor.City ,
+ contributor.Country);
+ }
+
+ // Adds a blank line
+ WriteLine();
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupFileWriter.cs
new file mode 100644
index 00000000000..f1f55d52d56
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupFileWriter.cs
@@ -0,0 +1,137 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class TxtSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public TxtSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteDirectories();
+ WriteSourceDiskDiles();
+ WriteLanguages();
+ WriteKeyboardLayouts();
+ WriteKeyboardLayoutFiles();
+ WriteRegistryInstall();
+ }
+
+ protected override void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ }
+
+ public void WriteDirectories()
+ {
+ WriteLine("[Directories]");
+ WriteLine("; = ");
+
+ foreach (RBuildInstallFolder folder in Project.InstallFolders)
+ {
+ WriteLine("{0} = {1}",
+ folder.ID,
+ folder.Name);
+ }
+ }
+
+ public void WriteSourceDiskDiles()
+ {
+ RBuildInstallFolder installFolder = null;
+
+ WriteLine("[SourceDisksFiles]");
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ if (module.Bootstrap != null)
+ {
+ if (module.Type == ModuleType.KernelModeDriver ||
+ module.Type == ModuleType.KernelModeDLL)
+ {
+ //Get the install folder
+ installFolder = Project.InstallFolders.GetByName(module.InstallBase);
+
+ if (installFolder == null)
+ throw new BuildException("InstallBase '{0}' for module '{1}' references a non existant install folder",
+ module.InstallBase,
+ module.Name);
+
+ WriteLine("{0,-50}\t{1,50}",
+ module.TargetFile.FullPath,
+ installFolder.ID);
+ }
+ }
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteLanguages()
+ {
+ WriteSection("Languages");
+
+ foreach (RBuildLanguage language in Project.Platform.Languages)
+ {
+ WriteLine("{0} = \"{1}\"",
+ language.LCID,
+ language.Name);
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteKeyboardLayouts()
+ {
+ WriteSection("KeyboardLayout");
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ WriteLine("{0} = \"{1}\"",
+ module.LCID ,
+ module.Description);
+ }
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteKeyboardLayoutFiles()
+ {
+ WriteSection("Files.KeyboardLayout");
+
+ foreach (RBuildModule module in Project.Platform.Modules)
+ {
+ if (module.Type == ModuleType.KeyboardLayout)
+ {
+ WriteLine("{0} = {1}",
+ module.LCID,
+ module.TargetName);
+ }
+ }
+
+ WriteLine();
+ }
+
+ protected void WriteRegistryInstall()
+ {
+ WriteLine("[HiveInfs.Install]");
+ WriteLine("AddReg=hivecls.inf,AddReg");
+ WriteLine("AddReg=hivedef.inf,AddReg");
+ WriteLine("AddReg=hivesft.inf,AddReg");
+ WriteLine("AddReg=hivesys.inf,AddReg");
+ WriteLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupHiveFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupHiveFileWriter.cs
new file mode 100644
index 00000000000..2a510834d9f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/TxtSetupHiveFileWriter.cs
@@ -0,0 +1,59 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class TxtSetupHiveFileWriter : AutoGeneratedInfFileWriter
+ {
+ public TxtSetupHiveFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteDirectories();
+ }
+
+ protected override void WriteHeader()
+ {
+ WriteSection("Version");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ }
+
+ public void WriteDirectories()
+ {
+ WriteLine("[AddReg]");
+
+ if (Project.Platform.Shell != null)
+ {
+ WriteLine("HKLM,\"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon\\\",\"Shell\",0x00020000,\"{0}\"",
+ Project.Platform.Shell.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.Screensaver != null)
+ {
+ WriteLine("HKCU,\"Control Panel\\Desktop\",\"SCRNSAVE.EXE\",0x00000000,\"{0}\"",
+ Project.Platform.Screensaver.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.Wallpaper != null)
+ {
+ WriteLine("HKCU,\"Control Panel\\Desktop\",\"Wallpaper\",0x00000000,\"{0}\"",
+ Project.Platform.Wallpaper.PlatformInstall.FullPath);
+ }
+
+ if (Project.Platform.DebugChannels.Count > 0)
+ {
+ WriteLine("HKCU,\"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment\",\"DEBUGCHANNEL\",0x00020000,\"{0}\"",
+ Project.Platform.DebugChannels.Text);
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/UnAttendSetupFileWriter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/UnAttendSetupFileWriter.cs
new file mode 100644
index 00000000000..7f6ae75f7e4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/FileWriters/UnAttendSetupFileWriter.cs
@@ -0,0 +1,46 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Framework
+{
+ public class UnAttendSetupFileWriter : AutoGeneratedInfFileWriter
+ {
+ public UnAttendSetupFileWriter(RBuildProject project, string file)
+ : base(project , file)
+ {
+ }
+
+ public override void WriteFile()
+ {
+ WriteHeader();
+ WriteUnAttendFile();
+ }
+
+ protected override void WriteHeader()
+ {
+ WriteSection("Unattend");
+ WriteLine("Signature = \"$ReactOS$\"");
+ WriteLine();
+ }
+
+ protected void WriteUnAttendFile()
+ {
+ WriteBooleanAssignment("UnattendSetupEnabled", false);
+ WriteAssignment("DestinationDiskNumber", "0");
+ WriteAssignment("DestinationPartitionNumber", "1");
+ WriteAssignment("MBRInstallType", "2");
+ WriteAssignment("FullName", "MyName");
+ WriteAssignment("OrgName", "MyOrg");
+ WriteAssignment("ComputerName", "MyComputer");
+ WriteAssignment("AdminPassword", "MyPassword");
+ WriteAssignment("TimeZoneIndex", "85");
+ WriteAssignment("FormatPartition", "1");
+ WriteAssignment("AutoPartition", "1");
+ WriteAssignment("DisableVmwInst", "1");
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Handlers/SysSetupFileHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Handlers/SysSetupFileHandler.cs
new file mode 100644
index 00000000000..0ae911e0fc6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Handlers/SysSetupFileHandler.cs
@@ -0,0 +1,138 @@
+using System;
+using System.IO;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Handlers
+{
+ public abstract class AutoGeneratedFileHandler : IFileHandler
+ {
+ protected SysGenEngine m_SysGenEngine = null;
+ protected RBuildFile m_OriginalFile = null;
+ protected RBuildFile m_DestFile = null;
+
+ public AutoGeneratedFileHandler(SysGenEngine engine)
+ {
+ m_SysGenEngine = engine;
+ }
+
+ public void Process(RBuildFile file)
+ {
+ m_OriginalFile = file;
+
+ if (file.Name == FileName)
+ {
+ // Set the generated file to the temporary path
+ m_DestFile = new RBuildFile();
+ m_DestFile.Root = PathRoot.Intermediate;
+ m_DestFile.Base = file.Base;
+ m_DestFile.Name = file.Name;
+
+ // Auto generate this file
+ AutoGenerate();
+
+ file = m_DestFile;
+ }
+ }
+
+ protected abstract void AutoGenerate();
+
+ protected abstract string FileName { get; }
+ }
+
+ public class HiveAutoGeneratedFileHandler : AutoGeneratedFileHandler
+ {
+ public HiveAutoGeneratedFileHandler(SysGenEngine engine)
+ : base(engine)
+ {
+ }
+
+ protected override string FileName
+ {
+ get { return "hivedef.inf"; }
+ }
+
+ protected override void AutoGenerate()
+ {
+ File.Copy(
+ m_SysGenEngine.ResolveRBuildFilePath(m_OriginalFile),
+ m_SysGenEngine.ResolveRBuildFilePath(m_DestFile));
+
+ File.WriteAllText (m_SysGenEngine.ResolveRBuildFilePath(m_DestFile) ,
+ "; Set default wallpaper\n" +
+ "HKCU,\"Control Panel\\Desktop\",\"Wallpaper\",0000000000,\"%SystemRoot%\\Green.bmp\"" +
+ "HKCU,\"Control Panel\\Desktop\",\"WallpaperStyle\",0x00000002,0x00000000\n" +
+ "HKCU,\"Control Panel\\Desktop\",\"TileWallpaper\",0x00000002,0x00000000\n");
+
+ }
+ }
+
+ public class AutorunFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "autorun.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class SysSetupFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "syssetup.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class TxtSetupFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "txtsetup.sif")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class UnattendFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "unattend.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class DownloaderFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "downloader.xml")
+ {
+ int i = 0;
+ }
+ }
+ }
+
+ public class UnAttendedSetupFileHandler : IFileHandler
+ {
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == "unattend.inf")
+ {
+ int i = 0;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IBuildStatusMailReporter.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IBuildStatusMailReporter.cs
new file mode 100644
index 00000000000..4d156d6cc5b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IBuildStatusMailReporter.cs
@@ -0,0 +1,10 @@
+using System;
+
+namespace SysGen.BuildEngine
+{
+ public interface IBuildStatusMailReporter
+ {
+ string MailAdress { get; }
+ string Subject { get; }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IDirectory.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IDirectory.cs
new file mode 100644
index 00000000000..9db7825e601
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IDirectory.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public interface IDirectory
+ {
+ PathRoot Root { get; }
+ string BasePath { get; }
+
+ RBuildFolder Folder { get;}
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IElement.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IElement.cs
new file mode 100644
index 00000000000..58ca260b44d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IElement.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public interface IElement
+ {
+ string BaseBuildLocation { get; }
+ void Initialize(System.Xml.XmlNode elementNode);
+ RBuildModule Module { get; }
+ string Name { get; }
+ IElement Parent { get; set; }
+ RBuildProject Project { get; set; }
+ //PropertyCollection Properties { get; }
+ RBuildElement RBuildElement { get; }
+ SysGenEngine SysGen { get; set; }
+ XmlNode XmlNode { get; }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IFileHandler.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IFileHandler.cs
new file mode 100644
index 00000000000..8aa1e081b57
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IFileHandler.cs
@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public interface IFileHandler
+ {
+ void Process(RBuildFile file);
+ }
+
+ public abstract class NamedFileHandler : IFileHandler
+ {
+ public abstract string FileName { get; }
+
+ public void Process(RBuildFile file)
+ {
+ if (file.Name == FileName)
+ {
+ }
+ }
+
+ protected abstract void Process();
+ }
+
+ public abstract class RegenerateFileHandler : NamedFileHandler
+ {
+ public virtual void Generate()
+ {
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IRBuildInstallable.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IRBuildInstallable.cs
new file mode 100644
index 00000000000..f3c94193996
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/IRBuildInstallable.cs
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.RBuild.Framework
+{
+ public class IRBuildInstallable
+ {
+ string InstallBase;
+
+ RBuildInstallFolder InstallFolder;
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ISysGenObject.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ISysGenObject.cs
new file mode 100644
index 00000000000..20c3246615a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ISysGenObject.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Represent one of the root element object types for SysGen : Project and Module
+ ///
+ public interface ISysGenObject
+ {
+ RBuildElement RBuildElement { get; }
+ }
+
+ public interface ISysGenObjectFileContainer
+ {
+ RBuildFileCollection Files { get; }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITask.cs
new file mode 100644
index 00000000000..7e2e4f4eabe
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITask.cs
@@ -0,0 +1,18 @@
+using System;
+
+namespace SysGen.BuildEngine
+{
+ public interface ITask : IElement
+ {
+ void Execute();
+ bool FailOnError { get; set; }
+ bool IfDefined { get; set; }
+ bool IfNotDefined { get; set; }
+ string LogPrefix { get; }
+ string Name { get; }
+ void PostExecute();
+ void PreExecute();
+ string ToString();
+ bool Verbose { get; set; }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITaskContainer.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITaskContainer.cs
new file mode 100644
index 00000000000..053c6d2b849
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Interfaces/ITaskContainer.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine
+{
+ public interface ITaskContainer : ITask
+ {
+ bool ExecuteChilds { get; }
+ TaskCollection ChildTasks { get; }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Location.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Location.cs
new file mode 100644
index 00000000000..d030fe2b0d5
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Location.cs
@@ -0,0 +1,89 @@
+using System;
+using System.IO;
+using System.Text;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Stores the file name, line number and column number to record a position in a text file.
+ ///
+ [Serializable]
+ public class Location {
+ string _fileName = null;
+ int _lineNumber = 0;
+ int _columnNumber = 0;
+
+ public static readonly Location UnknownLocation = new Location();
+
+ /// Creates a location consisting of a file name, line number and column number.
+ /// fileName can be a local URI resource, e.g., file:///C:/WINDOWS/setuplog.txt
+ public Location(string fileName, int lineNumber, int columnNumber) {
+ Init(fileName, lineNumber, columnNumber);
+ }
+
+ /// Creates a location consisting of a file name.
+ /// fileName can be a local URI resource, e.g., file:///C:/WINDOWS/setuplog.txt
+ public Location(string fileName) {
+ Init(fileName, 0, 0);
+ }
+
+ /// Creates an "unknown" location.
+ private Location() {
+ Init(null, 0, 0);
+ }
+
+ /// Private Init function.
+ private void Init(string fileName, int lineNumber, int columnNumber) {
+ if (fileName != null) {
+ try {
+ // first check to see if fileName is a URI
+ Uri uri = new Uri(fileName);
+ fileName = uri.LocalPath;
+ } catch {
+ // must be a simple filename
+ fileName = Path.GetFullPath(fileName);
+ }
+ }
+ _fileName = fileName;
+ _lineNumber = lineNumber;
+ _columnNumber = columnNumber;
+ }
+
+ /// Gets a string containing the file name for the location.
+ /// The file name includes both the file path and the extension.
+ public string FileName {
+ get { return _fileName; }
+ }
+
+ /// Gets the line number for the location.
+ /// Lines start at 1. Will be zero if not specified.
+ public int LineNumber {
+ get { return _lineNumber; }
+ }
+
+ /// Gets the column number for the location.
+ /// Columns start a 1. Will be zero if not specified.
+ public int ColumnNumber {
+ get { return _columnNumber; }
+ }
+
+ ///
+ /// Returns the file name, line number and a trailing space. An error
+ /// message can be appended easily. For unknown locations, returns
+ /// an empty string.
+ ///
+ public override string ToString() {
+ StringBuilder sb = new StringBuilder("");
+
+ if (_fileName != null) {
+ sb.Append(_fileName);
+ if (_lineNumber != 0) {
+ sb.Append(String.Format("({0},{1})", _lineNumber, _columnNumber));
+ }
+ sb.Append(":");
+ }
+
+ return sb.ToString();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/LocationMap.cs b/reactos/tools/sysgen/SysGen.BuildEngine/LocationMap.cs
new file mode 100644
index 00000000000..ad6c73e2900
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/LocationMap.cs
@@ -0,0 +1,211 @@
+using System;
+using System.IO;
+using System.Text.RegularExpressions;
+using System.Xml;
+using System.Xml.XPath;
+using System.Collections;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// Maps XML nodes to the text positions from their original source.
+ ///
+ public class LocationMap {
+
+ struct TextPosition {
+ public static readonly TextPosition InvalidPosition = new TextPosition(-1,-1);
+
+ public TextPosition(int line, int column) {
+ Line = line;
+ Column = column;
+ }
+
+ public int Line;
+ public int Column;
+ }
+
+ // The LocationMap uses a hash table to map filenames to resolve specific maps.
+ Hashtable _fileMap = new Hashtable();
+
+ public LocationMap() {
+ }
+
+ /// Add a XmlDocument to the map.
+ ///
+ /// A document can only be added to the map once.
+ ///
+ public void Add(XmlDocument doc) {
+ // prevent duplicate mapping
+ // NOTE: if this becomes a liability then just return when a duplicate map has happened
+ string fileName = doc.BaseURI;
+
+ //check for non-backed documents
+ if(fileName == "")
+ return;
+
+ if (_fileMap.ContainsKey(fileName)) {
+ throw new ArgumentException(String.Format("XmlDocument '{0}' already mapped.", fileName), "doc");
+ }
+
+ Hashtable map = new Hashtable();
+
+ string parentXPath = "/"; // default to root
+ string previousXPath = "";
+ int previousDepth = 0;
+
+ // Load text reader.
+ XmlTextReader reader = new XmlTextReader(fileName);
+
+ reader.XmlResolver = null;
+
+ try {
+ map.Add((object) "/", (object) new TextPosition(1, 1));
+
+ ArrayList indexAtDepth = new ArrayList();
+
+ // loop thru all nodes in the document
+ while (reader.Read()) {
+ // Ignore nodes we aren't interested in
+ if ((reader.NodeType != XmlNodeType.Whitespace) &&
+ (reader.NodeType != XmlNodeType.EndElement) &&
+ (reader.NodeType != XmlNodeType.ProcessingInstruction) &&
+ (reader.NodeType != XmlNodeType.XmlDeclaration)) {
+
+ int level = reader.Depth;
+ string currentXPath = "";
+
+ // If we are higher than before
+ if (reader.Depth < previousDepth) {
+ // Clear vars for new depth
+ string[] list = parentXPath.Split('/');
+ string newXPath = ""; // once appended to / will be root node ...
+
+ for (int j = 1; j < level+1; j++) {
+ newXPath += "/" + list[j];
+ }
+
+ // higher than before so trim xpath\
+ parentXPath = newXPath; // one up from before
+
+ // clear indexes for depth greater than ours
+ indexAtDepth.RemoveRange(level+1, indexAtDepth.Count - (level+1));
+
+ } else if (reader.Depth > previousDepth) {
+ // we are lower
+ parentXPath = previousXPath;
+ }
+
+ // End depth setup
+ // Setup up index array
+ // add any needed extra items ( usually only 1 )
+ // would have used array but not sure what maximum depth will be beforehand
+ for (int index = indexAtDepth.Count; index < level+1; index++) {
+ indexAtDepth.Add(0);
+ }
+ // Set child index
+ if ((int) indexAtDepth[level] == 0) {
+ // first time thru
+ indexAtDepth[level] = 1;
+ } else {
+ indexAtDepth[level] = (int) indexAtDepth[level] + 1; // lower so append to xpath
+ }
+
+ // Do actual XPath generation
+ if (parentXPath.EndsWith("/")) {
+ currentXPath = parentXPath;
+ } else {
+ currentXPath = parentXPath + "/"; // add seperator
+ }
+
+ // Set the final XPath
+ currentXPath += "child::node()[" + indexAtDepth[level] + "]";
+
+ // Add to our hash structures
+ map.Add((object) currentXPath, (object) new TextPosition(reader.LineNumber, reader.LinePosition));
+
+ // setup up loop vars for next iteration
+ previousXPath = currentXPath;
+ previousDepth = reader.Depth;
+ }
+ }
+ } finally {
+ reader.Close();
+ }
+
+ // add map at the end to prevent adding maps that had errors
+ _fileMap.Add(fileName, map);
+
+ }
+
+ /// Return the in the xml file for the given node.
+ ///
+ /// The node passed in must be from a XmlDocument that has been added to the map.
+ ///
+ public Location GetLocation(XmlNode node) {
+ // find hashtable this node's file is mapped under
+ string fileName = node.BaseURI;
+ if (fileName == "" ) {
+ return new Location(null, 0, 0 ); // return null location because we have a fileless node.
+ }
+ if (!_fileMap.ContainsKey(fileName)) {
+ //throw new ArgumentException("Xml node has not been mapped.");
+ return new Location(null, 0, 0);
+ }
+
+ // find xpath for node
+ Hashtable map = (Hashtable) _fileMap[fileName];
+ string xpath = GetXPathFromNode(node);
+ if (!map.ContainsKey(xpath)) {
+ //throw new ArgumentException("Xml node has not been mapped.");
+ return new Location(null, 0, 0);
+ }
+
+ TextPosition pos = (TextPosition) map[xpath];
+ Location location = new Location(fileName, pos.Line, pos.Column);
+ return location;
+ }
+
+ private string GetXPathFromNode(XmlNode node) {
+ // IM TODO review this algorithm - tidy up
+ XPathNavigator nav = node.CreateNavigator();
+
+ string xpath = "";
+ int index = 0;
+
+ while (nav != null && nav.NodeType.ToString() != "Root")
+ {
+ // loop thru children until we find ourselves
+ XPathNavigator navParent = nav.Clone();
+ navParent.MoveToParent();
+ int parentIndex = 0;
+ navParent.MoveToFirstChild();
+ if (navParent.IsSamePosition(nav)) {
+ index = parentIndex;
+ }
+ while (navParent.MoveToNext()) {
+ parentIndex++;
+ if (navParent.IsSamePosition(nav)) {
+ index = parentIndex;
+ }
+ }
+
+ nav.MoveToParent(); // do loop condition here
+ index++; // Convert to 1 based index
+
+ string thisNode = "child::node()[" + index + "]";
+
+ if (xpath == "") {
+ xpath = thisNode;
+ } else {
+ // build xpath string
+ xpath = thisNode + "/" + xpath;
+ }
+ }
+
+ // prepend slash to ...
+ xpath = "/" + xpath;
+
+ return xpath;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Log.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Log.cs
new file mode 100644
index 00000000000..96de3e19a2a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Log.cs
@@ -0,0 +1,215 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+
+namespace SysGen.BuildEngine.Log
+{
+ public class BuildEventArgs : EventArgs
+ {
+ protected string _name = string.Empty;
+
+ public BuildEventArgs(string name)
+ {
+ _name = name;
+ }
+
+ public string Name
+ {
+ get { return _name; }
+ set { _name = value; }
+ }
+ }
+
+ /// Delegate to handle Build events
+ public delegate void BuildEventHandler(object sender, BuildEventArgs e);
+
+ public interface IBuildEventConsumer
+ {
+ /// Signals that a build has started. This event is fired before any targets have started.
+ void BuildStarted(object sender, BuildEventArgs e);
+
+ /// Signals that the last target has finished. This event will still be fired if an error occurred during the build.
+ void BuildFinished(object sender, BuildEventArgs e);
+
+ /// Signals that a target has started.
+ void TargetStarted(object sender, BuildEventArgs e);
+
+ /// Signals that a target has finished. This event will still be fired if an error occurred during the build.
+ void TargetFinished(object sender, BuildEventArgs e);
+
+ /// Signals that a task has started.
+ void TaskStarted(object sender, BuildEventArgs e);
+
+ /// Signals that a task has finished. This event will still be fired if an error occurred during the build.
+ void TaskFinished(object sender, BuildEventArgs e);
+ }
+
+ public abstract class LogListener {
+ public abstract void Write(string message);
+ public abstract void WriteLine(string message);
+ public virtual void WriteLine(string message, string messageType) {
+ WriteLine(message);
+ }
+
+ public virtual void Flush() {
+ }
+ }
+
+ /// Provides a set of methods and properties that log the execution of the build process. This class cannot be inherited.
+ public sealed class BuildLog
+ {
+ private static bool _autoFlush;
+ private static int _indentLevel;
+ private static int _indentSize;
+ private static bool _needIndent; // true if the output should be indented; otherwise, false
+ private static LogListenerCollection _listeners;
+
+ static BuildLog()
+ {
+ _autoFlush = false;
+ _indentLevel = 0;
+ _indentSize = 4;
+ _needIndent = true;
+ _listeners = new LogListenerCollection();
+ _listeners.Add(new ConsoleLogger());
+ }
+
+ /// Gets or sets whether Flush should be called on the Listeners after every write.
+ public static bool AutoFlush {
+ get { return _autoFlush; }
+ set { _autoFlush = value; }
+ }
+
+ /// Gets or sets the indent level. Default is zero.
+ public static int IndentLevel {
+ get { return _indentLevel; }
+ set { _indentLevel = value; }
+ }
+
+ /// Gets or sets the number of spaces in an indent. Default is four.
+ public static int IndentSize {
+ get { return _indentSize; }
+ set { _indentSize = value; }
+ }
+
+ /// Gets the collection of listeners that is monitoring the log output.
+ public static LogListenerCollection Listeners {
+ get { return _listeners; }
+ }
+
+ /// Flushes the output buffer, and causes buffered data to be written to the Listeners.
+ public static void Flush() {
+ foreach (LogListener l in _listeners) {
+ l.Flush();
+ }
+ }
+
+ /// Increases the current IndentLevel by one.
+ public static void Indent() {
+ _indentLevel++;
+ }
+
+ /// Decreases the current IndentLevel by one.
+ public static void Unindent() {
+ if (_indentLevel > 0) {
+ _indentLevel--;
+ }
+ }
+
+ /// Indents the message if needed.
+ private static string FormatMessage(string message) {
+ // if we are starting a new line then first indent the string
+ if (_needIndent) {
+ if (IndentLevel > 0) {
+ StringBuilder sb = new StringBuilder(message);
+ sb.Insert(0, " ", IndentLevel * IndentSize);
+ message = sb.ToString();
+ }
+ _needIndent = false;
+ }
+ return message;
+ }
+
+ /// Writes the given message to the log.
+ public static void Write(string message) {
+ message = FormatMessage(message);
+ foreach (LogListener l in _listeners) {
+ l.Write(message);
+ }
+
+ if (AutoFlush) {
+ Flush();
+ }
+ }
+
+ /// Writes the given message to the log.
+ public static void Write(string format, params object[] arg) {
+ Write(String.Format(format, arg));
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteIf(bool condition, string message) {
+ if (condition) {
+ Write(message);
+ }
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteIf(bool condition, string format, params object[] arg) {
+ if (condition) {
+ Write(String.Format(format, arg));
+ }
+ }
+
+ /// Writes the given message to the log.
+ public static void WriteLine(string message) {
+ Write(message + Environment.NewLine);
+ _needIndent = true;
+ }
+
+ /// Writes the given message to the log.
+ public static void WriteLine() {
+ WriteLine(String.Empty);
+ }
+
+ /// Writes the given message to the log.
+ public static void WriteLine(string format, params object[] arg) {
+ WriteLine(String.Format(format, arg));
+ }
+
+ public static void WriteMessage(string message, string messageType) {
+ message = FormatMessage(message);
+ foreach (LogListener l in _listeners) {
+ l.WriteLine(message, messageType);
+ }
+
+ if (AutoFlush) {
+ Flush();
+ }
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteLineIf(bool condition, string message) {
+ if (condition) {
+ WriteLine(message);
+ }
+ }
+
+ /// Writes the given message to the log if condition is true.
+ public static void WriteLineIf(bool condition, string format, params object[] arg) {
+ if (condition) {
+ WriteLine(String.Format(format, arg));
+ }
+ }
+ }
+
+ public class LogWriter : StringWriter {
+ public override void Close() {
+ BuildLog.Write(GetStringBuilder().ToString());
+ base.Close();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/ConsoleLogger.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/ConsoleLogger.cs
new file mode 100644
index 00000000000..8ffa3fee74c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/ConsoleLogger.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine.Log
+{
+ ///
+ /// The standard logger that will suffice for any command line based nant runner.
+ ///
+ public class ConsoleLogger : LogListener
+ {
+ public override void Write(string message)
+ {
+ Console.Write(message);
+ }
+
+ public override void WriteLine(string message)
+ {
+ Console.WriteLine(message);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/StringLogger.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/StringLogger.cs
new file mode 100644
index 00000000000..0a6319873b8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/StringLogger.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Xml;
+
+namespace SysGen.BuildEngine.Log
+{
+ ///
+ /// Used for test classes to check output.
+ ///
+ public class StringLogger : LogListener
+ {
+ private StringWriter _writer = new StringWriter();
+
+ public override void Write(string message)
+ {
+ _writer.Write(message);
+ }
+
+ public override void WriteLine(string message)
+ {
+ _writer.WriteLine(message);
+ }
+
+ ///
+ /// Returns the contents of log captured.
+ ///
+ public override string ToString()
+ {
+ return _writer.ToString();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/XmlLogger.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/XmlLogger.cs
new file mode 100644
index 00000000000..bc2da4f0e44
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Log/Loggers/XmlLogger.cs
@@ -0,0 +1,193 @@
+using System;
+using System.Collections;
+using System.Diagnostics;
+using System.IO;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Xml;
+
+namespace SysGen.BuildEngine.Log
+{
+ ///
+ /// Used to wrap log messages in xml <message/> elements
+ ///
+ public class XmlLogger : LogListener, IBuildEventConsumer
+ {
+ public class Elements
+ {
+ public const string BUILD_RESULTS = "buildresults";
+ public const string MESSAGE = "message";
+ public const string TARGET = "target";
+ public const string TASK = "task";
+ public const string STATUS = "status";
+ }
+
+ public class Attributes
+ {
+ public const string PROJECT = "project";
+ public const string MESSAGETYPE = "type";
+ }
+
+ private TextWriter _writer = Console.Out;
+ private XmlTextWriter _xmlWriter = new XmlTextWriter(Console.Out);
+
+ public XmlLogger()
+ {
+
+ }
+
+ public XmlLogger(TextWriter writer)
+ {
+ _writer = writer;
+ _xmlWriter = new XmlTextWriter(_writer);
+ _xmlWriter.Formatting = Formatting.Indented;
+ }
+
+ public string StripFormatting(string message)
+ {
+ //looking for zero or more white space from front of line followed by
+ //one or more of just about anything between [ and ] followed by a message
+ //which we will capture. ' [blah]
+ Regex r = new Regex(@"(?ms)^\s*?\[[\s\w\d]+\](.+)");
+
+ Match m = r.Match(message);
+ if (m.Success)
+ {
+ return m.Groups[1].Captures[0].Value.Trim();
+ }
+ return message;
+ }
+
+ public bool IsJustWhiteSpace(string message)
+ {
+ Regex r = new Regex(@"^\s*$");
+
+ return r.Match(message).Success;
+ }
+
+ #region LogListener Overrides
+
+ public override void Write(string formattedMessage)
+ {
+ WriteLine(formattedMessage, null);
+ }
+
+ public override void WriteLine(string message)
+ {
+ WriteLine(message, null);
+ }
+
+ public override void WriteLine(string message, string messageType)
+ {
+ string rawMessage = StripFormatting(message.Trim());
+ if (IsJustWhiteSpace(rawMessage))
+ {
+ return;
+ }
+
+ _xmlWriter.WriteStartElement(Elements.MESSAGE);
+
+ if (messageType != null && messageType != String.Empty)
+ {
+ _xmlWriter.WriteAttributeString(Attributes.MESSAGETYPE, messageType);
+ }
+
+ if (IsValidXml(rawMessage))
+ {
+ rawMessage = Regex.Replace(rawMessage, @"<\?.*\?>", String.Empty);
+ _xmlWriter.WriteRaw(rawMessage);
+ }
+ else
+ {
+ _xmlWriter.WriteCData(StripCData(rawMessage));
+ }
+ _xmlWriter.WriteEndElement();
+ _xmlWriter.Flush();
+ }
+
+ private bool IsValidXml(string message)
+ {
+ if (Regex.Match(message, @"^<.*>").Success)
+ {
+ // validate xml
+ XmlValidatingReader reader = new XmlValidatingReader(message, XmlNodeType.Element, null);
+ try { while (reader.Read()) { } }
+ catch (Exception) { return false; }
+ finally { reader.Close(); }
+ return true;
+ }
+ return false;
+ }
+
+ private string StripCData(string message)
+ {
+ string strippedMessage = Regex.Replace(message, @"", String.Empty);
+ }
+
+ public override void Flush()
+ {
+ _writer.Flush();
+ }
+
+ /// Returns the contents of log captured.
+ public override string ToString()
+ {
+ return _writer.ToString();
+ }
+
+ #endregion
+
+ #region IBuildEventConsumer Implementation
+
+ public void BuildStarted(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteStartElement(Elements.BUILD_RESULTS);
+ _xmlWriter.WriteAttributeString(Attributes.PROJECT, args.Name);
+ }
+
+ public void BuildFinished(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteEndElement();
+ }
+
+ public void TargetStarted(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteStartElement(Elements.TARGET);
+ WriteNameAttribute(args.Name);
+ _xmlWriter.Flush();
+ }
+
+ public void TargetFinished(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteEndElement();
+ _xmlWriter.Flush();
+ }
+
+ public void TaskStarted(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteStartElement(Elements.TASK);
+ WriteNameAttribute(args.Name);
+ _xmlWriter.Flush();
+ }
+
+ public void TaskFinished(object obj, BuildEventArgs args)
+ {
+ _xmlWriter.WriteEndElement();
+ _xmlWriter.Flush();
+ }
+
+ private void WriteNameAttribute(string name)
+ {
+ _xmlWriter.WriteAttributeString("name", name);
+ }
+
+ private void WriteStatus(string status)
+ {
+ _xmlWriter.WriteStartElement(Elements.STATUS);
+ _xmlWriter.WriteAttributeString("value", status);
+ _xmlWriter.WriteEndElement();
+ }
+ #endregion
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskBuilder.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskBuilder.cs
new file mode 100644
index 00000000000..6fbe2b65424
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskBuilder.cs
@@ -0,0 +1,72 @@
+using System;
+using System.Reflection;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine
+{
+ public class TaskBuilder
+ {
+ private string _className;
+ private string _assemblyFileName;
+ private string _taskName;
+
+ public TaskBuilder(string className) : this(className, null) {
+ }
+
+ public TaskBuilder(string className, string assemblyFileName) {
+ _className = className;
+ _assemblyFileName = assemblyFileName;
+
+ // get task name from attribute
+ Assembly assembly = GetAssembly();
+ TaskNameAttribute taskNameAttribute = (TaskNameAttribute)
+ Attribute.GetCustomAttribute(assembly.GetType(ClassName), typeof(TaskNameAttribute));
+
+ _taskName = taskNameAttribute.FullTaskName; // Name;
+ }
+
+ public string ClassName
+ {
+ get { return _className; }
+ }
+
+ public string AssemblyFileName
+ {
+ get { return _assemblyFileName; }
+ }
+
+ public string TaskName
+ {
+ get { return _taskName; }
+ }
+
+ private Assembly GetAssembly() {
+ Assembly assembly = null;
+ if (AssemblyFileName == null) {
+ assembly = Assembly.GetExecutingAssembly();
+ } else {
+ //check to see if it is loaded already
+ Assembly [] ass = AppDomain.CurrentDomain.GetAssemblies();
+ for (int i = 0; i < ass.Length; i++){
+ try {
+ if(ass[i].Location.Equals(AssemblyFileName)) {
+ assembly = ass[i];
+ return assembly;
+ }
+ }
+ // System.Reflection.Emit.Assembly have no location and will fail
+ catch{}
+ }
+ //load if not loaded
+ if(assembly == null)
+ assembly = Assembly.LoadFrom(AssemblyFileName);
+ }
+ return assembly;
+ }
+
+ public Task CreateTask()
+ {
+ return (Task)GetAssembly().CreateInstance(ClassName, true);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskFactory.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskFactory.cs
new file mode 100644
index 00000000000..66c14ff3a17
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Plugins/TaskFactory.cs
@@ -0,0 +1,136 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Reflection;
+using System.Collections;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// The TaskFactory comprises all of the loaded, and available, tasks.
+ /// Use these static methods to register, initialize and create a task.
+ ///
+ public class TaskFactory
+ {
+ static TaskBuilderCollection _builders = new TaskBuilderCollection();
+ static ArrayList _projects = new ArrayList();
+
+ ///
+ /// Initializes the tasks in the executing assembly, and basedir of the current domain.
+ ///
+ static TaskFactory()
+ {
+ // initialize builtin tasks
+ AddTasks(Assembly.GetExecutingAssembly());
+ AddTasks(Assembly.GetCallingAssembly());
+
+
+ //string nantBinDir = Path.GetFullPath(AppDomain.CurrentDomain.BaseDirectory);
+ //ScanDir(nantBinDir);
+ //ScanDir(Path.Combine(nantBinDir, "tasks"));
+ }
+
+ /*
+ /// Scans the path for any Tasks assemblies and adds them.
+ /// The directory to scan in.
+ protected static void ScanDir(string path) {
+ // Don't do anything if we don't have a valid directory path
+ if(path == null || path == string.Empty) {
+ return;
+ }
+
+ // intialize tasks found in assemblies that end in Tasks.dll
+ DirectoryScanner scanner = new DirectoryScanner();
+ scanner.BaseDirectory = path;
+ scanner.Includes.Add("*Tasks.dll");
+
+ //needed for testing
+ scanner.Includes.Add("*Tests.dll");
+ scanner.Includes.Add("*Test.dll");
+
+ foreach(string assemblyFile in scanner.FileNames) {
+ //Log.WriteLine("{0}:Add Tasks from {1}", AppDomain.CurrentDomain.FriendlyName, assemblyFile);
+
+ AddTasks(Assembly.LoadFrom(assemblyFile));
+ //AddTasks(AppDomain.CurrentDomain.Load(assemblyFile.Replace(AppDomain.CurrentDomain.BaseDirectory,"").Replace(".dll","")));
+ }
+
+ }
+ */
+
+ /*
+ /// Adds any Task Assemblies in the Project.BaseDirectory.
+ /// The project to work from.
+ public static void AddProject(SysGenEngine project) {
+ if(project.BaseDirectory != null && !project.BaseDirectory.Equals(string.Empty)) {
+ ScanDir(project.BaseDirectory);
+ ScanDir(Path.Combine(project.BaseDirectory, "tasks"));
+ }
+ //create weakref to project. It is possible that project may go away, we don't want to hold it.
+ _projects.Add(new WeakReference(project));
+ foreach(TaskBuilder tb in Builders) {
+ UpdateProjectWithBuilder(project, tb);
+ }
+ }*/
+
+ /// Returns the list of loaded TaskBuilders
+ public static TaskBuilderCollection Builders {
+ get { return _builders; }
+ }
+ /// Scans the given assembly for any classes derived from Task and adds a new builder for them.
+ /// The Assembly containing the new tasks to be loaded.
+ /// The count of tasks found in the assembly.
+ public static int AddTasks(Assembly assembly) {
+ int taskCount = 0;
+ try {
+ foreach(Type type in assembly.GetTypes()) {
+ if (type.IsSubclassOf(typeof(Task)) && !type.IsAbstract) {
+ TaskBuilder tb = new TaskBuilder(type.FullName, assembly.Location);
+ if (_builders.Add(tb)) {
+ foreach(WeakReference wr in _projects) {
+ if(!wr.IsAlive)
+ continue;
+ SysGenEngine p = wr.Target as SysGenEngine;
+ if(p == null)
+ continue;
+ UpdateProjectWithBuilder(p, tb);
+ }
+ taskCount++;
+ }
+ }
+ }
+ }
+ // For assemblies that don't have types
+ catch{};
+
+ return taskCount;
+ }
+
+ protected static void UpdateProjectWithBuilder(SysGenEngine sysGen, TaskBuilder taskBuilder)
+ {
+ // add a true property for each task (use in build to test for task existence).
+ // add a property for each task with the assembly location.
+ sysGen.Properties.AddReadOnly("SysGen.Tasks." + taskBuilder.TaskName + ".Available", Boolean.TrueString);
+ sysGen.Properties.AddReadOnly("SysGen.Tasks." + taskBuilder.TaskName + ".Assembly", taskBuilder.AssemblyFileName);
+ }
+
+ /// Creates a new Task instance for the given xml and project.
+ /// The XML to initialize the task with.
+ /// The Project that the Task belongs to.
+ /// The Task instance.
+ public static Task CreateTask(XmlNode taskNode, SysGenEngine proj)
+ {
+ string taskName = taskNode.Name;
+
+ TaskBuilder builder = _builders.FindBuilderForTask(taskName);
+ if (builder == null && proj != null) {
+ Location location = proj.LocationMap.GetLocation(taskNode);
+ throw new BuildException(String.Format("Unknown task <{0}>", taskName), location);
+ }
+
+ Task task = builder.CreateTask();
+ task.SysGen = proj;
+ return task;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..be7575e9d01
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Properties/AssemblyInfo.cs
@@ -0,0 +1,15 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+[assembly: AssemblyTitle("SysGen")]
+[assembly: AssemblyDescription("SysGen ReactOS Build Tool")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("SysGen")]
+[assembly: AssemblyCopyright("Copyright (C) 2007 J.Marc Piulachs")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: AssemblyVersion("0.1.0.*")]
+
+[assembly: AssemblyDelaySign(false)]
+[assembly: AssemblyKeyName("")]
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj
new file mode 100644
index 00000000000..515cf8ded34
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj
@@ -0,0 +1,381 @@
+
+
+ Local
+ 9.0.30729
+ 2.0
+ {8F5F8375-4097-4952-B860-784EB9961ABE}
+ Debug
+ AnyCPU
+
+
+
+
+ SysGen.Framework
+
+
+ JScript
+ Grid
+ IE50
+ false
+ Library
+ SysGen.Framework
+
+
+
+
+
+
+ 2.0
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
+
+
+ bin\Debug\
+ false
+ 285212672
+ false
+
+
+
+
+
+
+ true
+ 4096
+ false
+ false
+ false
+ false
+ 1
+ full
+ prompt
+
+
+ bin\Debug\
+ false
+ 285212672
+ false
+
+
+
+
+
+
+ true
+ 4096
+ false
+ false
+ false
+ false
+ 1
+ full
+ prompt
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+
+
+
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+ Code
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+ {88D9BED7-30C5-4683-A6C6-6F2EB55B8F26}
+ SysGen.RBuild.Framework
+
+
+
+
+ False
+ .NET Framework Client Profile
+ false
+
+
+ False
+ .NET Framework 2.0 %28x86%29
+ true
+
+
+ False
+ .NET Framework 3.0 %28x86%29
+ false
+
+
+ False
+ .NET Framework 3.5
+ false
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj.user b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj.user
new file mode 100644
index 00000000000..ef20f1c8f95
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGen.Framework.csproj.user
@@ -0,0 +1,19 @@
+
+
+ ShowAllFiles
+
+
+
+
+
+
+
+
+
+
+
+
+ en-US
+ false
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenConversion.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenConversion.cs
new file mode 100644
index 00000000000..e9fe9b97686
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenConversion.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace SysGen.BuildEngine
+{
+ class SysGenConversion
+ {
+ public static bool ToBolean(object value)
+ {
+ switch (value.ToString().ToLower())
+ {
+ case "yes":
+ case "true":
+ case "1":
+ return true;
+ case "no":
+ case "false":
+ case "0":
+ return false;
+ }
+
+ throw new ValidationException(String.Format("Cannot resolve to '{0}' to Boolean value.", value.ToString()));
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenDependencyTracker.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenDependencyTracker.cs
new file mode 100644
index 00000000000..1f49363684b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenDependencyTracker.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Framework;
+
+namespace SysGen.BuildEngine
+{
+ public class SysGenDependencyTracker
+ {
+ RBuildProject m_Project = null;
+ RBuildModuleCollection m_Modules = new RBuildModuleCollection();
+ RBuildModuleCollection m_DependsOn = new RBuildModuleCollection();
+ RBuildModuleCollection m_DependencyOf = new RBuildModuleCollection();
+
+ public SysGenDependencyTracker(RBuildProject project)
+ {
+ m_Project = project;
+ }
+
+ public SysGenDependencyTracker(RBuildProject project, RBuildModule module)
+ : this(project)
+ {
+ m_Modules.Add(module);
+ Calculate();
+ }
+
+ public SysGenDependencyTracker(RBuildProject project, RBuildModuleCollection modules)
+ : this(project)
+ {
+ m_Modules.Add(modules);
+ Calculate();
+ }
+
+ public void Calculate()
+ {
+ m_DependsOn.Clear();
+ m_DependencyOf.Clear();
+
+ foreach (RBuildModule module in m_Modules)
+ {
+ GetModuleDependencies(module);
+ }
+
+ foreach (RBuildModule projectModule in m_Project.Modules)
+ {
+ foreach (RBuildModule module in m_Modules)
+ {
+ if (projectModule.Needs.Contains(module))
+ {
+ m_DependencyOf.Add(projectModule);
+ }
+ }
+ }
+ }
+
+ private void GetModuleDependencies(RBuildModule module)
+ {
+ foreach (RBuildModule library in module.Needs)
+ {
+ if (m_DependsOn.Contains(library) == false)
+ {
+ if (m_Modules.Contains(library) == false)
+ {
+ //Add it to the list of dependencies
+ m_DependsOn.Add(library);
+
+ //Investigate the module to find its dependencies
+ GetModuleDependencies(library);
+ }
+ }
+ }
+ }
+
+ public RBuildModuleCollection DependsOn
+ {
+ get { return m_DependsOn; }
+ }
+
+ public RBuildModuleCollection DependencyOf
+ {
+ get { return m_DependencyOf; }
+ }
+
+ public RBuildModuleCollection Missing
+ {
+ get
+ {
+ RBuildModuleCollection missing = new RBuildModuleCollection();
+
+ foreach (RBuildModule dependency in DependsOn)
+ {
+ if (m_Project.Platform.Modules.Contains(dependency) == false)
+ missing.Add(dependency);
+ }
+
+ return missing;
+ }
+ }
+
+ public RBuildModuleCollection Using
+ {
+ get
+ {
+ RBuildModuleCollection missing = new RBuildModuleCollection();
+
+ foreach (RBuildModule dependency in DependencyOf)
+ {
+ if (m_Project.Platform.Modules.Contains(dependency) == true)
+ missing.Add(dependency);
+ }
+
+ return missing;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenEngine.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenEngine.cs
new file mode 100644
index 00000000000..70d8b470285
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenEngine.cs
@@ -0,0 +1,825 @@
+using System;
+using System.Text.RegularExpressions;
+using System.Diagnostics;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+using System.Xml.XPath;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.Specialized;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Tasks;
+using SysGen.BuildEngine.Handlers;
+using SysGen.BuildEngine.Backends;
+
+namespace SysGen.BuildEngine
+{
+ public class SysGenEngine
+ {
+ private Task m_RootTask = null;
+
+ private RBuildProject m_Project = null;
+ private RBuildPlatform m_Platform = null;
+
+ //private TargetCollection m_Targets = new TargetCollection();
+ private FileHandlerCollection m_FileHandlers = new FileHandlerCollection();
+ private BackendCollection m_Backends = new BackendCollection();
+ private RBuildPropertyCollection m_Properties = new RBuildPropertyCollection();
+ private StringCollection m_XmlBuildFiles = new StringCollection();
+
+ //xml element and attribute names that are not defined in metadata
+ protected const string PROJECT_XMLROOT = "project";
+ protected const string PROJECT_NAME_ATTRIBUTE = "name";
+ protected const string PROJECT_DEFAULT_ATTRIBUTE = "default";
+ protected const string PROJECT_BASEDIR_ATTRIBUTE = "basedir";
+
+ public const string SYSGEN_PROPERTY_FILENAME = "SysGen.Filename";
+ public const string SYSGEN_PROPERTY_VERSION = "SysGen.Version";
+ public const string SYSGEN_PROPERTY_LOCATION = "SysGen.Location";
+ public const string SYSGEN_PROPERTY_PROJECT_NAME = "SysGen.Project.Name";
+ public const string SYSGEN_PROPERTY_PROJECT_BUILDFILE = "SysGen.Project.File";
+ public const string SYSGEN_PROPERTY_PROJECT_BASEDIR = "SysGen.Project.BaseDir";
+
+ private string m_BaseDir = null;
+ private bool m_Verbose = false;
+ private bool m_ExecuteBackends = true;
+ private bool m_SetDefaults = true;
+
+ private LocationMap _locationMap = new LocationMap();
+ private XmlDocument _doc = null; // set in ctorHelper
+
+ public static event BuildEventHandler BuildStarted;
+ public static event BuildEventHandler BuildFinished;
+ public static event BuildEventHandler TargetStarted;
+ public static event BuildEventHandler TargetFinished;
+ public static event BuildEventHandler TaskStarted;
+ public static event BuildEventHandler TaskFinished;
+ public static event BuildEventHandler TaskException;
+ public static event BuildEventHandler BuildFileLoaded;
+
+ public static void OnBuildFileLoaded(object o, BuildEventArgs e)
+ {
+ if (BuildFileLoaded != null)
+ BuildFileLoaded(o, e);
+ }
+
+ public static void OnBuildStarted(object o, BuildEventArgs e)
+ {
+ if (BuildStarted != null)
+ BuildStarted(o, e);
+ }
+
+ public static void OnBuildFinished(object o, BuildEventArgs e)
+ {
+ if (BuildFinished != null)
+ BuildFinished(o, e);
+ }
+
+ public static void OnTargetStarted(object o, BuildEventArgs e)
+ {
+ if (TargetStarted != null)
+ TargetStarted(o, e);
+ }
+
+ public static void OnTargetFinished(object o, BuildEventArgs e)
+ {
+ if (TargetFinished != null)
+ TargetFinished(o, e);
+ }
+
+ public static void OnTaskStarted(object o, BuildEventArgs e)
+ {
+ if (TaskStarted != null)
+ TaskStarted(o, e);
+ }
+
+ public static void OnTaskFinished(object o, BuildEventArgs e)
+ {
+ if (TaskFinished != null)
+ TaskFinished(o, e);
+ }
+
+ public static void OnTaskException(object o, BuildEventArgs e)
+ {
+ if (TaskException != null)
+ TaskException(o, e);
+ }
+
+ public RBuildProject Project
+ {
+ get { return m_Project; }
+ set
+ {
+ if (m_Project != null)
+ throw new BuildException("Only one ProjectTask is allowed per project");
+
+ m_Project = value;
+
+ InitializeEnvironment();
+ }
+ }
+
+ public Task RootTask
+ {
+ get { return m_RootTask; }
+ set { m_RootTask = value; }
+ }
+
+ public StringCollection BuildFiles
+ {
+ get { return m_XmlBuildFiles; }
+ }
+
+ public bool SetDefaults
+ {
+ get { return m_SetDefaults; }
+ set { m_SetDefaults = value; }
+ }
+
+ public SysGenEngine(string path, string project) : this (Path.Combine (path , project))
+ {
+ }
+
+ ///
+ /// Constructs a new Project with the given source.
+ ///
+ ///
+ /// The Source should be the full path to the build file.
+ /// This can be of any form that XmlDocument.Load(string url) accepts.
+ ///
+ /// If the source is a uri of form 'file:///path' then use the path part.
+ public SysGenEngine(string source)
+ {
+ string path = source;
+ //if the source is not a valid uri, pass it thru.
+ //if the source is a file uri, pass the localpath of it thru.
+ try
+ {
+ Uri testURI = new Uri(source);
+ if (testURI.IsFile)
+ {
+ path = testURI.LocalPath;
+ }
+ }
+ catch (Exception e)
+ {
+ //do nothing.
+ e.ToString();
+ }
+ finally
+ {
+ if (path == null)
+ path = source;
+ }
+
+ ctorHelper(LoadBuildFile(path));
+ }
+
+ ///
+ /// Inits stuff:
+ /// TaskFactory: Calls Initialize and AddProject
+ /// Log.IndentSize set to 12
+ /// Project properties are initialized ("nant.* stuff set")
+ ///
+ /// NAnt Props:
+ /// - nant.filename
+ /// - nant.version
+ /// - nant.location
+ /// - nant.project.name
+ /// - nant.project.buildfile (if doc has baseuri)
+ /// - nant.project.basedir
+ /// - nant.project.default = defaultTarget
+ /// - nant.tasks.[name] = true
+ /// - nant.tasks.[name].location = AssemblyFileName
+ ///
+ ///
+ /// The Project Document.
+ protected virtual void ctorHelper(XmlDocument doc)
+ {
+ //TaskFactory.AddProject(this);
+ BuildLog.IndentSize = 12;
+ _doc = doc;
+
+ string newBaseDir = null;
+
+ //check to make sure that the root element in named correctly
+ if(!doc.DocumentElement.Name.Equals(PROJECT_XMLROOT))
+ throw new ApplicationException("Root Element must be named " + PROJECT_XMLROOT + " in " + doc.BaseURI);
+
+ /*
+ // get project attributes
+ if(doc.DocumentElement.HasAttribute(PROJECT_NAME_ATTRIBUTE))
+ _projectName = doc.DocumentElement.GetAttribute(PROJECT_NAME_ATTRIBUTE);
+
+ if(doc.DocumentElement.HasAttribute(PROJECT_BASEDIR_ATTRIBUTE))
+ newBaseDir = doc.DocumentElement.GetAttribute(PROJECT_BASEDIR_ATTRIBUTE);
+
+ if(doc.DocumentElement.HasAttribute(PROJECT_DEFAULT_ATTRIBUTE))
+ _defaultTargetName = doc.DocumentElement.GetAttribute(PROJECT_DEFAULT_ATTRIBUTE);
+ */
+
+ // give the project a meaningful base directory
+ if (newBaseDir == null) {
+ if (BuildFileLocalName != null) {
+ newBaseDir = Path.GetDirectoryName(BuildFileLocalName);
+ }
+ else {
+ newBaseDir = Environment.CurrentDirectory;
+ }
+ }
+
+ newBaseDir = Path.GetFullPath(newBaseDir);
+ //BaseDirectory must be rooted.
+ BaseDirectory = newBaseDir;
+
+ }
+
+ internal void InitializeBuildFile(XmlDocument doc, ITaskContainer parent)
+ {
+ // load line and column number information into position map
+ LocationMap.Add(doc);
+
+ // initialize targets and global tasks
+ foreach (XmlNode childNode in doc.ChildNodes)
+ {
+ if (CanProcessNode(childNode))
+ {
+ LoadChildTask(childNode, parent);
+ }
+ }
+ }
+
+ internal bool CanProcessNode(XmlNode childNode)
+ {
+ if ((childNode.NodeType == XmlNodeType.Element) &&
+ (childNode.Name.StartsWith("#") == false) &&
+ (childNode.Name.StartsWith("xml") == false) &&
+ (childNode.Name.StartsWith("!") == false) &&
+ (childNode.NamespaceURI.Equals(string.Empty) ||
+ (childNode.NamespaceURI.Equals("http://www.w3.org/2001/XInclude"))))
+ {
+ return true;
+ }
+
+ return false;
+ }
+
+ internal Task LoadChildTask(XmlNode taskNode, ITaskContainer parent)
+ {
+ try
+ {
+ Task task = TaskFactory.CreateTask(taskNode, this);
+
+ task.Parent = parent;
+ task.Project = m_Project;
+ task.SysGen = this;
+ task.Initialize(taskNode);
+
+ if (task != RootTask)
+ parent.ChildTasks.Add(task);
+
+ return task;
+ }
+ catch (BuildException be)
+ {
+ BuildLog.WriteLine("{0} Failed to created Task for '{1}' xml element for reason: \n {2}", parent.LogPrefix, taskNode.Name, be.Message);
+ }
+
+ return null;
+ }
+
+ ///
+ /// Creates a new XmlDocument based on the project definition.
+ ///
+ /// The source of the document. Any form that is valid for XmlDocument.Load(string url) can be used here.
+ /// The project document.
+ private XmlDocument LoadBuildFile(string source)
+ {
+ XmlDocument doc = new XmlDocument();
+
+ try
+ {
+ OnBuildFileLoaded(this, new BuildEventArgs(source));
+
+ doc.XmlResolver = null;
+ doc.Load(source);
+
+ //Add the build file to the collection of readed xml build files
+ m_XmlBuildFiles.Add(source);
+ }
+ catch (XmlException e)
+ {
+ string message = "Error loading buildfile";
+ Location location = new Location(source, e.LineNumber, e.LinePosition);
+ throw new BuildException(message, location, e);
+ }
+ catch (Exception e)
+ {
+ string message = "Error loading buildfile";
+ Location location = new Location(source);
+ throw new BuildException(message, location, e);
+ }
+ return doc;
+ }
+
+ public virtual bool RBuildFolderExists(RBuildFolder folder)
+ {
+ return Directory.Exists(ResolveRBuildFilePath(folder));
+ }
+
+ public virtual bool RBuildFileExists(RBuildFile file)
+ {
+ return File.Exists(ResolveRBuildFilePath(file));
+ }
+
+ public virtual string ResolveRBuildFilePath(RBuildFileSystemInfo file)
+ {
+ return NormalizePath(Path.Combine(GetPathRoot(file.Root), file.FullPath));
+ }
+
+ public virtual string ResolveRBuildFolderPath(RBuildFolder folder)
+ {
+ return NormalizePath(Path.Combine(GetPathRoot(folder.Root), folder.FullPath));
+ }
+
+ public virtual string ResolveRBuildFilePath(PathRoot root, RBuildFileSystemInfo file)
+ {
+ return NormalizePath(Path.Combine(GetPathRoot(root), file.FullPath));
+ }
+
+ public string NormalizePath(string path)
+ {
+ return path.Replace(
+ Path.AltDirectorySeparatorChar,
+ Path.DirectorySeparatorChar);
+ }
+
+ public string IntermediateDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "obj-i386"); }
+ }
+
+ public string DocumentationDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "doc-i386"); }
+ }
+
+ public string ISODirectory
+ {
+ get { return Path.Combine(BaseDirectory, "iso-i386"); }
+ }
+
+ public string OutputDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "output-i386"); }
+ }
+
+ public string BootCDOutputDirectory
+ {
+ get { return Path.Combine(OutputDirectory, "cd"); }
+ }
+
+ public string LiveCDOutputDirectory
+ {
+ get { return Path.Combine(OutputDirectory, "livecd"); }
+ }
+
+ public string TemporaryDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "obj-i386"); }
+ }
+
+ public string InstallDirectory
+ {
+ get { return Path.Combine(BaseDirectory, "reactos"); }
+ }
+
+ public string GetPathRoot(PathRoot root)
+ {
+ switch (root)
+ {
+ case PathRoot.Default:
+ case PathRoot.SourceCode:
+ return BaseDirectory;
+ break;
+ case PathRoot.LiveCD:
+ return LiveCDOutputDirectory;
+ break;
+ case PathRoot.BootCD:
+ return BootCDOutputDirectory;
+ break;
+ case PathRoot.Intermediate:
+ return IntermediateDirectory;
+ break;
+ case PathRoot.Install:
+ return InstallDirectory;
+ break;
+ case PathRoot.Output:
+ return OutputDirectory;
+ break;
+ case PathRoot.Temporary:
+ return TemporaryDirectory;
+ break;
+ case PathRoot.Platform:
+ return "%SystemRoot%";
+ break;
+ default:
+ throw new Exception("Unknown PathRoot");
+ }
+ }
+
+ ///
+ /// The Base Directory used for relative references.
+ ///
+ ///
+ /// The directory must be rooted. (must start with drive letter, unc, etc.)
+ /// The BaseDirectory sets and gets the special property named 'nant.project.basedir'.
+ ///
+ public string BaseDirectory
+ {
+ get
+ {
+ //string basedir = null; // = Properties[NANT_PROPERTY_PROJECT_BASEDIR];
+
+ if (m_BaseDir == null)
+ return null;
+
+ if (!Path.IsPathRooted(m_BaseDir))
+ throw new BuildException("BaseDirectory must be rooted! " + m_BaseDir);
+
+ return m_BaseDir;
+ }
+ set
+ {
+ if (!Path.IsPathRooted(value))
+ throw new BuildException("BaseDirectory must be rooted! " + value);
+
+ m_BaseDir = value;
+
+ //Properties[NANT_PROPERTY_PROJECT_BASEDIR] = value;
+ }
+ }
+
+ ///
+ /// The URI form of the current Document
+ ///
+ public Uri BuildFileURI {
+ get {
+ //TODO: Need to remove this.
+ if(Doc == null || Doc.BaseURI == "") {
+ return null;//new Uri("http://localhost");
+ }
+ else {
+ return new Uri(Doc.BaseURI);
+ }
+ }
+ }
+
+ ///
+ /// If the build document is not file backed then null will be returned.
+ ///
+ public string BuildFileLocalName {
+ get {
+ if (BuildFileURI != null && BuildFileURI.IsFile) {
+ return BuildFileURI.LocalPath;
+ }
+ else {
+ return null;
+ }
+ }
+ }
+
+ /// Returns the active build file
+ public virtual XmlDocument Doc {
+ get { return _doc; }
+ }
+
+ ///
+ /// When true tasks should output more build log messages.
+ ///
+ public bool Verbose
+ {
+ get { return m_Verbose; }
+ set { m_Verbose = value; }
+ }
+
+ public bool RunBackends
+ {
+ get { return m_ExecuteBackends; }
+ set { m_ExecuteBackends = value; }
+ }
+
+ public RBuildPlatform Platform
+ {
+ get { return m_Platform; }
+ }
+
+ public RBuildPropertyCollection Properties
+ {
+ get { return m_Properties; }
+ }
+
+ internal LocationMap LocationMap {
+ get { return _locationMap; }
+ }
+
+ /////
+ ///// The targets defined in the this project.
+ /////
+ //public TargetCollection Targets
+ //{
+ // get { return m_Targets; }
+ //}
+
+ /// Executes the default target.
+ ///
+ /// No top level error handling is done. Any BuildExceptions will make it out of this method.
+ ///
+ public virtual void Execute()
+ {
+ //InitializeEnvironment();
+
+ //will initialize the list of Targets, and execute any global tasks.
+ InitializeBuildFile(Doc, null);
+
+ RegisterBackends();
+
+ if (Project.InstallFolders.Count == 0)
+ {
+ Project.InstallFolders.Add(new RBuildInstallFolder("1", @"."));
+ Project.InstallFolders.Add(new RBuildInstallFolder("2", @"system32"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("3", @"system32\config"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("4", @"system32\drivers"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("5", @"system"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("17", @"system32\drivers\etc"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("20", @"inf"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("22", @"fonts"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("201", @"system32\bin"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("202", @"media\fonts"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("203", @"bin"));
+ Project.InstallFolders.Add(new RBuildInstallFolder("204", @"media"));
+ }
+
+ if (Project.DebugChannels.Count == 0)
+ {
+ Project.DebugChannels.Add(new RBuildDebugChannel("ole"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("rpc"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("gdi"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("crtdll"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("mshtml"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("setupapi"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("typelib"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("shdocvw"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("combo"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("listview"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("ntdll"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("richedit"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("statusbar"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("text"));
+ Project.DebugChannels.Add(new RBuildDebugChannel("toolbar"));
+ }
+
+ if (Project.Languages.Count == 0)
+ {
+ Project.Languages.Add(new RBuildLanguage("en-us"));
+ Project.Languages.Add(new RBuildLanguage("es-es"));
+ }
+
+ m_RootTask.PreExecute();
+ m_RootTask.Execute();
+ m_RootTask.PostExecute();
+
+ SetPlatformDefaults();
+
+ //m_FileHandlers.Add(new TxtSetupFileHandler(this));
+ //m_FileHandlers.Add(new SysSetupFileHandler(this));
+ //m_FileHandlers.Add(new UnattendFileHandler(this));
+ //m_FileHandlers.Add(new DownloaderFileHandler(this));
+ //m_FileHandlers.Add(new AutorunFileHandler(this));
+ //m_FileHandlers.Add(new HiveAutoGeneratedFileHandler(this));
+ m_FileHandlers.ProcessFiles(Project.Files);
+
+ if (RunBackends)
+ Backends.Generate();
+ }
+
+ private void SetPlatformDefaults()
+ {
+ if (SetDefaults)
+ {
+ if (Project.Platform.Modules.Count == 0)
+ {
+ foreach (RBuildModule module in Project.Modules)
+ {
+ Project.Platform.Modules.Add(module);
+ }
+ }
+
+ if (Project.Languages.Count == 0)
+ {
+ foreach (RBuildLanguage language in Project.Languages)
+ {
+ Project.Platform.Languages.Add(language);
+ }
+ }
+
+ if (Project.DebugChannels.Count == 0)
+ {
+ foreach (RBuildDebugChannel channel in Project.DebugChannels)
+ {
+ Project.Platform.DebugChannels.Add(channel);
+ }
+ }
+ }
+ }
+
+ private void RegisterBackends()
+ {
+ //m_Backends.Add(new CatalogBackend(this));
+ //m_Backends.Add(new MingwBackend(this));
+ m_Backends.Add(new HtmlBackend(this));
+ //m_Backends.Add(new RGenStatBackend(this));
+ //m_Backends.Add(new BaseAddressReportBackend(this));
+ //m_Backends.Add(new BuildLogReport(this));
+ //m_Backends.Add(new ProjectTreeReport(this));
+ m_Backends.Add(new RBuildDBBackend(this));
+ //m_Backends.Add(new APIDocumentation(this));
+ }
+
+ public void CleanCustomConfigs()
+ {
+ Directory.SetCurrentDirectory (BaseDirectory);
+
+ if (File.Exists("config.rbuild"))
+ File.Delete("config.rbuild");
+
+ if (File.Exists("config-arm.rbuild"))
+ File.Delete("config-arm.rbuild");
+
+ if (File.Exists("config-ppc.rbuild"))
+ File.Delete("config-ppc.rbuild");
+ }
+
+ public BackendCollection Backends
+ {
+ get { return m_Backends; }
+ }
+
+ private void InitializeEnvironment()
+ {
+ Assembly ass = Assembly.GetExecutingAssembly();
+
+ Properties.AddReadOnly(SYSGEN_PROPERTY_FILENAME, ass.CodeBase);
+ Properties.AddReadOnly(SYSGEN_PROPERTY_VERSION, ass.GetName().Version.ToString());
+ Properties.AddReadOnly(SYSGEN_PROPERTY_LOCATION, AppDomain.CurrentDomain.BaseDirectory);
+
+ Project.Properties.AddReadOnly("CDOUTPUT", BootCDOutputDirectory + @"\reactos");
+ Project.Properties.AddReadOnly("INTERMEDIATE", IntermediateDirectory);
+ Project.Properties.AddReadOnly("SOURCECODE", BaseDirectory);
+ Project.Properties.AddReadOnly("OUTPUT", OutputDirectory);
+ Project.Properties.AddReadOnly("INSTALL", InstallDirectory);
+ Project.Properties.AddReadOnly("TEMP", TemporaryDirectory);
+ Project.Properties.AddReadOnly("DOC", DocumentationDirectory);
+ }
+
+ ///
+ /// Does Execute() and wraps in error handling and time stamping.
+ ///
+ /// Indication of success
+ public bool ReadBuildFiles()
+ {
+ //SysGenEngine.OnBuildStarted(this, new BuildEventArgs(_projectName));
+
+ bool success = true;
+ try
+ {
+ // Remember when the build was started
+ DateTime startTime = DateTime.Now;
+
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("SysGen 0.2");
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("Running on {0}", Environment.OSVersion.VersionString);
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("Buildfile: {0}", BuildFileURI.AbsolutePath);
+ BuildLog.WriteLine("Base Directory: {0}", BaseDirectory);
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("Reading rbuild files :");
+ BuildLog.WriteLine();
+
+ Execute();
+
+ TimeSpan buildTime = DateTime.Now - startTime;
+
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("{0} SysGen Module(s) detected.", Project.Modules.Count);
+ BuildLog.WriteLine("{0} Platform Module(s) detected.", Project.Platform.Modules.Count);
+ BuildLog.WriteLine();
+ BuildLog.WriteLine("SysGen COMPLETED in {0} second(s)", (int)buildTime.TotalSeconds);
+ BuildLog.WriteLine();
+
+ //SysGenEngine.OnBuildFinished(this, new BuildEventArgs(_projectName));
+
+ success = true;
+ return true;
+
+ }
+ catch (BuildException e)
+ {
+ BuildLog.WriteMessage("Build Failed" , "error");
+ BuildLog.WriteLine();
+ BuildLog.WriteLine(e.Message);
+
+ if (e.InnerException != null)
+ {
+ BuildLog.WriteLine( e.InnerException.Message);
+ }
+
+ success = false;
+ return false;
+
+ }
+ catch (Exception e)
+ {
+ //throw;
+ // all other exceptions should have been caught
+ string message = "\nINTERNAL ERROR\n" + e.ToString() + "\nPlease send bug report to nant-developers@lists.sourceforge.net";
+ BuildLog.WriteMessage(message, "error");
+ success = false;
+ return false;
+ }
+ finally
+ {
+ //SysGenEngine.OnBuildFinished(this, new BuildEventArgs(_projectName));
+ }
+ }
+
+ /// Combine with project's to form a full path to file or directory.
+ ///
+ /// If it is possible for the path to contain property macros the path call first.
+ ///
+ ///
+ /// A rooted path.
+ ///
+ /// The relative or absolute path.
+ public string GetFullPath(string path) {
+ if (path == null) {
+ return BaseDirectory;
+ }
+
+ //Docs above read we should do this. But it should be done before it gets here.
+ //path = this.ExpandProperties(path);
+
+ if (!Path.IsPathRooted(path)) {
+ path = Path.Combine(BaseDirectory, path);
+ }
+ return path;
+ }
+
+ public string GetRelativePath(string path)
+ {
+ return path.Replace(BaseDirectory +"\\" , string.Empty);
+ }
+
+ ///
+ /// Expands a string from known properties
+ ///
+ /// The string with replacement tokens
+ /// The expanded and replaced string
+ public string ExpandProperties(string input)
+ {
+ string output = input;
+ if (input != null)
+ {
+ //matches ${abc} and $(abc) style properties
+ const string pattern = @"\$\{(?([^\}]*))\}|\$\(((?[^\}]*))\)";
+ foreach (Match m in Regex.Matches(input, pattern))
+ {
+ if (m.Length > 0)
+ {
+ try
+ {
+ string token = m.ToString();
+ string propertyName = m.Groups["name"].Value;
+
+ if (Project.Properties[propertyName] != null)
+ {
+ output = output.Replace(token, Project.Properties[propertyName].Value);
+ }
+ else
+ throw new BuildException(String.Format("Property '{0}' has not been set!", propertyName));
+ }
+ catch (ArgumentException ae)
+ {
+ throw new BuildException(String.Format("Bad formed property"));
+ }
+ }
+ }
+ }
+ return output;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/SysGenPathResolver.cs b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenPathResolver.cs
new file mode 100644
index 00000000000..1c1947b6d70
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/SysGenPathResolver.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+//using SysGen.RBuild.Framework;
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine
+{
+ class SysGenPathResolver
+ {
+ //public static string GetPath(Task current)
+ //{
+ // return GetPath(current, SysGen.ProjectTask);
+ //}
+
+ public static string GetPath(Task current, Task root)
+ {
+ IElement task = current.Parent;
+ while (task != root)
+ {
+ DirectoryTask directory = task as DirectoryTask;
+
+ if (directory != null)
+ return directory.Folder.FullPath;
+
+ task = task.Parent;
+ }
+
+ return string.Empty;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/Task.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/Task.cs
new file mode 100644
index 00000000000..5bee2d549d5
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/Task.cs
@@ -0,0 +1,257 @@
+using System;
+using System.IO;
+using System.Reflection;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+
+using SysGen.BuildEngine.Log;
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Tasks;
+
+namespace SysGen.BuildEngine
+{
+ public enum TaskExecuteStage
+ {
+ PreExecute,
+ Execute,
+ PostExecute
+ }
+
+ ///
+ /// Provides the abstract base class for tasks.
+ ///
+ ///
+ /// A task is a piece of code that can be executed.
+ ///
+ public abstract class Task : Element, ITask
+ {
+ protected bool _failOnError = true;
+ protected bool _verbose = false;
+ protected bool _ifDefined = true;
+ protected bool _ifNotDefined = false;
+
+ TaskExecuteStage _stage = TaskExecuteStage.PreExecute;
+
+ ///
+ /// Determines if task failure stops the build, or is just reported. Default is "true".
+ ///
+ [TaskAttribute("failonerror")]
+ [BooleanValidator()]
+ public bool FailOnError {
+ get { return _failOnError; }
+ set { _failOnError = value; }
+ }
+
+ ///
+ /// Task reports detailed build log messages. Default is "false".
+ ///
+ [TaskAttribute("verbose")]
+ [BooleanValidator()]
+ public bool Verbose {
+ get { return (_verbose || SysGen.Verbose); }
+ set { _verbose = value; }
+ }
+
+ ///
+ /// If true then the task will be executed; otherwise skipped. Default is "true".
+ ///
+ [TaskAttribute("if")]
+ [BooleanValidator()]
+ public bool IfDefined {
+ get { return _ifDefined; }
+ set { _ifDefined = value; }
+ }
+
+ ///
+ /// Opposite of if. If false then the task will be executed; otherwise skipped. Default is "false".
+ ///
+ [TaskAttribute("ifnot")]
+ [BooleanValidator()]
+ public bool IfNotDefined
+ {
+ get { return _ifNotDefined; }
+ set { _ifNotDefined = value; }
+ }
+
+ public string XmlFile
+ {
+ get { return new Uri(_xmlNode.OwnerDocument.BaseURI).LocalPath; }
+ }
+
+ public string RBuildFile
+ {
+ get { return Path.GetFileName(XmlFile); }
+ }
+
+ /// The name of the task.
+ public override string Name {
+ get {
+ string name = null;
+ TaskNameAttribute taskName = (TaskNameAttribute) Attribute.GetCustomAttribute(GetType(), typeof(TaskNameAttribute));
+ if (taskName != null) {
+ name = taskName.Name;
+ }
+ return name;
+ }
+ }
+
+ public RBuildFolder InFolder
+ {
+ get
+ {
+ IElement task = Parent;
+ while (task != SysGen.RootTask)
+ {
+ DirectoryTask directory = task as DirectoryTask;
+
+ if (directory != null)
+ return directory.Folder;
+
+ task = task.Parent;
+ }
+
+ return SysGen.Project.Folder;
+ }
+ }
+
+ ///
+ /// The prefix used when sending messages to the log.
+ ///
+ public string LogPrefix {
+ get {
+ string prefix = "[" + Name + "] ";
+ return prefix.PadLeft(BuildLog.IndentSize);
+ }
+ }
+
+ private TaskExecuteStage ExecutionStage
+ {
+ get { return _stage; }
+ }
+
+ ///
+ /// Executes the task unless it is skipped. Do not ovveride/new this method. Use ExecuteTask instead.
+ ///
+ public void Execute()
+ {
+ RunTask(TaskExecuteStage.Execute);
+ }
+
+ public void PostExecute()
+ {
+ RunTask(TaskExecuteStage.PostExecute);
+ }
+
+ public void PreExecute()
+ {
+ RunTask(TaskExecuteStage.PreExecute);
+ }
+
+ private void RunTask (TaskExecuteStage stage)
+ {
+ // Save the current execution stage
+ _stage = stage;
+
+ if (IfDefined && !IfNotDefined)
+ {
+ try
+ {
+ SysGenEngine.OnTaskStarted(this, new BuildEventArgs(Name));
+
+ switch (stage)
+ {
+ case TaskExecuteStage.PreExecute:
+ PreExecuteTask();
+ break;
+ case TaskExecuteStage.Execute:
+ ExecuteTask();
+ break;
+ case TaskExecuteStage.PostExecute:
+ PostExecuteTask();
+ break;
+ }
+
+ if (this is ITaskContainer)
+ {
+ ITaskContainer taskContainer = this as ITaskContainer;
+
+ if (taskContainer.ExecuteChilds)
+ {
+ foreach (Task taskChild in taskContainer.ChildTasks)
+ {
+ taskChild.RunTask(stage);
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ SysGenEngine.OnTaskException(this, new BuildEventArgs(Name));
+
+ if (FailOnError)
+ {
+ throw;
+ }
+ else
+ {
+ BuildLog.WriteLine(e.Message);
+ if (e.InnerException != null)
+ {
+ BuildLog.WriteLine(e.InnerException.Message);
+ }
+ }
+ }
+ finally
+ {
+ SysGenEngine.OnTaskFinished(this, new BuildEventArgs(Name));
+ }
+ }
+ }
+
+ protected override void InitializeElement(XmlNode elementNode)
+ {
+ if (this is ITaskContainer)
+ {
+ ITaskContainer taskContainer = this as ITaskContainer;
+
+ foreach (XmlNode childNode in elementNode.ChildNodes)
+ {
+ if (SysGen.CanProcessNode(childNode))
+ SysGen.LoadChildTask(childNode, taskContainer);
+ }
+ }
+
+ // Just defer for now so that everything just works
+ InitializeTask(elementNode);
+ }
+
+ /// Initializes the task.
+ protected virtual void InitializeTask(XmlNode taskNode)
+ {
+ }
+
+ protected virtual void PostExecuteTask()
+ {
+ }
+
+ ///
+ /// Executes the task.
+ ///
+ protected virtual void ExecuteTask()
+ {
+ }
+
+ ///
+ /// Executes the task.
+ ///
+ protected virtual void PreExecuteTask()
+ {
+ }
+
+ public override string ToString()
+ {
+ return Name;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/TaskContainer.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/TaskContainer.cs
new file mode 100644
index 00000000000..2de6d0e28ca
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/Base/TaskContainer.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine
+{
+ ///
+ /// A Generic Task Container
+ ///
+ public abstract class TaskContainer : Task , ITaskContainer
+ {
+ protected bool m_ExecuteChilds = true;
+ protected TaskCollection _childTasks = new TaskCollection();
+
+ ///
+ /// Available child instances.
+ ///
+ public TaskCollection ChildTasks
+ {
+ get { return _childTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return m_ExecuteChilds; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIFallbackTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIFallbackTask.cs
new file mode 100644
index 00000000000..535407ef36f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIFallbackTask.cs
@@ -0,0 +1,11 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("fallback", Namespace = "xi")]
+ public class XIFallbackTask : TaskContainer
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIIncludeTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIIncludeTask.cs
new file mode 100644
index 00000000000..66b66c028df
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Build/XIIncludeTask.cs
@@ -0,0 +1,148 @@
+using System;
+using System.IO;
+using System.Xml;
+using System.Collections;
+using System.Collections.Specialized;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Log;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// Include an external build file.
+ ///
+ [TaskName("include", Namespace = "xi")]
+ public class XIIncludeTask : FileSystemInfoBaseTask, ITaskContainer //TaskContainer
+ {
+ private TaskCollection m_ChildTasks = new TaskCollection();
+
+ ///
+ /// Used to check for recursived includes.
+ ///
+ private static Stack _includedFiles = new Stack();
+
+ /////
+ ///// The file to be included
+ /////
+ //private string _href = null;
+
+ /// Build file to include.
+ [TaskAttribute("href", Required = true)]
+ public string BuildFileName
+ {
+ get { return m_FileSystemInfo.Name; }
+ set { m_FileSystemInfo.Name = value; }
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFile();
+ }
+
+ public TaskCollection ChildTasks
+ {
+ get { return m_ChildTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return true; }
+ }
+
+ protected override void OnInit()
+ {
+ base.OnInit();
+
+ Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ }
+
+ /// Verify parameters.
+ /// Xml taskNode used to define this task instance.
+ protected override void InitializeTask(XmlNode taskNode)
+ {
+ //base.InitializeTask(taskNode);
+
+ FailOnError = false;
+
+ /*
+ // Task can only be included as a global task.
+ // This might not be a firm requirement but you could get some real
+ // funky errors if you start including targets wily-nily.
+ if (Parent != null )
+ {
+ if ((!(Parent is RbuildTask)) || (!(Parent is ProjectTask)))
+ throw new BuildException("Task not allowed in targets. Must be at project level.", Location);
+ }
+ */
+
+ // Check for recursive include.
+ string buildFileName = Path.Combine(BaseBuildLocation, BuildFileName);
+ foreach (string currentFileName in _includedFiles) {
+ if (currentFileName == buildFileName) {
+ throw new BuildException("Recursive includes are not allowed.", Location);
+ }
+ }
+
+ string includedFileName = Path.Combine(BaseBuildLocation , BuildFileName);
+ string includeRelative = SysGen.GetRelativePath(includedFileName);
+
+ // push ourselves onto the stack (prevents recursive includes)
+ _includedFiles.Push(includedFileName);
+
+ BuildLog.WriteLine("Including {0}", includeRelative);
+
+ try
+ {
+ XmlDocument doc = new XmlDocument();
+ doc.XmlResolver = null;
+ doc.Load(includedFileName);
+
+ SysGen.InitializeBuildFile(doc, this);
+
+ SysGen.BuildFiles.Add(includedFileName);
+ }
+ catch (BuildException)
+ {
+ throw;
+ }
+ catch (IOException e)
+ {
+ try
+ {
+ if (ChildTasks.Count == 0)
+ throw new BuildException("Could not include build file " + includedFileName, Location, e);
+
+ BuildLog.WriteLine("Including {0} Failed. Fallback present and executed", includeRelative);
+ //BuildLog.WriteLine("Include {0} not found. Fallback executed", includeRelative);
+ }
+ catch (Exception fallbackException)
+ {
+ throw new BuildException("Could not include build file " + includedFileName + " fallback also failed", Location, fallbackException);
+ }
+ }
+ catch (ArgumentException e)
+ {
+ //Puede pasar
+ }
+ catch (Exception e)
+ {
+ throw new BuildException("Could not include build file " + includedFileName + " " + e.Message, Location, e);
+ }
+ finally
+ {
+ // pop off the stack
+ _includedFiles.Pop();
+ }
+ }
+
+ protected override void ExecuteTask()
+ {
+ }
+
+ protected override void PreExecuteTask()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfNotTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfNotTask.cs
new file mode 100644
index 00000000000..b1530a34756
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfNotTask.cs
@@ -0,0 +1,49 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Specialized;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Log;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// The opposite of the if task.
+ ///
+ ///
+ /// Check existence of a property
+ ///
+ ///
+ ///
+ ///
+ /// ]]>
+ ///
+ /// Check that a property value is not true
+ ///
+ ///
+ ///
+ ///
+ /// ]]>
+ ///
+ ///
+ ///
+ /// Check that a target does not exist
+ ///
+ ///
+ ///
+ ///
+ /// ]]>
+ ///
+ [TaskName("ifnot")]
+ public class IfNotTask : IfTask
+ {
+ protected override bool ConditionsTrue
+ {
+ get { return !base.ConditionsTrue; }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfTask.cs
new file mode 100644
index 00000000000..a9bff9a22e6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/BuiltIn/Logic/IfTask.cs
@@ -0,0 +1,134 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Collections.Specialized;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.BuildEngine.Log;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("if")]
+ public class IfTask : TaskContainer
+ {
+ protected string _propName = null;
+ protected string _propValue = null;
+ protected string _propNameTrue = null;
+ protected string _propNameExists = null;
+
+ ///
+ /// Used to test whether a property is true.
+ ///
+ [TaskAttribute("propertytrue")]
+ public string PropertyNameTrue {
+ set {_propNameTrue = value;}
+ }
+
+ ///
+ /// Used to test whether a property exists.
+ ///
+ [TaskAttribute("propertyexists")]
+ public string PropertyNameExists {
+ set {_propNameExists = value;}
+ }
+
+ ///
+ /// Used to test whether a property exists.
+ ///
+ [TaskAttribute("property")]
+ public string PropertyName
+ {
+ set { _propName = value; }
+ }
+
+ ///
+ /// Used to test whether a property exists.
+ ///
+ [TaskAttribute("value")]
+ public string PropertyValue
+ {
+ set { _propValue = value; }
+ }
+
+ protected override void PreExecuteTask()
+ {
+ if (!ConditionsTrue)
+ {
+ m_ExecuteChilds = false;
+ }
+ }
+
+ /*
+ protected override void ExecuteTask() {
+ if(!ConditionsTrue) {
+ m_ExecuteChilds = false;
+ }
+ }*/
+
+ protected virtual bool ConditionsTrue
+ {
+ get
+ {
+ bool ret = true;
+
+ if (_propName != null)
+ {
+ if (_propValue != null)
+ {
+ if (SysGen.Project.Properties.PropertyExists(_propName))
+ {
+ return (SysGen.Project.Properties[_propName].Value == _propValue);
+ }
+
+ return false;
+ }
+ else
+ {
+ ret = ret && SysGen.Project.Properties.PropertyExists(_propNameExists);
+ }
+ }
+
+ ////check for target
+ //if(_targetName != null) {
+ // ret = ret && (SysGen.Targets.Find(_targetName) != null);
+ // if (!ret) return false;
+ //}
+
+ //Check for the Property value of true.
+ if (_propNameTrue != null)
+ {
+ try
+ {
+ ret = ret && bool.Parse(SysGen.Project.Properties[_propNameTrue].Value);
+ }
+ catch (Exception e)
+ {
+ throw new BuildException("Property True test failed for '" + _propNameTrue + "'", Location, e);
+ }
+ }
+
+ //Check for Property existence
+ if(_propNameExists != null)
+ {
+ ret = ret && SysGen.Project.Properties.PropertyExists(_propNameExists);
+ }
+
+ ////check for uptodate file
+ //if(_uptodateFile != null) {
+ // FileInfo primaryFile = new FileInfo(_uptodateFile);
+ // if(primaryFile == null) {
+ // ret = true;
+ // }
+ // else {
+ // string newerFile = FileSet.FindMoreRecentLastWriteTime(_compareFiles.FileNames, primaryFile.LastWriteTime);
+ // bool bNeedsAnUpdate = (null == newerFile);
+ // BuildLog.WriteLineIf(SysGen.Verbose && bNeedsAnUpdate, "{0) is newer than {1}" , newerFile, primaryFile.Name);
+ // ret = !bNeedsAnUpdate;
+ // }
+ //}
+
+ return ret;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoFilesTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoFilesTask.cs
new file mode 100644
index 00000000000..6e74be382a7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoFilesTask.cs
@@ -0,0 +1,63 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class AutoFilesBaseTask : AutoResolvableFileSystemInfoBaseTask
+ {
+ private string m_Pattern = "*.*";
+
+ public AutoFilesBaseTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFolder();
+ }
+
+ public RBuildFolder Folder
+ {
+ get { return m_FileSystemInfo as RBuildFolder; }
+ }
+
+ [TaskAttribute("pattern")]
+ public string Pattern { get { return m_Pattern; } set { m_Pattern = value; } }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ foreach(string file in Directory.GetFiles (SysGen.ResolveRBuildFolderPath(Folder) , Pattern))
+ {
+ AddFile(file);
+ }
+ }
+
+ protected abstract void AddFile (string file);
+ }
+
+ [TaskName("autoinstallfiles")]
+ public class AutoInstallFiles : AutoFilesBaseTask
+ {
+ private string m_InstallBase = ".";
+
+ [TaskAttribute("installbase")]
+ public string InstallBase { get { return m_InstallBase; } set { m_InstallBase = value; } }
+
+ protected override void AddFile(string file)
+ {
+ RBuildInstallFile autoFile = new RBuildInstallFile();
+
+ autoFile.Root = Root;
+ autoFile.Base = Folder.Base;
+ autoFile.Name = Path.GetFileName(file);
+ autoFile.InstallBase = InstallBase;
+
+ RBuildElement.Files.Add(autoFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoInstallFilesTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoInstallFilesTask.cs
new file mode 100644
index 00000000000..9548900348d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoInstallFilesTask.cs
@@ -0,0 +1,15 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ //[TaskName("autoinstallfiles")]
+ //public class AutoInstallFilesTask : AutoFilesTask
+ //{
+ // protected override void ExecuteTask()
+ // {
+ // }
+ //}
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoManifest.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoManifest.cs
new file mode 100644
index 00000000000..866d06eb058
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoManifest.cs
@@ -0,0 +1,15 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("automanifest")]
+ public class AutoManifest : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoRegisterTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoRegisterTask.cs
new file mode 100644
index 00000000000..045fdb851ac
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoRegisterTask.cs
@@ -0,0 +1,33 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("autoregister")]
+ public class AutoRegisterTask : Task
+ {
+ RBuildAutoRegister m_AutoRegister = new RBuildAutoRegister();
+
+ [TaskAttribute("type", Required = true)]
+ public AutoRegisterType Type { get { return m_AutoRegister.Type; } set { m_AutoRegister.Type = value; } }
+
+ [TaskAttribute("infsection", Required = true)]
+ public string InfSection { get { return m_AutoRegister.InfSection; } set { m_AutoRegister.InfSection = value; } }
+
+ protected override void ExecuteTask()
+ {
+ if ((Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32OCX))
+ {
+ if (Module.AutoRegister != null)
+ throw new BuildException("There can be only one element for a module", Location);
+
+ Module.AutoRegister = m_AutoRegister;
+ }
+ else
+ throw new BuildException(" is not applicable for this module type", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoResource.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoResource.cs
new file mode 100644
index 00000000000..359132395d1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/AutoResource.cs
@@ -0,0 +1,15 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ //[TaskName("autoresource")]
+ //public class AutoResourceTask : AutoFilesTask
+ //{
+ // protected override void ExecuteTask()
+ // {
+ // }
+ //}
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AuthorBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AuthorBaseTask.cs
new file mode 100644
index 00000000000..a12ea2f5202
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AuthorBaseTask.cs
@@ -0,0 +1,26 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class AuthorBaseTask : Task
+ {
+ protected string m_Alias = null;
+ protected RBuildAuthor m_Author = new RBuildAuthor();
+
+ [TaskValue(Required=true)]
+ public virtual string Alias { get { return m_Alias; } set { m_Alias = value; } }
+
+ protected override void ExecuteTask()
+ {
+ m_Author.Contributor = Project.Contributors.GetByName(Alias);
+
+ if (m_Author.Contributor == null)
+ throw new BuildException(string.Format("Could not resolve contributor '{0}' referenced by module '{1}'", Alias, Module.Name, Location));
+
+ Module.Authors.Add(m_Author);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AutoFilesTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AutoFilesTask.cs
new file mode 100644
index 00000000000..7a4dc70523b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/AutoFilesTask.cs
@@ -0,0 +1,19 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ //public abstract class AutoFilesTask : Task
+ //{
+ // FileSet files = new FileSet();
+
+ // [FileSet("files")]
+ // public FileSet Files
+ // {
+ // get { return files; }
+ // set { files = value; }
+ // }
+ //}
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/CDFileBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/CDFileBaseTask.cs
new file mode 100644
index 00000000000..869df983965
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/CDFileBaseTask.cs
@@ -0,0 +1,42 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class CDFileBaseTask : FileBaseTask //PlatformFileBaseTask
+ {
+ public CDFileBaseTask()
+ {
+ }
+
+ [TaskAttribute("installbase")]
+ public string InstallBase { get { return CDFile.InstallBase; } set { CDFile.InstallBase = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildCDFile();
+ }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("nameoncd")]
+ public string NameOnCD { get { return CDFile.NewName; } set { CDFile.NewName = value; } }
+
+ private RBuildCDFileBase CDFile
+ {
+ get { return m_FileSystemInfo as RBuildCDFileBase; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the file
+ RBuildElement.Files.Add(CDFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileBaseTask.cs
new file mode 100644
index 00000000000..67773a31bed
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileBaseTask.cs
@@ -0,0 +1,47 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class FileBaseTask : FileSystemInfoBaseTask
+ {
+ public FileBaseTask()
+ {
+ }
+
+ ///
+ /// The define value.
+ ///
+ [TaskValue]
+ public virtual string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ /////
+ ///// Get the underlying .
+ /////
+ //public RBuildPlatformFile PlatformFile
+ //{
+ // get { return m_FileSystemInfo as RBuildPlatformFile; }
+ //}
+
+ //public override string BasePath
+ //{
+ // get
+ // {
+ // IElement task = this;
+ // while (task != SysGen.ProjectTask)
+ // {
+ // if (task is IDirectory)
+ // return ((IDirectory)task).BasePath;
+
+ // task = task.Parent;
+ // }
+
+ // //Is in the root
+ // return string.Empty;
+ // }
+ //}
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileSystemInfoBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileSystemInfoBaseTask.cs
new file mode 100644
index 00000000000..3046065d483
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FileSystemInfoBaseTask.cs
@@ -0,0 +1,119 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class AutoResolvableFileSystemInfoBaseTask : FileSystemInfoBaseTask
+ {
+ protected override bool TryToResolveBasePath()
+ {
+ if (Base == "eventlog_server")
+ {
+ int i = 10;
+ }
+
+ if ((Base != null) && (Base != string.Empty))
+ {
+ if (Base != Project.Name)
+ {
+ // Get the referenced module
+ RBuildModule module = Project.Modules.GetByName(Base);
+
+ if (module == null)
+ throw new BuildException(string.Format("Could not resolve module base '{0}' for module '{1}'", Base, Module.Name, Location));
+
+ // If no path has been specified by the user
+ // set the module default path
+ if (Root == PathRoot.Default)
+ Root = module.IncludeDefaultRoot;
+
+ // Set the base to the module root
+ m_FileSystemInfo.Base = module.Folder.FullPath;
+ }
+ else
+ {
+ // Set the base to the project root
+ m_FileSystemInfo.Base = Project.Base;
+ }
+ }
+ else
+ {
+ // Set the base to the folder containing the module
+ m_FileSystemInfo.Base = InFolder.FullPath;
+ }
+
+ if (m_FileSystemInfo.Base == null || m_FileSystemInfo.Name == null)
+ {
+ int i = 10;
+ }
+
+ return true;
+ }
+ }
+
+ public abstract class FileSystemInfoBaseTask : Task
+ {
+ protected RBuildFileSystemInfo m_FileSystemInfo = null;
+
+ public FileSystemInfoBaseTask()
+ {
+ CreateFileSystemObject();
+ }
+
+ protected abstract void CreateFileSystemObject();
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("base")]
+ public string Base { get { return m_FileSystemInfo.Base; } set { m_FileSystemInfo.Base = value; } }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("root")]
+ public PathRoot Root { get { return m_FileSystemInfo.Root; } set { m_FileSystemInfo.Root = value; } }
+
+ ///
+ /// Get the underlying .
+ ///
+ public RBuildFileSystemInfo FileSystemInfo
+ {
+ get { return m_FileSystemInfo; }
+ }
+
+ protected virtual void SetRBuildElement()
+ {
+ //m_FileSystemInfo.Element = RBuildElement;
+ }
+
+ protected virtual void SetRootFromParent()
+ {
+ }
+
+ protected virtual bool TryToResolveBasePath ()
+ {
+ return false;
+ }
+
+ protected override void PreExecuteTask()
+ {
+ SetRootFromParent();
+ SetRBuildElement();
+ }
+
+ protected override void ExecuteTask()
+ {
+ // Give the oportunity to subclasses to resolve the path
+ if (!TryToResolveBasePath())
+ {
+ // If no base path has been specified default to current
+ if (string.IsNullOrEmpty(Base))
+ Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FolderBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FolderBaseTask.cs
new file mode 100644
index 00000000000..c17c86473f2
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/FolderBaseTask.cs
@@ -0,0 +1,15 @@
+//using System;
+
+//using SysGen.BuildEngine.Attributes;
+//using SysGen.RBuild.Framework;
+
+//namespace SysGen.BuildEngine.Tasks
+//{
+// public abstract class FolderBaseTask : Task
+// {
+// protected override void CreateFileSystemObject()
+// {
+// m_FileSystemInfo = new RBuildFolder();
+// }
+// }
+//}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PlatformFileBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PlatformFileBaseTask.cs
new file mode 100644
index 00000000000..2bfa1c70702
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PlatformFileBaseTask.cs
@@ -0,0 +1,37 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class PlatformFileBaseTask : FileBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue]
+ public string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ [TaskAttribute("installbase")]
+ public string InstallBase { get { return PlatformFile.InstallBase; } set { PlatformFile.InstallBase = value; } }
+
+ ///
+ /// Get the underlying .
+ ///
+ public RBuildPlatformFile PlatformFile
+ {
+ get { return m_FileSystemInfo as RBuildPlatformFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the file
+ RBuildElement.Files.Add(PlatformFile);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PropertyBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PropertyBaseTask.cs
new file mode 100644
index 00000000000..cc9e8fd8c55
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/PropertyBaseTask.cs
@@ -0,0 +1,38 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class PropertyBaseTask : Task
+ {
+ protected string m_Name = null;
+ protected string m_Value = String.Empty;
+ protected bool m_ReadOnly = false;
+ protected bool m_Internal = false;
+
+ /// the name of the property to set.
+ [TaskAttribute("name", Required=true)]
+ public string PropName { get { return m_Name; } set { m_Name = value; } }
+
+ /// the value of the property.
+ [TaskAttribute("value", Required=true)]
+ public string Value { get { return m_Value; } set { m_Value = value; } }
+
+ /// the value of the property.
+ [TaskAttribute("readonly")]
+ [BooleanValidator()]
+ public bool ReadOnly { get { return m_ReadOnly; } set { m_ReadOnly = value; } }
+
+ [TaskAttribute("internal")]
+ [BooleanValidator()]
+ public bool Internal { get { return m_Internal; } set { m_Internal = value; } }
+
+ protected override void OnLoad()
+ {
+ Project.Properties.Add(new RBuildProperty(m_Name, m_Value, m_ReadOnly, m_Internal));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/RbuildElementBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/RbuildElementBaseTask.cs
new file mode 100644
index 00000000000..7afe7a5f9ab
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/RbuildElementBaseTask.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class RbuildElementBaseTask : Task
+ {
+ protected override void OnLoad()
+ {
+
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/ValueBaseTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/ValueBaseTask.cs
new file mode 100644
index 00000000000..ae1c1137c7f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Base/ValueBaseTask.cs
@@ -0,0 +1,16 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ public abstract class ValueBaseTask : Task
+ {
+ protected string _value = null;
+
+ ///
+ /// The define value.
+ ///
+ [TaskValue]
+ public virtual string Value { get { return _value; } set { _value = value; } }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BaseAdressTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BaseAdressTask.cs
new file mode 100644
index 00000000000..39ea6a8c071
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BaseAdressTask.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("baseadress")]
+ public class BaseAdressTask : PropertyBaseTask
+ {
+ protected override void OnLoad()
+ {
+ Project.Properties.Add(new RBuildBaseAdress(m_Name, m_Value));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootSector.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootSector.cs
new file mode 100644
index 00000000000..05ce34d2b35
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootSector.cs
@@ -0,0 +1,44 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("bootsector")]
+ public class BootSector : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule bootModule = Project.Modules.GetByName(Value);
+
+ if (bootModule != null)
+ {
+ if (bootModule.Type == ModuleType.BootSector)
+ {
+ if (Module.Type == ModuleType.Iso ||
+ Module.Type == ModuleType.IsoRegTest ||
+ Module.Type == ModuleType.LiveIso ||
+ Module.Type == ModuleType.LiveIsoRegTest)
+ {
+ if (Module.BootSector == null)
+ Module.BootSector = bootModule;
+ }
+ else
+ throw new BuildException(" is not applicable for this module type.", Location);
+ }
+ else
+ throw new BuildException(" for module '{0}' is referencing a non BootSector module '{1}'",
+ Module.Name,
+ bootModule.Name,
+ Location);
+ }
+ else
+ throw new BuildException(" for module '{0}' is referencing a non existing module '{1}'",
+ Module.Name,
+ Value,
+ Location);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapFileTask.cs
new file mode 100644
index 00000000000..7d68ee9fc99
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapFileTask.cs
@@ -0,0 +1,40 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("bootstrapfile")]
+ public class BootstrapFileTask : CDFileBaseTask //FileBaseTask ///PlatformFileBaseTask
+ {
+ public BootstrapFileTask()
+ {
+ }
+
+ [TaskValue]
+ public string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildBootstrapFile();
+ }
+
+ public RBuildBootstrapFile BootStrapFile
+ {
+ get { return m_FileSystemInfo as RBuildBootstrapFile; }
+ }
+
+ protected override bool TryToResolveBasePath()
+ {
+ Base = "i386";
+ return true;
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapTask.cs
new file mode 100644
index 00000000000..a3713de30bf
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BootstrapTask.cs
@@ -0,0 +1,52 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("bootstrap")]
+ public class BootstrapTask : CDFileBaseTask
+ {
+ public BootstrapTask()
+ {
+ m_FileSystemInfo = new RBuildBootstrapFile();
+ }
+
+ private RBuildBootstrapFile BootstrapFile
+ {
+ get { return m_FileSystemInfo as RBuildBootstrapFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ if ((Module.Type == ModuleType.Kernel) ||
+ (Module.Type == ModuleType.KernelModeDLL) ||
+ (Module.Type == ModuleType.KeyboardLayout) ||
+ (Module.Type == ModuleType.KernelModeDriver) ||
+ (Module.Type == ModuleType.NativeDLL) ||
+ (Module.Type == ModuleType.NativeCUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32SCR) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.BootSector) ||
+ (Module.Type == ModuleType.BootLoader) ||
+ (Module.Type == ModuleType.BootProgram) ||
+ (Module.Type == ModuleType.Cabinet))
+ {
+ BootstrapFile.Element = RBuildElement;
+ BootstrapFile.Name = Module.TargetName;
+ BootstrapFile.Root = Module.TargetDefaultRoot;
+ BootstrapFile.Base = Module.Folder.FullPath;
+
+ Module.Bootstrap = BootstrapFile;
+
+ //Project.Files.Add(BootstrapFile);
+ }
+ else
+ throw new BuildException(" is not applicable for this module type.", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BuildFamilyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BuildFamilyTask.cs
new file mode 100644
index 00000000000..29d2ead87aa
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/BuildFamilyTask.cs
@@ -0,0 +1,27 @@
+using System;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// Just a task container
+ ///
+ [TaskName("buildfamily")]
+ public class BuildFamilyTask : Task
+ {
+ private RBuildBuildFamily m_BuildFamily = new RBuildBuildFamily();
+
+ [TaskAttribute("name", Required = true)]
+ public string FamilyName { get { return m_BuildFamily.Name; } set { m_BuildFamily.Name = value; } }
+
+ [TaskAttribute("description")]
+ public string FamilyDescription { get { return m_BuildFamily.Description; } set { m_BuildFamily.Description = value; } }
+
+ protected override void PreExecuteTask()
+ {
+ Project.BuildFamilies.Add(m_BuildFamily);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CDFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CDFileTask.cs
new file mode 100644
index 00000000000..6f9b6bcf13a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CDFileTask.cs
@@ -0,0 +1,20 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("cdfile")]
+ public class CDFileTask : CDFileBaseTask
+ {
+ public CDFileTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildCDFile();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilationUnitTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilationUnitTask.cs
new file mode 100644
index 00000000000..d08a5005ed7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilationUnitTask.cs
@@ -0,0 +1,58 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("compilationunit")]
+ public class CompilationUnitTask : FileSystemInfoBaseTask, ITaskContainer, IRBuildSourceFilesContainer
+ {
+ private TaskCollection m_ChildTasks = new TaskCollection();
+
+ public CompilationUnitTask()
+ {
+ Root = PathRoot.Intermediate;
+ }
+
+ public TaskCollection ChildTasks
+ {
+ get { return m_ChildTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return true; }
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildCompilationUnitFile();
+ }
+
+ public RBuildCompilationUnitFile CompilationUnit
+ {
+ get { return m_FileSystemInfo as RBuildCompilationUnitFile; }
+ }
+
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return CompilationUnit.SourceFiles; }
+ }
+
+ ///
+ /// The name of the compilation unit to set.
+ ///
+ [TaskAttribute("name")]
+ public string FileName { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ // Add the compilation unit to the current module
+ Module.CompilationUnits.Add(CompilationUnit);
+ }
+
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilerFlagTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilerFlagTask.cs
new file mode 100644
index 00000000000..87eb278d232
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/CompilerFlagTask.cs
@@ -0,0 +1,14 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("compilerflag")]
+ public class CompilerFlagTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildElement.CompilerFlags.Add(Value);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ComponentTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ComponentTask.cs
new file mode 100644
index 00000000000..7063b105a2d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ComponentTask.cs
@@ -0,0 +1,12 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("component")]
+ public class ComponentTask : Task
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ContributorTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ContributorTask.cs
new file mode 100644
index 00000000000..a6528adddea
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ContributorTask.cs
@@ -0,0 +1,42 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("contributor")]
+ public class ContributorTask : Task
+ {
+ private RBuildContributor m_Contributor = new RBuildContributor();
+
+ [TaskAttribute("firstname", Required = true)]
+ public string FirstName { get { return m_Contributor.FirstName; } set { m_Contributor.FirstName = value; } }
+
+ [TaskAttribute("city")]
+ public string City { get { return m_Contributor.City; } set { m_Contributor.City = value; } }
+
+ [TaskAttribute("country")]
+ public string Country { get { return m_Contributor.Country; } set { m_Contributor.Country = value; } }
+
+ [TaskAttribute("lastname")]
+ public string LastName { get { return m_Contributor.LastName; } set { m_Contributor.LastName = value; } }
+
+ [TaskAttribute("alias")]
+ public string Alias { get { return m_Contributor.Alias; } set { m_Contributor.Alias = value; } }
+
+ [TaskAttribute("mail")]
+ public string Mail { get { return m_Contributor.Mail; } set { m_Contributor.Mail = value; } }
+
+ [TaskAttribute("website")]
+ public string Website { get { return m_Contributor.Website; } set { m_Contributor.Website = value; } }
+
+ [TaskAttribute("active")]
+ public bool Active { get { return m_Contributor.Active; } set { m_Contributor.Active = value; } }
+
+ protected override void ExecuteTask()
+ {
+ Project.Contributors.Add(m_Contributor);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DebugChannelTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DebugChannelTask.cs
new file mode 100644
index 00000000000..886d0489155
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DebugChannelTask.cs
@@ -0,0 +1,54 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("debugchannel")]
+ public class DebugChannelTask : Task
+ {
+ RBuildDebugChannel m_DebugChannel = new RBuildDebugChannel();
+
+ [TaskAttribute("name")]
+ [TaskValue]
+ public string ChannelName
+ {
+ get { return m_DebugChannel.Name; }
+ set { m_DebugChannel.Name = value; }
+ }
+
+ [TaskAttribute("warning")]
+ public bool Warning
+ {
+ get { return m_DebugChannel.Warn; }
+ set { m_DebugChannel.Warn = value; }
+ }
+
+ [TaskAttribute("trace")]
+ public bool Trace
+ {
+ get { return m_DebugChannel.Trace; }
+ set { m_DebugChannel.Trace = value; }
+ }
+
+ [TaskAttribute("fixme")]
+ public bool Fixme
+ {
+ get { return m_DebugChannel.Fixme; }
+ set { m_DebugChannel.Fixme = value; }
+ }
+
+ [TaskAttribute("error")]
+ public bool Error
+ {
+ get { return m_DebugChannel.Error; }
+ set { m_DebugChannel.Error = value; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ Project.DebugChannels.Add(m_DebugChannel);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DefineTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DefineTask.cs
new file mode 100644
index 00000000000..071ff49d50f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DefineTask.cs
@@ -0,0 +1,45 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("define")]
+ public class DefineTask : Task
+ {
+ private string _name = null;
+ private string _value = String.Empty;
+ private string _backend = String.Empty;
+ private bool _empty = false;
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("name", Required=true)]
+ public string DefineName { get { return _name; } set { _name = value; } }
+
+ ///
+ /// The define value.
+ ///
+ [TaskAttribute("value")]
+ [TaskValue]
+ public string DefineValue { get { return _value; } set { _value = value; } }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("empty")]
+ [BooleanValidator]
+ public bool Empty { get { return _empty; } set { _empty = value; } }
+
+ // TODO : Remove ?
+ [TaskAttribute("backend")]
+ public string Backend { get { return _backend; } set { _backend = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildElement.Defines.Add(new RBuildDefine(DefineName, DefineValue));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DependencyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DependencyTask.cs
new file mode 100644
index 00000000000..d9a90606f42
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DependencyTask.cs
@@ -0,0 +1,27 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("dependency")]
+ public class DependencyTask : ValueBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue(Required = true)]
+ public virtual string Value { get { return _value; } set { _value = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule dependency = Project.Modules.GetByName(Value);
+
+ if (dependency == null)
+ throw new BuildException("Unknown dependency '{0}' referenced by module '{1}'", Value, Module.Name);
+
+ Module.Dependencies.Add(dependency);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DeveloperTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DeveloperTask.cs
new file mode 100644
index 00000000000..1c2a6a4fe61
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DeveloperTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("developer")]
+ public class DeveloperTask : AuthorBaseTask
+ {
+ public DeveloperTask()
+ {
+ m_Author.Role = AuthorRole.Developer;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DirectoryTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DirectoryTask.cs
new file mode 100644
index 00000000000..efc632767c8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/DirectoryTask.cs
@@ -0,0 +1,59 @@
+using System.IO;
+using System.Collections.Generic;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("directory")]
+ public class DirectoryTask : FileSystemInfoBaseTask, ITaskContainer//, IDirectory
+ {
+ private TaskCollection m_ChildTasks = new TaskCollection();
+
+ public DirectoryTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFolder();
+ }
+
+ public TaskCollection ChildTasks
+ {
+ get { return m_ChildTasks; }
+ }
+
+ public bool ExecuteChilds
+ {
+ get { return true; }
+ }
+
+ ///
+ /// The directory name.
+ ///
+ [TaskAttribute("name", Required = true)]
+ public virtual string Name { get { return m_FileSystemInfo.Name; } set { m_FileSystemInfo.Name = value; } }
+
+ public RBuildFolder Folder
+ {
+ get { return m_FileSystemInfo as RBuildFolder; }
+ }
+
+ protected override void OnInit()
+ {
+ base.OnInit();
+
+ Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ if (RBuildElement.Folders.Contains(Folder) == false)
+ RBuildElement.Folders.Add(Folder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FamilyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FamilyTask.cs
new file mode 100644
index 00000000000..6051c9b52c8
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FamilyTask.cs
@@ -0,0 +1,28 @@
+using System;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("family")]
+ public class FamilyTask : Task
+ {
+ private RBuildFamily m_Family = new RBuildFamily();
+
+ [TaskValue(Required = true)]
+ public string FamilyName { get { return m_Family.Name; } set { m_Family.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildBuildFamily buildFamily = Project.BuildFamilies.GetByName(FamilyName);
+
+ if (buildFamily == null)
+ throw new BuildException("Module '{0}' references a no existant family '{1}'",
+ Module.Name,
+ FamilyName);
+
+ Module.Families.Add(m_Family);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FileTask.cs
new file mode 100644
index 00000000000..0b3e3af243d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/FileTask.cs
@@ -0,0 +1,50 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("file")]
+ public class FileTask : FileBaseTask
+ {
+ public FileTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildSourceFile();
+ }
+
+ [TaskAttribute("switches")]
+ public string Switches { get { return SourceFile.Switches; } set { SourceFile.Switches = value; } }
+
+ [TaskAttribute("first")]
+ [BooleanValidator]
+ public bool First { get { return SourceFile.First; } set { SourceFile.First = value; } }
+
+ ///
+ /// Set the root to the same as the containing folder
+ ///
+ protected override void SetRootFromParent()
+ {
+ Root = InFolder.Root;
+ }
+
+ public RBuildSourceFile SourceFile
+ {
+ get { return m_FileSystemInfo as RBuildSourceFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the file
+ Module.SourceFiles.Add(SourceFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/GroupTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/GroupTask.cs
new file mode 100644
index 00000000000..f98029aa1fd
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/GroupTask.cs
@@ -0,0 +1,13 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// Just a simple task container
+ ///
+ [TaskName("group")]
+ public class GroupTask : TaskContainer
+ {
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ImportLibraryTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ImportLibraryTask.cs
new file mode 100644
index 00000000000..31e212c0a7a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ImportLibraryTask.cs
@@ -0,0 +1,50 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("importlibrary")]
+ public class ImportLibraryTask : AutoResolvableFileSystemInfoBaseTask //FileBaseTask
+ {
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildImportLibrary();
+ }
+
+ public RBuildImportLibrary ImportLibrary
+ {
+ get { return m_FileSystemInfo as RBuildImportLibrary; }
+ }
+
+ ///
+ /// The directory name.
+ ///
+ [TaskAttribute("dllname")]
+ public string DllName { get { return ImportLibrary.DllName; } set { ImportLibrary.DllName = value; } }
+
+ ///
+ /// The directory name.
+ ///
+ [TaskAttribute("definition", Required = true)]
+ public string Definition { get { return ImportLibrary.Name; } set { ImportLibrary.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ //Hack::
+ if (ImportLibrary.IsSpecFile)
+ ImportLibrary.Root = PathRoot.Intermediate;
+
+ if ((DllName == null) && (Module.Type == ModuleType.StaticLibrary))
+ throw new BuildException(" dllname attribute is required.", Location);
+
+ if (Module.ImportLibrary != null)
+ throw new BuildException("Only one is allowed per module.", Location);
+
+ Module.ImportLibrary = ImportLibrary;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/IncludeTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/IncludeTask.cs
new file mode 100644
index 00000000000..b923ecf157b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/IncludeTask.cs
@@ -0,0 +1,42 @@
+using System;
+using System.IO;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("include")]
+ public class IncludeTask : AutoResolvableFileSystemInfoBaseTask //FileSystemInfoBaseTask
+ {
+ public IncludeTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFolder();
+ }
+
+ [TaskValue]
+ public virtual string IncludePath
+ {
+ get { return m_FileSystemInfo.Name; }
+ set { m_FileSystemInfo.Name = value; }
+ }
+
+ public RBuildFolder IncludeFolder
+ {
+ get { return m_FileSystemInfo as RBuildFolder; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add include folder...
+ RBuildElement.IncludeFolders.Add(IncludeFolder);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstalFolder.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstalFolder.cs
new file mode 100644
index 00000000000..f395b8efda9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstalFolder.cs
@@ -0,0 +1,31 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installfolder")]
+ public class InstalFolder : Task
+ {
+ RBuildInstallFolder m_InstallFolder = new RBuildInstallFolder();
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("id")]
+ public string ID { get { return m_InstallFolder.ID; } set { m_InstallFolder.ID = value; } }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("name")]
+ [TaskValue(Required = true)]
+ public string Name { get { return m_InstallFolder.Name; } set { m_InstallFolder.Name = value; } }
+
+ protected override void ExecuteTask()
+ {
+ Project.InstallFolders.Add(m_InstallFolder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallComponent.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallComponent.cs
new file mode 100644
index 00000000000..36fc4567114
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallComponent.cs
@@ -0,0 +1,39 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installcomponent")]
+ public class InstallComponent : FileBaseTask
+ {
+ public InstallComponent()
+ {
+ }
+
+ [TaskAttribute("section")]
+ public string InstallSection { get { return InstallComponentFile.InstallSection; } set { InstallComponentFile.InstallSection = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildInfInstallerFile();
+ }
+
+ public RBuildInfInstallerFile InstallComponentFile
+ {
+ get { return m_FileSystemInfo as RBuildInfInstallerFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ if (Module.LinkerScript != null)
+ throw new BuildException("Only one is allowed per module", Location);
+
+ //Module.InfInstall = InstallComponentFile;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallFileTask.cs
new file mode 100644
index 00000000000..ec7bb2a3154
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallFileTask.cs
@@ -0,0 +1,31 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installfile")]
+ public class InstallFileTask : PlatformFileBaseTask
+ {
+ public InstallFileTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildInstallFile();
+ }
+
+ ///
+ /// The name of the define to set.
+ ///
+ [TaskAttribute("newname")]
+ public string NewName { get { return InstallFile.NewName; } set { InstallFile.NewName = value; } }
+
+ private RBuildInstallFile InstallFile
+ {
+ get { return m_FileSystemInfo as RBuildInstallFile; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallWallPaperFileTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallWallPaperFileTask.cs
new file mode 100644
index 00000000000..d8e8e4a774f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/InstallWallPaperFileTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("installwallpaperfile")]
+ public class InstallWallPaperFileTask : PlatformFileBaseTask
+ {
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildInstallWallpaperFile();
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LanguageTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LanguageTask.cs
new file mode 100644
index 00000000000..4acf0a8788c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LanguageTask.cs
@@ -0,0 +1,24 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("language")]
+ public class LanguageTask : Task
+ {
+ RBuildLanguage m_Language = new RBuildLanguage();
+
+ [TaskAttribute("isoname")]
+ public string IsoName { get { return m_Language.Name; } set { m_Language.Name = value; } }
+
+ [TaskAttribute("lcid")]
+ public string LCID { get { return m_Language.LCID; } set { m_Language.LCID = value; } }
+
+ protected override void ExecuteTask()
+ {
+ Project.Languages.Add(m_Language);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LibraryTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LibraryTask.cs
new file mode 100644
index 00000000000..79c3f159b1a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LibraryTask.cs
@@ -0,0 +1,51 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("library")]
+ public class LibraryTask : ValueBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue(Required=true)]
+ public override string Value { get { return _value; } set { _value = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule libModule = Project.Modules.GetByName(Value);
+
+ if (libModule == null)
+ throw new BuildException("Unknown library dependency '{0}' referenced by module '{1}'", Value, Module.Name);
+
+ if (Module.Host != libModule.Host)
+ throw new BuildException("Module '{0}' is trying to link against library '{1}' but can't mix target and hosts",
+ Module.Name,
+ libModule.Name);
+
+ if ((libModule.Type != ModuleType.NativeDLL) &&
+ (libModule.Type != ModuleType.Win32DLL) &&
+ (libModule.Type != ModuleType.StaticLibrary) &&
+ (libModule.Type != ModuleType.ObjectLibrary) &&
+ (libModule.Type != ModuleType.Kernel) &&
+ (libModule.Type != ModuleType.KernelModeDLL) &&
+ (libModule.Type != ModuleType.KernelModeDriver) &&
+ (libModule.Type != ModuleType.KeyboardLayout) &&
+ (libModule.Type != ModuleType.RpcServer) &&
+ (libModule.Type != ModuleType.RpcClient) &&
+ (libModule.Type != ModuleType.RpcProxy) &&
+ (libModule.Type != ModuleType.HostStaticLibrary))
+ {
+ throw new BuildException("Module '{0}' is trying to use Module '{1}' as a library but it is a '{2}'",
+ Module.Name,
+ libModule.Name,
+ libModule.Type);
+ }
+
+ Module.Libraries.Add(libModule);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerFlagTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerFlagTask.cs
new file mode 100644
index 00000000000..7a12e3fae3a
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerFlagTask.cs
@@ -0,0 +1,14 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("linkerflag")]
+ public class LinkerFlagTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildElement.LinkerFlags.Add(Value);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerScriptTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerScriptTask.cs
new file mode 100644
index 00000000000..e52c49ab9ff
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LinkerScriptTask.cs
@@ -0,0 +1,36 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("linkerscript")]
+ public class LinkerScriptTask : FileBaseTask
+ {
+ public LinkerScriptTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildFile();
+ }
+
+ public RBuildFile ScriptFile
+ {
+ get { return m_FileSystemInfo as RBuildFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Call the base class
+ base.ExecuteTask();
+
+ if (Module.LinkerScript != null)
+ throw new BuildException("Only one is allowed per module", Location);
+
+ Module.LinkerScript = ScriptFile;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LocalizationTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LocalizationTask.cs
new file mode 100644
index 00000000000..907505d86ca
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/LocalizationTask.cs
@@ -0,0 +1,41 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("localization")]
+ public class LocalizationTask : FileBaseTask
+ {
+ public LocalizationTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildLocalizationFile();
+ }
+
+ [TaskAttribute("isoname")]
+ public string IsoName { get { return LocalizationFile.IsoName; } set { LocalizationFile.IsoName = value; } }
+
+ [TaskAttribute("dirty")]
+ public bool Dirty { get { return LocalizationFile.Dirty; } set { LocalizationFile.Dirty = value; } }
+
+ private RBuildLocalizationFile LocalizationFile
+ {
+ get { return m_FileSystemInfo as RBuildLocalizationFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ RBuildLanguage language = Project.Languages.GetByName(IsoName);
+
+ if (language == null)
+ throw new BuildException("Unknown language '{0}' referenced by module '{1}'", IsoName, Module.Name);
+
+ Module.LocalizationFiles.Add(LocalizationFile);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MantainterTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MantainterTask.cs
new file mode 100644
index 00000000000..91f61db53a1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MantainterTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("mantainer")]
+ public class MantainterTask : AuthorBaseTask
+ {
+ public MantainterTask()
+ {
+ m_Author.Role = AuthorRole.Mantainer;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MetadataTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MetadataTask.cs
new file mode 100644
index 00000000000..3e2b4b67053
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/MetadataTask.cs
@@ -0,0 +1,27 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("metadata")]
+ public class MetadataTask : Task
+ {
+ RBuildMetadata m_Metadata = new RBuildMetadata();
+
+ ///
+ /// The module description.
+ ///
+ [TaskAttribute("description")]
+ public string Description { get { return m_Metadata.Description; } set { m_Metadata.Description = value; } }
+
+ protected override void ExecuteTask()
+ {
+ if (Module.Metadata != null)
+ throw new BuildException("Only one is allowed per module.", Location);
+
+ Module.Metadata = m_Metadata;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleStateTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleStateTask.cs
new file mode 100644
index 00000000000..f15b47bf9dc
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleStateTask.cs
@@ -0,0 +1,34 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("modulestate")]
+ public class ModuleStateTask : Task
+ {
+ private string m_ModuleName = null;
+ private bool m_Enabled = true;
+
+ [TaskAttribute("name")]
+ public string ModuleName { get { return m_ModuleName; } set { m_ModuleName = value; } }
+
+ [TaskAttribute("enabled")]
+ [BooleanValidator]
+ public bool Enabled { get { return m_Enabled; } set { m_Enabled = value; } }
+
+ protected override void ExecuteTask()
+ {
+ if (ModuleName != null)
+ {
+ RBuildModule module = Project.Modules.GetByName(ModuleName);
+
+ if (module == null)
+ throw new BuildException(string.Format("Could not change state for module '{0}'", ModuleName, Location));
+
+ module.Enabled = Enabled;
+ }
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleTask.cs
new file mode 100644
index 00000000000..1a790f41d11
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ModuleTask.cs
@@ -0,0 +1,588 @@
+using System;
+using System.IO;
+using System.Xml;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("module")]
+ public class ModuleTask : TaskContainer /*AutoResolvableFileSystemInfoBaseTask ,, ITaskContainer,*/ /*TaskContainer,*/ , ISysGenObject/*, IDirectory,*/, IRBuildSourceFilesContainer
+ {
+ protected RBuildModule m_Module = new RBuildModule();
+
+ [TaskAttribute("name", Required = true)]
+ [StringValidator(AllowEmpty = false, AllowSpaces = false)]
+ public string ModuleName
+ {
+ get { return m_Module.Name; }
+ set { m_Module.Name = value; }
+ }
+
+ [TaskAttribute("type", Required = true)]
+ public ModuleType Type
+ {
+ get { return m_Module.Type; }
+ set { m_Module.Type = value; }
+ }
+
+ [TaskAttribute("buildtype")]
+ public string BuildType
+ {
+ get { return m_Module.BuildType; }
+ set { m_Module.BuildType = value; }
+ }
+
+ [TaskAttribute("description", ExpandProperties = true)]
+ public string Description
+ {
+ get { return m_Module.Description; }
+ set { m_Module.Description = value; }
+ }
+
+ [TaskAttribute("lcid")]
+ public string LCID
+ {
+ get { return m_Module.LCID; }
+ set { m_Module.LCID = value; }
+ }
+
+ [TaskAttribute("installname")]
+ public string InstallName
+ {
+ get { return m_Module.InstallName; }
+ set { m_Module.InstallName = value; }
+ }
+
+ [TaskAttribute("installbase")]
+ [UriValidatorAttribute]
+ public string InstallBase
+ {
+ get { return m_Module.InstallBase; }
+ set { m_Module.InstallBase = value; }
+ }
+
+ [TaskAttribute("output")]
+ public string Output
+ {
+ get { return m_Module.OutputName; }
+ set { m_Module.OutputName = value; }
+ }
+
+ [TaskAttribute("baseaddress")]
+ public string BaseAdress
+ {
+ get { return m_Module.BaseAddress; }
+ set { m_Module.BaseAddress = value; }
+ }
+
+ [TaskAttribute("entrypoint")]
+ public string EntryPoint
+ {
+ get { return m_Module.EntryPoint; }
+ set { m_Module.EntryPoint = value; }
+ }
+
+ [TaskAttribute("aliasof")]
+ public string AliasOf
+ {
+ get { return m_Module.AliasOf; }
+ set { m_Module.AliasOf = value; }
+ }
+
+ [TaskAttribute("extension")]
+ public string Extension
+ {
+ get { return m_Module.Extension; }
+ set { m_Module.Extension = value; }
+ }
+
+ [TaskAttribute("unicode")]
+ [BooleanValidator()]
+ public bool Unicode
+ {
+ get { return m_Module.Unicode; }
+ set { m_Module.Unicode = value; }
+ }
+
+ [TaskAttribute("host")]
+ [BooleanValidator()]
+ public bool Host
+ {
+ get { return m_Module.Host; }
+ set { m_Module.Host = value; }
+ }
+
+ [TaskAttribute("isstartuplib")]
+ [BooleanValidator()]
+ public bool IsStartupLib
+ {
+ get { return m_Module.IsStartupLib; }
+ set { m_Module.IsStartupLib = value; }
+ }
+
+ [TaskAttribute("underscoresymbols")]
+ [BooleanValidator()]
+ public bool UnderscoreSymbols
+ {
+ get { return m_Module.UnderscoreSymbols; }
+ set { m_Module.UnderscoreSymbols = value; }
+ }
+
+ [TaskAttribute("mangledsymbols")]
+ [BooleanValidator()]
+ public bool MangledSymbols
+ {
+ get { return m_Module.MangledSymbols; }
+ set { m_Module.MangledSymbols = value; }
+ }
+
+ [TaskAttribute("allowwarnings")]
+ [BooleanValidator()]
+ public bool AllowWarnings
+ {
+ get { return m_Module.AllowWarnings; }
+ set { m_Module.AllowWarnings = value; }
+ }
+
+ public RBuildModule Module
+ {
+ get { return m_Module; }
+ }
+
+ public RBuildElement RBuildElement
+ {
+ get { return m_Module; }
+ }
+
+ public PathRoot Root
+ {
+ get { return PathRoot.Default; }
+ }
+
+ public RBuildSourceFileCollection SourceFiles
+ {
+ get { return Module.SourceFiles; }
+ }
+
+ protected override void OnLoad()
+ {
+ base.OnLoad();
+
+ if ((Module.Type == ModuleType.BootLoader) ||
+ (Module.Type == ModuleType.BootProgram) ||
+ (Module.Type == ModuleType.BootSector) ||
+ (Module.Type == ModuleType.EmbeddedTypeLib) ||
+ (Module.Type == ModuleType.IdlHeader) ||
+ (Module.Type == ModuleType.Kernel) ||
+ (Module.Type == ModuleType.KernelModeDLL) ||
+ (Module.Type == ModuleType.KernelModeDriver) ||
+ (Module.Type == ModuleType.NativeCUI) ||
+ (Module.Type == ModuleType.NativeDLL) ||
+ (Module.Type == ModuleType.ObjectLibrary) ||
+ (Module.Type == ModuleType.StaticLibrary) ||
+ (Module.Type == ModuleType.RpcClient) ||
+ (Module.Type == ModuleType.RpcServer) ||
+ (Module.Type == ModuleType.RpcProxy) ||
+ (Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32SCR) ||
+ //(Module.Type == ModuleType.Alias) ||
+ (Module.Type == ModuleType.HostStaticLibrary) ||
+ (Module.Type == ModuleType.BuildTool) ||
+ (Module.Type == ModuleType.Cabinet) ||
+ (Module.Type == ModuleType.KeyboardLayout) ||
+ (Module.Type == ModuleType.Iso) ||
+ (Module.Type == ModuleType.IsoRegTest) ||
+ (Module.Type == ModuleType.LiveIso) ||
+ (Module.Type == ModuleType.LiveIsoRegTest) ||
+ (Module.Type == ModuleType.MessageHeader) ||
+ (Module.Type == ModuleType.Package) ||
+ (Module.Type == ModuleType.ModuleGroup) ||
+ (Module.Type == ModuleType.PlatformProfile))
+ {
+ Module.Folder.Base = SysGenPathResolver.GetPath(this, SysGen.RootTask);
+ //Module.Base = SysGenPathResolver.GetPath(this, SysGen.ProjectTask); //BasePath;
+ Module.Path = SysGen.BaseDirectory;
+ Module.XmlFile = XmlFile;
+ Module.RBuildFile = RBuildFile;
+ Module.Enabled = false;
+
+ //HACK:
+ if (Type == ModuleType.HostStaticLibrary ||
+ Type == ModuleType.BuildTool)
+ {
+ Module.Host = true;
+ }
+
+ // Add the module to the project
+ Project.Modules.Add(Module);
+ }
+ else
+ {
+ Console.WriteLine("WARNING: modules of type '{0}' are being omited" , Module.Type);
+ }
+ }
+
+ private void AddModuleDefines()
+ {
+ switch (Type)
+ {
+ case ModuleType.NativeCUI:
+ {
+ Module.Defines.Add("__NTAPP__");
+ }
+ break;
+ case ModuleType.KernelModeDriver:
+ {
+ Module.Defines.Add("__NTDRIVER__");
+ }
+ break;
+ }
+
+ if (Unicode)
+ {
+ Module.Defines.Add("UNICODE");
+ Module.Defines.Add("_UNICODE");
+ }
+ }
+
+ private void AddModuleLinkerFlags()
+ {
+ switch (Type)
+ {
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32GUI:
+ case ModuleType.Win32SCR:
+ {
+ Module.LinkerFlags.Add("-nostartfiles");
+ Module.LinkerFlags.Add("-lgcc");
+
+ if (Module.CPlusPlus)
+ Module.LinkerFlags.Add("-nostdlib");
+ }
+ break;
+ case ModuleType.Kernel:
+ {
+ break;
+ }
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeCUI:
+ case ModuleType.NativeDLL:
+ case ModuleType.Test:
+ case ModuleType.BootLoader:
+ case ModuleType.BootProgram:
+ {
+ Module.LinkerFlags.Add("-nostartfiles");
+ Module.LinkerFlags.Add("-nostdlib");
+ }
+ break;
+ }
+
+ Module.LinkerFlags.Add("-g");
+ }
+
+ private void AddDebugSupportLibraries()
+ {
+ switch (Type)
+ {
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32OCX:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32GUI:
+ case ModuleType.Win32SCR:
+ case ModuleType.NativeCUI:
+ case ModuleType.NativeDLL:
+ {
+ Module.Libraries.Add(Project.Modules.GetByName("debugsup_ntdll"));
+ }
+ break;
+ case ModuleType.KeyboardLayout:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ {
+ Module.Libraries.Add(Project.Modules.GetByName("debugsup_ntoskrnl"));
+ }
+ break;
+ }
+ }
+
+ private void AddModuleCompilerFlags()
+ {
+ if (!AllowWarnings)
+ {
+ Module.CompilerFlags.Add("-Werror");
+ }
+
+ // Always force disabling of sibling calls optimisation for GCC
+ // (TODO: Move to version-specific once this bug is fixed in GCC)
+ Module.CompilerFlags.Add("-fno-optimize-sibling-calls");
+ Module.CompilerFlags.Add("-g");
+ Module.CompilerFlags.Add("-pipe");
+ }
+
+ private void AddRequiredBuildTools()
+ {
+ switch (Module.Type)
+ {
+ case ModuleType.BootLoader:
+ case ModuleType.BootProgram:
+ case ModuleType.BootSector:
+ case ModuleType.EmbeddedTypeLib:
+ case ModuleType.IdlHeader:
+ case ModuleType.MessageHeader:
+ case ModuleType.Kernel:
+ case ModuleType.KernelModeDLL:
+ case ModuleType.KernelModeDriver:
+ case ModuleType.NativeCUI:
+ case ModuleType.NativeDLL:
+ case ModuleType.ObjectLibrary:
+ case ModuleType.StaticLibrary:
+ case ModuleType.RpcClient:
+ case ModuleType.RpcServer:
+ case ModuleType.RpcProxy:
+ case ModuleType.Win32CUI:
+ case ModuleType.Win32DLL:
+ case ModuleType.Win32GUI:
+ case ModuleType.Win32OCX:
+ case ModuleType.Win32SCR:
+ case ModuleType.HostStaticLibrary:
+ case ModuleType.KeyboardLayout:
+ Module.Requeriments.Add(Project.Modules.GetByName("wrc"));
+ Module.Requeriments.Add(Project.Modules.GetByName("wmc"));
+ Module.Requeriments.Add(Project.Modules.GetByName("widl"));
+ Module.Requeriments.Add(Project.Modules.GetByName("winebuild"));
+ Module.Requeriments.Add(Project.Modules.GetByName("winebuild"));
+ break;
+ case ModuleType.Cabinet:
+ Module.Requeriments.Add(Project.Modules.GetByName("cabman"));
+ break;
+ case ModuleType.Iso:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("cabman"));
+ break;
+ case ModuleType.IsoRegTest:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("cabman"));
+ Module.Requeriments.Add(Project.Modules.GetByName("sysreg"));
+ break;
+ case ModuleType.LiveIso:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("mkhive"));
+ break;
+ case ModuleType.LiveIsoRegTest:
+ Module.Requeriments.Add(Project.Modules.GetByName("cdmake"));
+ Module.Requeriments.Add(Project.Modules.GetByName("mkhive"));
+ Module.Requeriments.Add(Project.Modules.GetByName("sysreg"));
+ break;
+ }
+ }
+
+ private void AddDefaultDependencies()
+ {
+ if (Module.Type != ModuleType.BuildTool &&
+ Module.Type != ModuleType.HostStaticLibrary &&
+ Module.Host == false)
+ {
+ if (Module.Name != "psdk" &&
+ Module.Name != "dxsdk" &&
+ Module.Name != "errcodes" &&
+ Module.Name != "bugcodes" &&
+ Module.Name != "ntstatus")
+ {
+ Module.Dependencies.Add(Project.Modules.GetByName("psdk"));
+ Module.Dependencies.Add(Project.Modules.GetByName("dxsdk"));
+ Module.Dependencies.Add(Project.Modules.GetByName("errcodes"));
+ Module.Dependencies.Add(Project.Modules.GetByName("bugcodes"));
+ Module.Dependencies.Add(Project.Modules.GetByName("ntstatus"));
+ }
+ }
+ }
+
+ //public RBuildFolder Folder
+ //{
+ // get { return null; }
+ //}
+
+ private void AddModuleLibraryDependencies()
+ {
+ // Add mingw and msvcrt implicit libraries only if it's
+ // a Win32 target.
+
+ if ((Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32SCR))
+ {
+ if (!Module.IsDefaultEntryPoint)
+ {
+ if (Module.NoEntryPoint)
+ {
+ if (Module.LinksToCRuntimeLibrary == false)
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_common"));
+ }
+ }
+ }
+ else
+ {
+ if (!Module.IsDLL)
+ {
+ if (Unicode)
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_wmain"));
+ }
+ else
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_main"));
+ }
+ }
+
+ //Is it correct ?
+ if (Module.Libraries.Count > 0)
+ {
+ Module.Libraries.Add(1, Project.Modules.GetByName("mingw_common"));
+ }
+ else
+ {
+ Module.Libraries.Add(0, Project.Modules.GetByName("mingw_common"));
+ }
+ }
+ }
+ }
+
+ private void AddCRuntimeLibrary()
+ {
+ if ((Module.Type == ModuleType.Win32CUI) ||
+ (Module.Type == ModuleType.Win32DLL) ||
+ (Module.Type == ModuleType.Win32GUI) ||
+ (Module.Type == ModuleType.Win32OCX) ||
+ (Module.Type == ModuleType.Win32SCR))
+ {
+ if (Module.IsDefaultEntryPoint || Module.NoEntryPoint)
+ {
+ if (Module.LinksToCRuntimeLibrary == false)
+ {
+ if (Module.Name != "msvcrt")
+ {
+ // Link msvcrt to get the basic routines
+ Module.Libraries.Add(Project.Modules.GetByName("msvcrt"));
+ }
+ }
+ }
+ }
+ }
+
+ private void AddModuleAssemblyFlags()
+ {
+ if (Type == ModuleType.BootSector)
+ {
+ Module.AssemblyFlags.Add("-f bin");
+ }
+ }
+
+ private void AddModuleIncludeFolders()
+ {
+ if (Module.Type == ModuleType.RpcClient ||
+ Module.Type == ModuleType.RpcServer ||
+ Module.Type == ModuleType.RpcProxy ||
+ Module.Type == ModuleType.EmbeddedTypeLib)
+ {
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.Intermediate, Module.Folder.FullPath)); //Hace falta?
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.SourceCode, Module.Folder.FullPath));
+ }
+ }
+
+ private void AddModuleProperties()
+ {
+ Project.Properties.Add(string.Format("SysGen.Module.{0}.Enabled", Module.Name), Module.Enabled.ToString(), true, true);
+ Project.Properties.Add(string.Format("SysGen.Module.{0}.BasePath", Module.Name), Module.Base, true, true);
+ Project.Properties.Add(string.Format("SysGen.Module.{0}.RBuildFile", Module.Name), Module.RBuildFile, true, true);
+ }
+
+ protected override void PostExecuteTask()
+ {
+ if (m_Module.RBuildFile == "mstask.rbuild")
+ {
+ int i = 0;
+ }
+
+ AddModuleLibraryDependencies();
+ AddCRuntimeLibrary();
+ AddDebugSupportLibraries();
+ AddDefaultDependencies();
+ AddModuleProperties();
+
+ if (m_Module.Host)
+ {
+ if (m_Module.CPlusPlus)
+ {
+ m_Module.CompilerFlags.Add("$(HOST_CPPFLAGS)");
+ }
+ else
+ {
+ m_Module.CompilerFlags.Add("$(HOST_CFLAGS)");
+ m_Module.CompilerFlags.Add("-Wno-strict-aliasing");
+ }
+ }
+ else
+ {
+ if (m_Module.CPlusPlus)
+ {
+ m_Module.CompilerFlags.Add("$(HOST_CPPFLAGS)");
+ }
+ else
+ {
+ m_Module.CompilerFlags.Add("-nostdinc");
+ }
+ }
+
+ //Sort source code files only when necessary
+ if (Module.SourceFiles.ContainsASM)
+ Module.SourceFiles.Sort(new SourceCodePreferenceComparer());
+ }
+
+ protected override void ExecuteTask()
+ {
+ Module.Enabled = true;
+
+ //AddModuleLibraryDependencies();
+ AddModuleDefines();
+ AddModuleLinkerFlags();
+ AddModuleCompilerFlags();
+ AddModuleIncludeFolders();
+ AddModuleAssemblyFlags();
+ AddRequiredBuildTools();
+
+ //if (Type == ModuleType.Alias)
+ //{
+ // if (Module.Name == "halupalias")
+ // {
+ // int i = 10;
+ // }
+
+ // RBuildModule alisedModule = Project.Modules.GetByName(AliasOf);
+
+ // if (alisedModule == null)
+ // throw new BuildException("module '" + ModuleName + "' trying to alias non-existant module '" + AliasOf + "'", Location);
+
+ // if (Module.Name == AliasOf)
+ // throw new BuildException("Module '" + ModuleName + "' cannot link against itself", Location);
+
+ // alisedModule = Module;
+ // alisedModule.Enabled = true;
+
+ // Module.Enabled = false;
+ //}
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/BuildTool.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/BuildTool.cs
new file mode 100644
index 00000000000..67d0755580d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/BuildTool.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("buildtool")]
+ public class BuildTool : ModuleTask
+ {
+ public BuildTool()
+ {
+ Type = ModuleType.BuildTool;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Cabinet.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Cabinet.cs
new file mode 100644
index 00000000000..715fbcc4952
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Cabinet.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("cabinet")]
+ public class Cabinet : ModuleTask
+ {
+ public Cabinet()
+ {
+ Type = ModuleType.Cabinet;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Kernel.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Kernel.cs
new file mode 100644
index 00000000000..7cafd130411
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Kernel.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("kernel")]
+ public class Kernel : ModuleTask
+ {
+ public Kernel()
+ {
+ Type = ModuleType.Kernel;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDLL.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDLL.cs
new file mode 100644
index 00000000000..22d238b739e
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDLL.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("kernelmodell")]
+ public class KernelModeDLL : ModuleTask
+ {
+ public KernelModeDLL()
+ {
+ Type = ModuleType.KernelModeDLL;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDriver.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDriver.cs
new file mode 100644
index 00000000000..b223cf5897b
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/KernelModeDriver.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("kernelmodedriver")]
+ public class KernelModeDriver : ModuleTask
+ {
+ public KernelModeDriver()
+ {
+ Type = ModuleType.KernelModeDriver;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeCUI.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeCUI.cs
new file mode 100644
index 00000000000..ac9e84a3d82
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeCUI.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("nativecui")]
+ public class NativeCUI : ModuleTask
+ {
+ public NativeCUI()
+ {
+ Type = ModuleType.NativeCUI;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeDLL.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeDLL.cs
new file mode 100644
index 00000000000..bdaabee1bfc
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/NativeDLL.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("nativedll")]
+ public class NativeDLL : ModuleTask
+ {
+ public NativeDLL()
+ {
+ Type = ModuleType.NativeDLL;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/ObjectLibrary.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/ObjectLibrary.cs
new file mode 100644
index 00000000000..a34279d68a7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/ObjectLibrary.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("objectlibrary")]
+ public class ObjectLibrary : ModuleTask
+ {
+ public ObjectLibrary()
+ {
+ Type = ModuleType.ObjectLibrary;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Package.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Package.cs
new file mode 100644
index 00000000000..68bdbcb0212
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Package.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("package")]
+ public class Package : ModuleTask
+ {
+ public Package()
+ {
+ Type = ModuleType.Package;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/StaticLibrary.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/StaticLibrary.cs
new file mode 100644
index 00000000000..0abe2820982
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/StaticLibrary.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("staticlibrary")]
+ public class StaticLibrary : ModuleTask
+ {
+ public StaticLibrary()
+ {
+ Type = ModuleType.StaticLibrary;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32CUI.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32CUI.cs
new file mode 100644
index 00000000000..5fba4c1bc44
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32CUI.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32cui")]
+ public class Win32CUI : ModuleTask
+ {
+ public Win32CUI()
+ {
+ Type = ModuleType.Win32CUI;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32Dll.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32Dll.cs
new file mode 100644
index 00000000000..320e1a00ebe
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32Dll.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32dll")]
+ public class Win32DLL : ModuleTask
+ {
+ public Win32DLL()
+ {
+ Type = ModuleType.Win32DLL;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32GUI.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32GUI.cs
new file mode 100644
index 00000000000..9bffa1ba55e
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32GUI.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32gui")]
+ public class Win32GUI : ModuleTask
+ {
+ public Win32GUI()
+ {
+ Type = ModuleType.Win32GUI;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32OCX.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32OCX.cs
new file mode 100644
index 00000000000..2b8051591fa
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32OCX.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32ocx")]
+ public class Win32OCX : ModuleTask
+ {
+ public Win32OCX()
+ {
+ Type = ModuleType.Win32OCX;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32SCR.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32SCR.cs
new file mode 100644
index 00000000000..5199e32fab6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Modules/Win32SCR.cs
@@ -0,0 +1,17 @@
+using System;
+using System.IO;
+
+using SysGen.RBuild.Framework;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("win32scr")]
+ public class Win32SCR : ModuleTask
+ {
+ public Win32SCR()
+ {
+ Type = ModuleType.Win32SCR;
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/OverrideModuleTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/OverrideModuleTask.cs
new file mode 100644
index 00000000000..612d4e6dc02
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/OverrideModuleTask.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("overridemodule")]
+ public class OverrideModuleTask : ModuleTask
+ {
+ public OverrideModuleTask()
+ {
+ m_FailOnMissingRequired = false;
+ }
+
+ protected override void OnLoad()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void PostExecuteTask()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void PreExecuteTask()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void ExecuteTask()
+ {
+ //Evitamos actualizar la información del módulo de verdad
+ }
+
+ protected override void InitializeTask(XmlNode taskNode)
+ {
+ base.InitializeTask(taskNode);
+
+ if (taskNode.Attributes["name"] == null)
+ throw new BuildException("Missing 'name' attribute");
+
+ string moduleName = taskNode.Attributes["name"].Value;
+
+ m_Module = Project.Modules.GetByName(moduleName);
+
+ if (m_Module == null)
+ throw new BuildException("Overrided module '{0}' not found" , moduleName);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PCHTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PCHTask.cs
new file mode 100644
index 00000000000..c7700d7018f
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PCHTask.cs
@@ -0,0 +1,43 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ ///
+ /// PreCompiled Header task
+ ///
+ [TaskName("pch")]
+ public class PCHTask : FileTask
+ {
+ ///
+ /// Creates a new instance of the class.
+ ///
+ public PCHTask()
+ {
+ }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildSourceFile();
+ }
+
+ public RBuildSourceFile SourceFile
+ {
+ get { return m_FileSystemInfo as RBuildSourceFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ if (Module.PreCompiledHeader != null)
+ throw new BuildException("Only one is allowed per module", Location);
+
+ //Call the base class
+ base.ExecuteTask();
+
+ //Add the folder where the PCH is present as a include folder
+ Module.IncludeFolders.Add(new RBuildFolder(PathRoot.Intermediate, Base));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformAutorunTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformAutorunTask.cs
new file mode 100644
index 00000000000..a298818f62c
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformAutorunTask.cs
@@ -0,0 +1,21 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformautorun")]
+ public class PlatformAutorunTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Platform.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ Project.Platform.AutorunModules.Add(module);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDebugChannelTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDebugChannelTask.cs
new file mode 100644
index 00000000000..3a6bd35f029
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDebugChannelTask.cs
@@ -0,0 +1,66 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformdebugchannel")]
+ public class PlatformDebugChannelTask : ValueBaseTask
+ {
+ //private RBuildDebugChannel m_DebugChannel = null;
+
+ //[TaskAttribute("name")]
+ //public string ChannelName
+ //{
+ // get { return m_DebugChannel.Name; }
+ // set { m_DebugChannel.Name = value; }
+ //}
+
+ //[TaskAttribute("warning")]
+ //public bool Warning
+ //{
+ // get { return m_DebugChannel.Warn; }
+ // set { m_DebugChannel.Warn = value; }
+ //}
+
+ //[TaskAttribute("trace")]
+ //public bool Trace
+ //{
+ // get { return m_DebugChannel.Trace; }
+ // set { m_DebugChannel.Trace = value; }
+ //}
+
+ //[TaskAttribute("fixme")]
+ //public bool Fixme
+ //{
+ // get { return m_DebugChannel.Fixme; }
+ // set { m_DebugChannel.Fixme = value; }
+ //}
+
+ //[TaskAttribute("error")]
+ //public bool Error
+ //{
+ // get { return m_DebugChannel.Error; }
+ // set { m_DebugChannel.Error = value; }
+ //}
+
+ //protected override void PreExecuteTask()
+ //{
+ // m_DebugChannel = Project.DebugChannels.GetByName(ChannelName);
+ //}
+
+ protected override void ExecuteTask()
+ {
+ RBuildDebugChannel channel = Project.DebugChannels.GetByName(Value);
+
+ if (channel == null)
+ throw new BuildException("Unknown debug channel '{0}' referenced by ", Value);
+
+ if (Project.Platform.DebugChannels.Contains(channel))
+ throw new BuildException("Only one debug channel '{0}' can be present per ", Value);
+
+ Project.Platform.DebugChannels.Add(channel);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDescriptionTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDescriptionTask.cs
new file mode 100644
index 00000000000..ee5d8f1cdfc
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformDescriptionTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformdescription")]
+ public class PlatformDescriptionTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ Project.Platform.Description = Value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformLanguageTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformLanguageTask.cs
new file mode 100644
index 00000000000..8362e09be64
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformLanguageTask.cs
@@ -0,0 +1,25 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformlanguage")]
+ public class PlatformLanguageTask : ValueBaseTask
+ {
+ public PlatformLanguageTask()
+ {
+ }
+
+ protected override void ExecuteTask()
+ {
+ RBuildLanguage language = Project.Languages.GetByName(Value);
+
+ if (language == null)
+ throw new BuildException("Unknown language '{0}' referenced by ", Value);
+
+ Project.Platform.Languages.Add(language);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformModuleTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformModuleTask.cs
new file mode 100644
index 00000000000..3bb3190f0bb
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformModuleTask.cs
@@ -0,0 +1,25 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformmodule")]
+ public class PlatformModuleTask : ValueBaseTask
+ {
+ public PlatformModuleTask()
+ {
+ }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ Project.Platform.Modules.Add(module);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformNameTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformNameTask.cs
new file mode 100644
index 00000000000..88890e81e88
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformNameTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformname")]
+ public class PlatformNameTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ Project.Platform.Name = Value;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformScreenSaverTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformScreenSaverTask.cs
new file mode 100644
index 00000000000..e396774a3e7
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformScreenSaverTask.cs
@@ -0,0 +1,28 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformscreensaver")]
+ public class PlatformScreenSaverTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ if (module.Type != ModuleType.Win32SCR)
+ throw new BuildException("Shell can only be of type win32scr");
+
+ if (Project.Platform.Screensaver != null)
+ throw new BuildException("Only one screensaver can be set per platform");
+
+ /* set the shell to use */
+ Project.Platform.Screensaver = module;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformShellTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformShellTask.cs
new file mode 100644
index 00000000000..b97c9f5b469
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformShellTask.cs
@@ -0,0 +1,29 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformshell")]
+ public class PlatformShellTask : ValueBaseTask
+ {
+ protected override void ExecuteTask()
+ {
+ RBuildModule module = Project.Modules.GetByName(Value);
+
+ if (module == null)
+ throw new BuildException("Unknown module '{0}' referenced by ", Value);
+
+ if (module.Type != ModuleType.Win32CUI &&
+ module.Type != ModuleType.Win32GUI)
+ throw new BuildException("Shell can only be of type win32gui");
+
+ if (Project.Platform.Shell != null)
+ throw new BuildException("Only one shell can be set per platform");
+
+ /* set the shell to use */
+ Project.Platform.Shell = module;
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformWallpaperTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformWallpaperTask.cs
new file mode 100644
index 00000000000..fc7776062aa
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/Platform/PlatformWallpaperTask.cs
@@ -0,0 +1,37 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("platformwallpaper")]
+ public class PlatformWallpaperTask : ValueBaseTask
+ {
+ protected override void PostExecuteTask()
+ {
+ if (Project.Platform.Wallpaper != null)
+ throw new BuildException("Only one wallpaper can be set per platform");
+
+ foreach (RBuildModule module in Project.Modules)
+ {
+ foreach (RBuildFile file in module.Files)
+ {
+ RBuildWallpaperFile wallpaper = file as RBuildWallpaperFile;
+
+ if (wallpaper != null)
+ {
+ if (wallpaper.ID.ToLower() == Value.ToLower())
+ {
+ /* set the shell to use */
+ Project.Platform.Wallpaper = wallpaper;
+ }
+ }
+ }
+ }
+
+ if (Project.Platform.Wallpaper == null)
+ throw new BuildException("Unknown wallpaper '{0}' referenced by ", Value);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ProjectTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ProjectTask.cs
new file mode 100644
index 00000000000..bb09d9342a1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ProjectTask.cs
@@ -0,0 +1,70 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("project")]
+ public class ProjectTask : TaskContainer, ISysGenObject
+ {
+ RBuildProject _project = new RBuildProject();
+
+ public ProjectTask()
+ {
+ }
+
+ [TaskAttribute("name", Required = true)]
+ public string Name
+ {
+ get { return _project.Name; }
+ set { _project.Name = value; }
+ }
+
+ [TaskAttribute("makefile", Required = true)]
+ public string MakeFile
+ {
+ get { return _project.MakeFile; }
+ set { _project.MakeFile = value; }
+ }
+
+ public RBuildProject Project
+ {
+ get { return _project; }
+ }
+
+ public RBuildElement RBuildElement
+ {
+ get { return _project; }
+ }
+
+ protected override void OnInit()
+ {
+ SysGen.Project = Project;
+ SysGen.RootTask = this;
+ Project.RBuildFile = RBuildFile;
+
+
+ Project.Properties.Add("ARCH", "i386");/*
+ Project.Defines.Add("_M_IX86");
+ Project.Defines.Add("_X86_");
+ Project.Defines.Add("__i386__");*/
+ }
+
+ protected override void OnLoad()
+ {
+ base.OnLoad();
+
+ Project.Folder = new RBuildFolder(PathRoot.SourceCode , "");
+ }
+
+ protected override void PreExecuteTask()
+ {
+ ///Project.Base = string.Empty;
+ Project.Path = SysGen.BaseDirectory;
+ Project.XmlFile = XmlFile;
+ }
+ }
+}
+
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PropertyTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PropertyTask.cs
new file mode 100644
index 00000000000..1b143c0dd16
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/PropertyTask.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Xml;
+
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ /// Sets a property in the current project.
+ ///
+ /// NAnt uses a number of predefined properties.
+ ///
+ ///
+ /// Define a debug property with the value true.
+ /// ]]>
+ /// Use the user-defined debug property.
+ /// ]]>
+ /// Define a Read-Only property.This is just like passing in the param on the command line.
+ /// ]]>
+ ///
+ [TaskName("property")]
+ public class PropertyTask : PropertyBaseTask
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RBuildTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RBuildTask.cs
new file mode 100644
index 00000000000..12feafedce4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RBuildTask.cs
@@ -0,0 +1,10 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("rbuild")]
+ public class RBuildTask : TaskContainer
+ {
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ReDefineTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ReDefineTask.cs
new file mode 100644
index 00000000000..f41f0aae4ce
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/ReDefineTask.cs
@@ -0,0 +1,16 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("redefine")]
+ public class ReDefineTask : Task
+ {
+ protected override void ExecuteTask()
+ {
+// RBuildElement.Defines.Add(new RBuildDefine(DefineName, DefineValue));
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RequiresTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RequiresTask.cs
new file mode 100644
index 00000000000..f68ffe5f00d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/RequiresTask.cs
@@ -0,0 +1,27 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("requires")]
+ public class RequiresTask : ValueBaseTask
+ {
+ ///
+ /// The define value.
+ ///
+ [TaskValue(Required = true)]
+ public virtual string Value { get { return _value; } set { _value = value; } }
+
+ protected override void ExecuteTask()
+ {
+ RBuildModule requeriment = Project.Modules.GetByName(Value);
+
+ if (requeriment == null)
+ throw new BuildException("Unknown requeriment '{0}' referenced by module '{1}'", Value, Module.Name);
+
+ Module.Requeriments.Add(requeriment);
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/SetupTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/SetupTask.cs
new file mode 100644
index 00000000000..83d2056b8f4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/SetupTask.cs
@@ -0,0 +1,45 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("setup")]
+ public class SetupTask : PlatformFileBaseTask
+ {
+ [TaskAttribute("installsection", Required = true)]
+ public string InstallSection { get { return Setup.InstallSection; } set { Setup.InstallSection = value; } }
+
+ [TaskAttribute("type")]
+ public SetupType SetupType { get { return Setup.SetupType; } set { Setup.SetupType = value; } }
+
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildSetupFile();
+ }
+
+ ///
+ /// Get the underlying .
+ ///
+ public RBuildSetupFile Setup
+ {
+ get { return m_FileSystemInfo as RBuildSetupFile; }
+ }
+
+ protected override void ExecuteTask()
+ {
+ base.ExecuteTask();
+
+ if (Module.IsInstallable || Module.Type == ModuleType.Package)
+ {
+ if (Module.Setup != null)
+ throw new BuildException("There can be only one element for a module", Location);
+
+ Module.Setup = Setup;
+ }
+ else
+ throw new BuildException(" is not applicable for this module type", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/TargetTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/TargetTask.cs
new file mode 100644
index 00000000000..15b1c70d212
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/TargetTask.cs
@@ -0,0 +1,18 @@
+using System;
+using SysGen.BuildEngine.Attributes;
+
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("target")]
+ public class TargetTask : Task
+ {
+ protected RBuildTarget m_Target = new RBuildTarget();
+
+ protected override void ExecuteTask()
+ {
+ SysGen.Targets.Add(m_Target);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/WallPaperTask.cs b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/WallPaperTask.cs
new file mode 100644
index 00000000000..31ea0d9930d
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.BuildEngine/Tasks/RBuild/WallPaperTask.cs
@@ -0,0 +1,26 @@
+using System;
+
+using SysGen.BuildEngine.Attributes;
+using SysGen.RBuild.Framework;
+
+namespace SysGen.BuildEngine.Tasks
+{
+ [TaskName("wallpaper")]
+ public class WallPaperTask : PlatformFileBaseTask
+ {
+ protected override void CreateFileSystemObject()
+ {
+ m_FileSystemInfo = new RBuildWallpaperFile();
+ }
+
+ protected override void ExecuteTask()
+ {
+ if (Module != null)
+ {
+ base.ExecuteTask();
+ }
+ else
+ throw new BuildException(" is only applicable for modules", Location);
+ }
+ }
+}
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.Make/Program.cs b/reactos/tools/sysgen/SysGen.Make/Program.cs
new file mode 100644
index 00000000000..de3ba818cd9
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/Program.cs
@@ -0,0 +1,42 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+using SysGen.BuildEngine;
+using SysGen.BuildEngine.Framework;
+
+namespace SysGen.Make
+{
+ class Program
+ {
+ static void Main(string[] args)
+ {
+ SysGenEngine engine = new SysGenEngine(@"C:\ros\trunk\reactos\ReactOS-i386.rbuild");
+
+ engine.ReadBuildFiles();
+
+ /*
+ Console.WriteLine("Generates project files for buildsystems\n\n");
+ Console.WriteLine(" rbuild [switches] -r{rootfile.rbuild} buildsystem\n\n");
+ Console.WriteLine("Switches:\n");
+ Console.WriteLine(" -v Be verbose.\n");
+ Console.WriteLine(" -c Clean as you go. Delete generated files as soon as they are not\n");
+ Console.WriteLine(" needed anymore.\n");
+ Console.WriteLine(" -dd Disable automatic dependencies.\n");
+ Console.WriteLine(" -dm{module} Check only automatic dependencies for this module.\n");
+ Console.WriteLine(" -ud Disable multiple source files per compilation unit.\n");
+ Console.WriteLine(" -mi Let make handle creation of install directories. Rbuild will\n");
+ Console.WriteLine(" not generate the directories.\n");
+ Console.WriteLine(" -ps Generate proxy makefiles in source tree instead of the output.\n");
+ Console.WriteLine(" tree.\n");
+ Console.WriteLine(" -vs{version} Version of MS VS project files. Default is %s.\n", MS_VS_DEF_VERSION);
+ Console.WriteLine(" -vo{version|configuration} Adds subdirectory path to the default Intermediate-Outputdirectory.\n");
+ Console.WriteLine(" -Dvar=val Set the value of 'var' variable to 'val'.\n");
+ Console.WriteLine("\n");
+ Console.WriteLine(" buildsystem Target build system. Can be one of:\n");
+ */
+
+ Console.ReadLine();
+ }
+ }
+}
diff --git a/reactos/tools/sysgen/SysGen.Make/Properties/AssemblyInfo.cs b/reactos/tools/sysgen/SysGen.Make/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000000..9012ef9b0c1
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("SysGen.Make")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Sand")]
+[assembly: AssemblyProduct("SysGen.Make")]
+[assembly: AssemblyCopyright("Copyright © Sand 2008")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("00432ce1-5d82-4afb-9a3a-dc2ce95edc4e")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj
new file mode 100644
index 00000000000..89de06851a4
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj
@@ -0,0 +1,58 @@
+
+
+ Debug
+ AnyCPU
+ 8.0.50727
+ 2.0
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}
+ Exe
+ Properties
+ SysGen.Make
+ SysGen.Make
+
+
+ 2.0
+
+
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+ {8F5F8375-4097-4952-B860-784EB9961ABE}
+ SysGen.Framework
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj.user b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj.user
new file mode 100644
index 00000000000..1a4ff357ca6
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.csproj.user
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.sln b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.sln
new file mode 100644
index 00000000000..d9d1e258355
--- /dev/null
+++ b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SysGen.Make", "SysGen.Make\SysGen.Make.csproj", "{8B1229C7-6188-4621-A648-843CB9B5C72E}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8B1229C7-6188-4621-A648-843CB9B5C72E}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/reactos/tools/sysgen/SysGen.Make/SysGen.Make.suo b/reactos/tools/sysgen/SysGen.Make/SysGen.Make.suo
new file mode 100644
index 0000000000000000000000000000000000000000..b55bbbea00f579acf50698899f55a4f332327c08
GIT binary patch
literal 182272
zcmeFa37lkCSvFn?`!0(tA}~PMnP#>mlYqc%NhX;|hUv*776Fl~(lcv8|i6zJJqgTDSDB-wf~1(&ry)wa)H-{{Brj
z-K5LU3k2<;(g
z4@MgU4LuF*VR-*=v`3&l5^Xcu2-;4xEofWOwxMlD+ktj2+IeW_qdgSu0<;U!9*y=G
zv>!uzEZXDH9*?#QZ8zE;w7qEi&@Mu|80`|Y{b-k>U50i5?I7CaXjh;eLVE(*VYE@S
zBWPEm9Ywne?HJk<(Vm3%WVANgQ_!A@b~W15(8kcl(I(I)(WcO*(Pq$&qs^i{9qk0#
z9NIkE0@@PNAJfy9Vurx&q4cfw8Q9W5x?Ao
zkuTtNIr{~^sQK^ipcs)kX{YSpru%&R=5Kt@$IrSMZu%gJ3jYoP;vz=4AJC`qZeNDA
zeOKr2-64eppRaX(!+S`({C5N^(825;z)W{A{wwi!3OMOH=e6wLIe<^TAkWl=e-`c~
zZ}HzTtmqtOVGI;-0)J-!{R*t?3h-IPoYa7SR@3p{9&lelCc!`QVB9#CBL3&^$p5^b
z{Lj~z|2Y@xuZsUSb?=o7;O{5{^n1OM|M~uZ{|$czZux{aT=CWa_|C33?D*xWk6rhr
z8!^?5{(Wl?HAMga$P4km&Ze=2$xWkED=V`LGoAKTi_0h42NoyB=G?U-Q}avhwe8zZ
z@b}aQdm!c8kiw_IF&Be}7NSohklbV7u&GQ66XNpt>g?Pk^%eiMJ1dLJV>46jiMg>(
zr#(5_Ig$MtvDrG<7=W4)X3$t@`W9{Xsv56H-z~tOqdu?_B9ZW2*@PoZ1dbyz6
z%LJe+Z+3m@er#;#2B3#96ErA)AbX%gM
z-byA1Ha2;3X>8&|yZhRAKb@(C&e+myyZf5xr~VX8Ok#@oC(%>&lFb7htem|hdJ#S+
zlk>B@gf-uB^}^Iz+uruk)8y>()Wpguu-wAZ>dH>NCVILwL5$;LovHTN($d`Q#MsL0
z;zFn0nOL6Uv}g1+Ken>Wa9r@!5r`mG*?aCi>Z&pw7b-nOBT%o|#&hTArOq
z{91x7=C|?1#g+CnsCjO3xjj8OHNHC2eMxlm*aR9B(qcCZYl`A~YI6IeUK8D=Mm0A(
z-tJ7EpxkFm{CZacnF5Yom^`^S2Qut*-z0iW&J$%oXKG~?_QBNL#Ns>#Xs?Nms+WDf
zGd3|#Iccwnergfn*u+GpX(v+4|M)j2UX3BI@21X|U@o0*(l
znp^F(yRV6U#HOL@&Zv@qCdXFB+Io}dqFR-#tx!W^s`Vz(lNP@KnI4OXRqQp;@Uk!?5@!dz-wn^Y(=k$et#^{uj3*Jz4`g}{Osf`tRKB5
zdaItt3D_FYEufL?HPO%ZO04GR#ujGU+22GTvIvTZ!<1BKWfG`t8(EoyVD7#zc4DgW
z8Jn1cjgtLM;8QL2R+s1I7Z=+0lIW#+h9}2oAon2b>^0HPqq;L3%7x=&b8WPxrHMAQ
z0^Y5rY@}*&Fm`elZVH%KZxWd7PONpFXC~$+S661|I_>#Ia18$>x_nsS;O3_$XUEzL
z_&r+Umt_l0(+?)|+UzymmqZ^j`(nb&4`_L61~|bQ00E*U`YXf92zj-$v~>$a6aFUp
zs3x1v@wv6k=d#zn`&pZt9HVXAeNFUJO+K*uj>Fj6*4CRuPt~&nul+cdjDHh-)bf%T
zy!as66G2>i7bjNdrxsS4#9ts$uikcIduM6e$mr(fsgv8cZaaU=Nay6jmMvRGR^W^<
zFdl?Xc67E>Q{91}7u`HRZIlkJNTb!AlXzNX)uSXP0
zDvo3!ixFji6TdwtF%R=&C#D!68Ue{O`4P}mL#vtkh*mRR6Ij&uS7ew>u3?V(C(&bl
z`8jcXY?($$_chVqdF5<0J2}-}U6`d+ZZC;$M0O$3m{L(tZE9trjh5&^qAKiRb^)dX
za8R6Zc5<$bmgu8eaE>o8u63qhjOb0Gr{)&r%JSI66r9)YYocFCt#Fi?@-t@>CNzCc
zdr5SXa>=b5`gQH8Q%iF&0hTv2oTd+n?y6@EhTzijBGirEBzj7@9Nze}kloirN7d%w
z;`q}$Q;0TYFNt1?NlN5s6Fok+I@RW%L?6|Y11n=?d9|~`z(@8b(NhJdbtXEqnRL{f
zL^o13u>s|LlKG|OHd^BMeOQ#!v(SJ1ljyQ~ju7)Uhg@$GJ*6ny4Xziq=**3so?33(
zOQO4K#Gnj~4)i9`Q?-f6&@f`f?e1%$pBfmE|1(>&`zF!TV<5N>EicY2kIiqoh#8Oe
z!P$xB#m?gN%BG{UomHl}R#qox7dP!}AKlZIAnhP%y}+t~K=D=3rX{l`CYKlIktx96
z1Wwhnl*OqbNV>0yeyV3F`+XKeW#Aic5Bder3C~*Av#LDvA$l}DQ
zwtJgEum(GKW)U)+P5i!ksuYK>3dl=^7YP(>5(Qm~TiJW`7fXRZly#Tb8uwzV^{iZ`zEKEJv5_o;&3U$TunC+ovAA%
zZxTHf8<-M!8O@!TL=3u}{jKOEW@OKf>uOEvs6;2lV-hAx@YTu7NjpWe<1#e$jLKtJ
z`+j2+Cub2ZR%l|!x#yRLCPZWrzJBJ7OWQ%JI?HwNO=1#9y7U@$1*>=S>~@3|JYN_b
zo)3~FX08yE+0Nql3NmkF9To=$=7E+nrUz%1Wm)oG2ollNC72n=Ep^`{Mpw$^K?2?~
z0+2mZ^U5{yO`_j2X-46{w7534JTX1fdz0v=N{P_<&msVc-b@qBQGBDAH8Sl;!G3af
zGL!3gO>|U7g*MyA(Fa=M_w{EPsl=7#MZ|vXHPK%g6&gNZPGFS%P4rPVrY!P2HoJhL
zso7Mlw3-4}PpurELLo-?HGxM1mrtcmRW(nNqT#xiO3{?G%3J-%kHbq$jHUiMW0kVR
zX7@GG-~FKuMo)Jxo?7U>jEo*cK%6PN5m3nVY%VfTuENa9JuyCM5dytQKu_>;vrg_)
zXc2J~)TgoK(kP;Ta$;!}wS!aHYhnzkb#?P5QcqJsLZi1QlBGlpGQ?dw;
zTD6bh4}!t*1l7~_ib^v*6vcCxw5~j0rI_i~$NoB;Qv*${koCnh)e%yUc;L|`9EG|zjjiC_F
zUK9PLmMSlx=I1AnFihob9@^!{u7d8;aE&5~`U8U2QPB=HP+~yUoM~mn<<-UFhs1g<
zpPWSutBvy5g{90c>%K|gl(K$p^|Kmv#`dO8O<{`dHPKTUNmIKXpIl?@g}o&DIEbZ6
zIKY=KjxB6DIJP`dxI^Ob*z!4h_iwpiWXJaNGs~vPNlX!xlZ*>1^JB}%Bz9jDSXRX$
z5viY?Z)blKJ*3vqVFHFj+148BxtSsDz9xFB9v4<_o&|Z`*F--lT5wpwEnP;QZJKUr
z_9oF&HAYz^3mA1@6a6&LPA?&M(B_{+k7Ya<$bS?6ee{Br!?>WM$$j>c=%tK~te3fK
z&=vnAdMLMj6u~mnr>fGVdiBj^R;GGy68-cMm(J#Uo+ZPW
z{`r(37W;+9O&ma|n^P(ie71~TW+qD~hFU%Oo#WGsbCb*`cHbm=dSs~WdV|W6_Eov$
z`uv7WKxU1D7VJ#|od!B|ab=1|0V3plP4rhiQCZ@RB1>-)Jw3!GYWKeOj*+b++k5%P
ziAOx5d*vjeo{QXbTszd*lOR(krxsS{Nrrq)V8EXL_um^h`%n9UZ&(dy
z|7#QYT$u^X2lwW>eZ=A1_VcN`6v0mixfXO(@gYrrr?KwiphBKHk^V>e=UD;V>tC1t
zxR+l_$hfX6FHw=TKbL<%LC@W|5Lbj|6br3q%QpPK0Mm6oj%qm%pLgQ_W*p6O9>5
zZ`#6d5UvGg&&)O`8|l&?k8`O@|Kyb)?RG{zM~NyLH$IyN)z9E6&ri@dMbLRB
z(An7;MLe6NF8q7o-jiJcdj(|N(=mfw=$OZkV#%uhJpkh;m+(B4y72Fhd*9LRcn?O;
z6KFa(<6#!0x|YMDdt>4S=g*u)8n`Q3UHHEI8I)B=AUf8v6Du6u+4(g-)p2%;Y15=D
z@4a<)?vqcOgW~pRuwO{+gZ4Or^OB~pVzf|sPSCZ0umCZ$39EJpX9tbIQrex-EG_8W
zxRZj_ao^*Hj*ruyO>rT|?gHof2F_OTZ|;C=hve&OdPUh|z(_u;(u&nV
z|N8WY-?GoHe&cQr`qSTh-~%sy_t(DitcQ%xQ#|3{Xlv*6-9G&N58wB|TV6l;j#uCJ
zn->hDSL-|c`-DwA?`s$e!#f)<1X23w98d{Q;5w11q-DHzKut%XD7HXdj%0t?!6;T}
zC0nZntP;&rsJLUfWqS273Wxo&z=)0UPoyXJP%}UyUX{_+
zi3SvEV>c?;3p~a$Eklc78t>_$Z^IdSN5K(ez>yM}Cfa6vKLu&F9lS%+b33kf@OdHQ
zr!Dxjl8u%3LMB0Rzpy(V->?kNks1MqY7X|Hr=>NGh;@Z#)?k=A3B>u89pThIq
z{BO;$Y_)z9xIC>87oO190ae;rQnV1rqnt}0CT$n4BG<~;R
zBkuzIr5=1ck83R(;S^*MXWG2OHcow{uIF5`Khl}W+nL@gT@A_%(hpBkBu~#|GFj0z
zLH!Jv@0DGsw!S>w%j^m|E9{+Az5+<>&&g|}Cp$fC445xv-&0zh%p?idpTDp>)^L3s
z_i)ART*LG?#I4o()3Y{?LbhUtcjYML;Twq2cDSbJaJ6H^d8m=1k33VYM
zQ^(9;Y+K^v3z3
zR$I*AFfeT=oIC5jY(|Ro`F@OW7WT7omg!FS*{GRN<}mL~c!)CmIvE;jPu!=sHR~hv*wxeHol;K
zSb|-sXvzA=!tZ8
z8oxXVNzE+F2om#KV1;kXEOFx=^Ik?^r(c2Z3754ZSK*h8snS-}y8RGn?Gr;ERfxq^
zfH)3_rfKS7uHRgVF^u4OHnf@M3P(cPq+M+Gz+Ew(r*_99NnE9ioGdPiy;uxp5+g7u
zc;XFUytfOZT$a_7BF>YxSl2Qjk;gh1w{KyZ#F5@`zw)&fXG6aaf2|q%IItgvjbQcy
z<(=uH@N=xGFM);}22}dN)O3`qj2wlZW2n=B`t06HHII+@a?hV-N_4G*u?X{_;w!O?oWvX|!lMyZX-xTyghJnOA%kb~nAgTYv%de+
zYW+N*#D1}V2Xpw&YamU;p0Kl~E!%J26aOlPA9Hm0ImYN$Fyo3!)E&1Ug&qfI(^H+q
z=of+S66WAI#!dh0&KT`nL^XBi)c3!V|L0Ta%>q){g)3BC_4D^0J}EaOwgvBtBpg;dAf<_UbqJR~W(
z4XE)I`{rugwSYT_nep(Sfui2gw>&J@^Ul*O)AG%A<)eV}(;HGM$IZFbZUSZJ$f3;J
zFK4_!2{(_qIgL-usu*W{6WpOlZ*$vO@}Ke{w8su(HN}s*i>tzz+-K3=)*a)S^G#V@
z$_g=Jp_s6hQnS$9j|sC{&c%dL>pUb~V3Nda5K2>7F78Uq%XxFptP8W)xvyG_&LVn9l+v6
zJ$d0vPQ$4vYeP$g@miDCdeUad4YZ-S-l|aGFRUuC=-1+sW00WlFT}>THq#Nga`{D`
zlwZ0&e(g=b|HgI0ziuwvs`71h!iY_}2d%)JVNb`gi_mW=izEA%&??s7*+ui2WF!fGt63*9m5!^`5DZl
zv3i(1JKeKy{2oLdBcSguba5Lr{mLdGZTN*y!cT;8}B0K-E{QpF#GbJ%k6?u
zJehj5_oURk)CsSs{}J>r`>?$KB2O{w)4XOsTTUO;{~X>g9Jue($@`|%MF~pXlDB;b
z&FHIaruBPa^DST#OPl&SusTwD3HqOeC3CDxv(mF=R=G4feewMJSbx45y~}fLzNVTF
z&gT(O)Cy*i(Rp3hJl$qUHW9TjqZ;%Vp9+|OkW=rzvq18AJ$ZSDhO3nDN6AzP)DDZ`(QkQwT7p$2DHrlPw~7T#=J`w35Tj!
zh10gI>0bpD)?(PZxc~b?lDqs~J-g5Mc6>`hR6346pWo#)-(IU59SkK_EMuDF!mj})
zhYB&Vxh%43{n3RLgc{!q(5vD{{fy6lPBnR5PpRe;sz+gcFdMfW@5rU(P_wKB{SAPA
zP2re)T++6&WJ)}*Vf@}?5bXioFZkaEd~t;jvF_?#gfT6Ezceo5;cJcX+fiV!()(UG
zJO;K=zP_?5svbx6rZKZcRhG0-8Es*#i&B!aK*+7uF9Pm+yK|qndwi>uIoaZTE3>0J
z*WKFT`Z1cs3INU8^MJi{lw?V0)3e?tj8rn>maoa-8d(i!J6lb^9`reY;w%eaqWIL3
zrcc=ozTHV0xg=W)`HsYru|j4hi+-Uo{|Tt|lgSlpnknCbT=_PvosGn@GR<n{FABl;|~Qh#34AexxCaaW|_$66BN<6=pi7tT(~
zYa;ht3(Vi%lU!vs=MnTj+qHvC261MlARldaH?5@dJNDvkRx-4E)ZwpL)vq=YMPg^vUkbI$2~kXwlxS
zA}Qo-H;e9>N8JH;S+t3(h%-e%b;^JE5~!}eN^9$shJGfIjL#V}WW6QrWB$h0l)F~R|BN8=TG8FM=0}0k-kzjM>!49o9_R=Y!;8OX
z{*{opkN>0SDW7w#vNXbY4=by=U!yqQW6_?M0?zu-3}qcFcg)MMir$!Jo(1T|Hf7pQ
zX4HhT+3h9fO6?DFA-;Fe!Fr@J+kXt2l|5JPJ*V;U?RM2^lXkDc=w)llQV_3v5#E*H
zN(xnbcwv@q4b;fYB)w@`B-A+_$XimdyAo#D9}c)L?$YO(_NLFxw6x3dFe~*?;Pb&A
zzm(~MdJ!pC>l1nvmt>SkSuW0YcUD#J`m_}Gqt*NdB)y_Yi{HJQ%UaT!Df|CboJQv_nTZv)&LdYl!W0#<&S#~|Jq
z&nYmjIEl=D-WTKXXyINjKZC_p`WWzz?QdEN&T8{VT^t24E$7c2Eu7f?{&zrHh^VwG
zf*I~RqNPWl*i~J{SK?K92<(YLY<}9=;m&kf-WIEJ--#E09uO6c4!w+eyiRM%&76OF
zjv)LJAc)dJ2>z#ZTqQpyr+e#b>8r2~wlk}4+FdEpsDtoT3az{
zdgSg?4DFWy?b>MVtE^N}53OHXrraTH(8$5`XIO))db{{ajKQx1gXi{*LE3`1>PELy
z*FLi@o|&{5i}wJFOCl^n9tfj%wgb(wlD5m9F~Za6mlFBE(c9~~y_L&{wC*pe3nZ2D
z`Vt^*!s|5t`Vz!ErQ`U9@xr1WMALVM<{nl=|6Eihu>GJ!^zVhSiKatK%m0+N5XJwT
zZGUz{>yY0%D{vIEeK=cv#*uyxwq8h0yCGfL@J2?UPevf!@=;Kp8_6BzCNU`QcsDEH
z9);ed|H`SUNZaJ?U01ix_}~oiF5VZN|5nuV8BgZck?VPjCcYB$E$BQ&STXN9
zYnj*4X=}sc1w7G-R;5*R@&NV&(DP&2f5zh+b)V@NFk^Uou@0ei_Xf~j91{q2K^PO@
zPH=il+-nurR#4Y4=V7lgmH#dv^}9pJw=5>W$2^s84%}?^MSLZO{9I@#(OjKXcRD|<
zaq~Kn*(2^m;Tc`_j#Srb{a--u|BMh(FeR{LnRY4aGhtTK{;i=Y7lx5oD|z>4kT>P)Mwd7q9+D~#8heNS7>|7^7L7HGpk>aNnW>BkGWn)&_N
z8u5F9gJfnrM~5(H<>$N>>xnp`R&R?I&+quR3m{nZ3&+*8Q0FPnlQf7ASiDi>rT^e7BA-6ql9ApM;
zPqF64{}e-fHXxQq6hm*7x|bHG)dTUn&LoYf@)3WH9|#`kM=Yc6m?g`c*^e5&L$De_Fam@LQP0ID%O%CE^N`dC)99
zWWHKGmeK1&K(8O}Vcb+7=B1vK|IWfJ(i75_ip99!?S>v*1jW*awx>}n*Erqf3P|sF
zY`{1i-Y%k1H?Or7ILEYEy|R|)R=kpw$@5NahpzuAmVB?oO24c-Lz1;+zM12MwBN!r
z9B8jH-(j)5IIqm=KXD6n(q_o0QE&^NT!1(la8d-b+)4>$mCrLg7wj;`MY>@ogp|d-
z`h;p{f?tJMUc_A%*K^;A!yXL|b2h2ZwINg|f%awmPc1-OKeS~it?YN^%h1P=l@{J9
z_|E`*RUY^d)sIC%`jOD#?vvO?d=B6`U$XhQ)n6>1wFaqEc=S7s|7E~qkf>vk{3lMK
zbSk<_7`zr3yr?HVn$LvRH{Nk@B`9PUsFFS*sWDFx{x5{ht)N95S2V}QAW{R2XS_+i
zqlZnM=XT8)F8Ofz1cUOusl`tvkko|z}Xq<6M!{5JxZ
zd@QSK{Iv0zceYpB`>gDwq;PRWeXD)iF9DwgD6anzy84y%sk$5lg=
z#WSFJtE**pgY+@~1o%LjleOPe;X4EO1wU{jDC%~`D_eY**xW(HpU9*J6-Yi
zw}2{2@5jo`ODY#()4T8<$(spSch1LcZcl~1hLUd(85y1}?o0Vl)@mI8hH<>NC+W}Z
zI5-ESGG9OVURX8uw}F*2h?kYORJjtdRhz#{vv)q=J6-M1UfKpK@)-!#AG!HhJQa?)
zi}I)3{Vi5d9)CYPupit;*%R-W3iD|i@#g_;qhgU;voi?d{O~_R(_Yu3;HLIcer>rH
zq0MOZJ4ILXzt%im1w9-`*vcX!(!bISj3{)l^2FvOrdGKk-
zSK3krfvZnwgv2LsGUB0k_CzILlDAs#0dz^-x;jYX^X&^il5h4!d?nU0Pl3D_tq%g(
zs?O*Wr~-}eV`#?