Author: mpiulachs
Date: Thu Nov 15 23:09:52 2007
New Revision: 30469
URL:
http://svn.reactos.org/svn/reactos?rev=30469&view=rev
Log:
Implement a new way to build only the required parts of the reactos codebase partly
inspired by bug 2568.
Introduced the concept of module "family" and "buildfamilies"
Any module can belong to an N number of families for example the 'calc' win32 gui
module:
<module name="calc" type="win32gui"
installbase="system32" installname="calc.exe">
(..)
<family>applications</family>
<family>guiapplications</family>
(..)
and the 'solitaire' win32 gui module:
<module name="sol" type="win32gui" installbase="system32"
installname="sol.exe" unicode="no" allowwarnings="true">
(..)
<family>applications</family>
<family>guiapplications</family>
<family>games</family>
(..)
now is possible to type on the rosbe console:
make applications (calc and sol and all its
dependencies will be build)
make applications_clean (calc and sol clean target will be executed)
make games (sol and any other member of the games family will be build)
It works in conjunction with the new \buildfamilies.rbuild. In a properly tagged codebase
the developer has the option to build only the parts of the operating system he is
currently working on without having to clean and recompile the whole codebase every time.
All required dependencies will be also automatically compiled.
Added:
branches/rbuild/reactos/buildfamilies.rbuild (with props)
Modified:
branches/rbuild/reactos/ReactOS-generic.rbuild
branches/rbuild/reactos/base/applications/calc/calc.rbuild
branches/rbuild/reactos/base/applications/charmap/charmap.rbuild
branches/rbuild/reactos/base/applications/cmdutils/more/more.rbuild
branches/rbuild/reactos/base/applications/games/solitaire/solitaire.rbuild
branches/rbuild/reactos/base/applications/screensavers/cylfrac/cylfrac.rbuild
branches/rbuild/reactos/base/applications/screensavers/starfield/starfield.rbuild
branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp
branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.h
branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h
branches/rbuild/reactos/tools/rbuild/module.cpp
branches/rbuild/reactos/tools/rbuild/project.cpp
branches/rbuild/reactos/tools/rbuild/rbuild.h
branches/rbuild/reactos/tools/rbuild/rbuild.vcproj
Modified: branches/rbuild/reactos/ReactOS-generic.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/ReactOS-generic.…
==============================================================================
--- branches/rbuild/reactos/ReactOS-generic.rbuild (original)
+++ branches/rbuild/reactos/ReactOS-generic.rbuild Thu Nov 15 23:09:52 2007
@@ -2,6 +2,7 @@
<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
<group
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="baseaddress.rbuild" />
+ <xi:include href="buildfamilies.rbuild" />
<xi:include href="contributors.rbuild" />
<xi:include href="installfolders.rbuild" />
<xi:include href="languages.rbuild" />
Modified: branches/rbuild/reactos/base/applications/calc/calc.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/base/application…
==============================================================================
--- branches/rbuild/reactos/base/applications/calc/calc.rbuild (original)
+++ branches/rbuild/reactos/base/applications/calc/calc.rbuild Thu Nov 15 23:09:52 2007
@@ -7,6 +7,8 @@
<define name="WINVER">0x0501</define>
<define name="UNICODE" />
<define name="_UNICODE" />
+ <family>applications</family>
+ <family>guiapplications</family>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
Modified: branches/rbuild/reactos/base/applications/charmap/charmap.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/base/application…
==============================================================================
--- branches/rbuild/reactos/base/applications/charmap/charmap.rbuild (original)
+++ branches/rbuild/reactos/base/applications/charmap/charmap.rbuild Thu Nov 15 23:09:52
2007
@@ -5,6 +5,8 @@
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
+ <family>applications</family>
+ <family>guiapplications</family>
<library>ntdll</library>
<library>gdi32</library>
<library>kernel32</library>
Modified: branches/rbuild/reactos/base/applications/cmdutils/more/more.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/base/application…
==============================================================================
--- branches/rbuild/reactos/base/applications/cmdutils/more/more.rbuild (original)
+++ branches/rbuild/reactos/base/applications/cmdutils/more/more.rbuild Thu Nov 15
23:09:52 2007
@@ -4,6 +4,8 @@
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
+ <family>applications</family>
+ <family>cuiapplications</family>
<library>kernel32</library>
<library>ntdll</library>
<library>user32</library>
Modified: branches/rbuild/reactos/base/applications/games/solitaire/solitaire.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/base/application…
==============================================================================
--- branches/rbuild/reactos/base/applications/games/solitaire/solitaire.rbuild (original)
+++ branches/rbuild/reactos/base/applications/games/solitaire/solitaire.rbuild Thu Nov 15
23:09:52 2007
@@ -7,6 +7,9 @@
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0501</define>
<define name="_WIN32_WINNT">0x0501</define>
+ <family>applications</family>
+ <family>guiapplications</family>
+ <family>games</family>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
Modified: branches/rbuild/reactos/base/applications/screensavers/cylfrac/cylfrac.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/base/application…
==============================================================================
--- branches/rbuild/reactos/base/applications/screensavers/cylfrac/cylfrac.rbuild
(original)
+++ branches/rbuild/reactos/base/applications/screensavers/cylfrac/cylfrac.rbuild Thu Nov
15 23:09:52 2007
@@ -4,6 +4,8 @@
<define name="__USE_W32API" />
<define name="UNICODE" />
<define name="_UNICODE" />
+
+ <family>screensavers</family>
<library>kernel32</library>
<library>user32</library>
Modified:
branches/rbuild/reactos/base/applications/screensavers/starfield/starfield.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/base/application…
==============================================================================
--- branches/rbuild/reactos/base/applications/screensavers/starfield/starfield.rbuild
(original)
+++ branches/rbuild/reactos/base/applications/screensavers/starfield/starfield.rbuild Thu
Nov 15 23:09:52 2007
@@ -4,6 +4,8 @@
<define name="__USE_W32API" />
<define name="UNICODE" />
<define name="_UNICODE" />
+
+ <family>screensavers</family>
<library>kernel32</library>
<library>user32</library>
Added: branches/rbuild/reactos/buildfamilies.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/buildfamilies.rb…
==============================================================================
--- branches/rbuild/reactos/buildfamilies.rbuild (added)
+++ branches/rbuild/reactos/buildfamilies.rbuild Thu Nov 15 23:09:52 2007
@@ -1,0 +1,12 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE group SYSTEM "tools/rbuild/project.dtd">
+<group
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <buildfamily name="screensavers" />
+ <buildfamily name="core" />
+ <buildfamily name="drivers" />
+ <buildfamily name="kernel" />
+ <buildfamily name="applications" />
+ <buildfamily name="guiapplications" />
+ <buildfamily name="cuiapplications" />
+ <buildfamily name="games" />
+</group>
Propchange: branches/rbuild/reactos/buildfamilies.rbuild
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/bac…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp (original)
+++ branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.cpp Thu Nov 15 23:09:52 2007
@@ -285,6 +285,7 @@
h.GenerateCleanTarget ();
h.GenerateInstallTarget ();
h.GenerateDependsTarget ();
+ h.GenerateFamiliesTarget ();
delete v[i];
}
@@ -576,7 +577,40 @@
}
fprintf ( fMakefile, "\n\t\n\n" );
}
-
+/*
+void
+MingwBackend::GenerateFamiliesTarget () const
+{
+ for ( size_t i = 0; i < ProjectNode.buildfamilies.size (); i++ )
+ {
+ BuildFamily& buildfamily = *ProjectNode.buildfamilies[i];
+ fprintf ( fMakefile,
+ "%s:",
+ buildfamily.name.c_str () );
+
+ for ( size_t i = 0; i < ProjectNode.modules.size (); i++ )
+ {
+ Module& module = *ProjectNode.modules[i];
+ if ( !module.enabled )
+ continue;
+
+ for ( size_t i = 0; i < module.families.size (); i++ )
+ {
+ Family& family = *module.families[i];
+
+ if (family.name == buildfamily.name)
+ {
+ fprintf ( fMakefile,
+ " %s",
+ GetTargetMacro(module).c_str () );
+ }
+ }
+ }
+ }
+
+ fprintf ( fMakefile, "\n\t\n\n" );
+}
+*/
string
MingwBackend::GetBuildToolDependencies () const
{
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.h
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/bac…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.h (original)
+++ branches/rbuild/reactos/tools/rbuild/backend/mingw/mingw.h Thu Nov 15 23:09:52 2007
@@ -76,7 +76,8 @@
bool IncludeInAllTarget ( const Module& module ) const;
void GenerateAllTarget ( const std::vector<MingwModuleHandler*>& handlers )
const;
std::string GetBuildToolDependencies () const;
- void GenerateInitTarget () const;
+ void GenerateFamiliesTarget() const;
+ void GenerateInitTarget () const;
void GenerateRegTestsRunTarget () const;
void GenerateXmlBuildFilesMacro() const;
std::string GetBin2ResExecutable ();
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/bac…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Thu Nov 15
23:09:52 2007
@@ -557,6 +557,28 @@
}
void
+MingwModuleHandler::GenerateFamiliesTarget () const
+{
+ if ( module.type == Alias )
+ return;
+
+ for ( size_t i = 0; i < module.families.size (); i++ )
+ {
+ Family& family = *module.families[i];
+
+ fprintf ( fMakefile,
+ "%s: %s\n",
+ family.name.c_str() ,
+ GetTargetMacro(module).c_str () );
+
+ fprintf ( fMakefile,
+ "%s_clean: %s_clean\n",
+ family.name.c_str() ,
+ module.name.c_str () );
+ }
+}
+
+void
MingwModuleHandler::GenerateCleanTarget () const
{
if ( module.type == Alias )
Modified: branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/bac…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h (original)
+++ branches/rbuild/reactos/tools/rbuild/backend/mingw/modulehandler.h Thu Nov 15 23:09:52
2007
@@ -74,6 +74,7 @@
void GenerateCleanTarget () const;
void GenerateInstallTarget () const;
void GenerateDependsTarget () const;
+ void GenerateFamiliesTarget () const;
static bool ReferenceObjects ( const Module& module );
virtual void AddImplicitLibraries ( Module& module ) { return; }
Modified: branches/rbuild/reactos/tools/rbuild/module.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/mod…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/module.cpp (original)
+++ branches/rbuild/reactos/tools/rbuild/module.cpp Thu Nov 15 23:09:52 2007
@@ -687,6 +687,17 @@
else
non_if_data.defines.push_back ( pDefine );
subs_invalid = true;
+ }
+ else if ( e.name == "family" )
+ {
+ if ( parseContext.ifData )
+ {
+ throw XMLInvalidBuildFileException (
+ e.location,
+ "<family> is not a valid sub-element of <if>" );
+ }
+ families.push_back ( new Family ( e , *this) );
+ subs_invalid = false;
}
else if ( e.name == "metadata" )
{
@@ -1632,6 +1643,19 @@
{
}
+BuildFamily::BuildFamily ( const XMLElement& _node)
+ : node (_node)
+{
+ const XMLAttribute* att = _node.GetAttribute ( "name", true );
+ assert(att);
+ name = att->value;
+}
+
+void
+BuildFamily::ProcessXML()
+{
+}
+
Language::Language ( const XMLElement& _node)
: node (_node)
{
@@ -1643,6 +1667,30 @@
void
Language::ProcessXML()
{
+}
+
+Family::Family ( const XMLElement& _node,
+ const Module& _module )
+ : node (_node),
+ module (_module)
+{
+ ProcessXML ();
+}
+
+void
+Family::ProcessXML()
+{
+ const BuildFamily* family = module.project.LocateFamily ( node.value );
+ if ( family == NULL )
+ {
+ throw XMLInvalidBuildFileException (
+ node.location,
+ "module '%s' references a no existant family '%s'",
+ module.name.c_str(),
+ node.value.c_str() );
+ }
+
+ name = node.value;
}
Contributor::Contributor ( const XMLElement& _node)
Modified: branches/rbuild/reactos/tools/rbuild/project.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/pro…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/project.cpp (original)
+++ branches/rbuild/reactos/tools/rbuild/project.cpp Thu Nov 15 23:09:52 2007
@@ -512,11 +512,17 @@
installfiles.push_back ( installfile );
subs_invalid = true;
}
+ else if ( e.name == "buildfamily" )
+ {
+ BuildFamily* buildfamily = new BuildFamily ( e );
+ buildfamilies.push_back ( buildfamily );
+ subs_invalid = false;
+ }
else if ( e.name == "language" )
{
Language* language = new Language ( e );
languages.push_back ( language );
- subs_invalid = true;
+ subs_invalid = false;
}
else if ( e.name == "contributor" )
{
@@ -639,6 +645,18 @@
return NULL;
}
+const BuildFamily*
+Project::LocateFamily ( const string& name ) const
+{
+ for ( size_t i = 0; i < buildfamilies.size (); i++ )
+ {
+ if ( buildfamilies[i]->name == name )
+ return buildfamilies[i];
+ }
+
+ return NULL;
+}
+
const Contributor*
Project::LocateContributor ( const string& alias ) const
{
Modified: branches/rbuild/reactos/tools/rbuild/rbuild.h
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/rbu…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/rbuild.h (original)
+++ branches/rbuild/reactos/tools/rbuild/rbuild.h Thu Nov 15 23:09:52 2007
@@ -120,6 +120,8 @@
class InstallComponent;
class InstallFolder;
class BaseAdress;
+class BuildFamily;
+class Family;
typedef std::map<std::string,Directory*> directory_map;
@@ -271,6 +273,7 @@
std::vector<CDFile*> cdfiles;
std::vector<BootstrapFile*> bootstrapfiles;
std::vector<InstallFile*> installfiles;
+ std::vector<BuildFamily*> buildfamilies;
std::vector<Module*> modules;
std::vector<Language*> languages;
std::vector<Contributor*> contributors;
@@ -289,6 +292,7 @@
ArchitectureType architectureType;
void ProcessXML ( const std::string& path );
Module* LocateModule ( const std::string& name );
+ const BuildFamily* LocateFamily ( const std::string& name ) const;
const Contributor* LocateContributor ( const std::string& alias ) const;
const Module* LocateModule ( const std::string& name ) const;
const std::string& GetProjectFilename () const;
@@ -400,6 +404,7 @@
Bootstrap* bootstrap;
AutoRegister* autoRegister; // <autoregister> node
IfableData non_if_data;
+ std::vector<Family*> families;
std::vector<Author*> authors;
std::vector<Invoke*> invocations;
std::vector<Localization*> localizations;
@@ -606,6 +611,30 @@
Metadata ( const XMLElement& _node,
const Module& _module );
+
+ void ProcessXML();
+};
+
+class BuildFamily
+{
+public:
+ const XMLElement& node;
+ std::string name;
+
+ BuildFamily ( const XMLElement& node );
+
+ void ProcessXML();
+};
+
+class Family
+{
+public:
+ const XMLElement& node;
+ const Module& module;
+ std::string name;
+
+ Family ( const XMLElement& node ,
+ const Module& _module );
void ProcessXML();
};
Modified: branches/rbuild/reactos/tools/rbuild/rbuild.vcproj
URL:
http://svn.reactos.org/svn/reactos/branches/rbuild/reactos/tools/rbuild/rbu…
==============================================================================
--- branches/rbuild/reactos/tools/rbuild/rbuild.vcproj (original)
+++ branches/rbuild/reactos/tools/rbuild/rbuild.vcproj Thu Nov 15 23:09:52 2007
@@ -684,6 +684,10 @@
</FileConfiguration>
</File>
<File
+ RelativePath=".\creditsgenerator.cpp"
+ >
+ </File>
+ <File
RelativePath="define.cpp"
<FileConfiguration
@@ -1328,10 +1332,6 @@
</File>
</Filter>
- <File
- RelativePath=".\creditsgenerator.cpp"
- >
- </File>
</Files>
<Globals>
</Globals>