Added: #1440 Dependencies between projects

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent ab873d8d0b
commit aa5c4c16f3

@ -32,6 +32,7 @@
// NeL includes
#include <nel/misc/debug.h>
#include <nel/misc/path.h>
// Project includes
#include "pipeline_workspace.h"
@ -146,7 +147,36 @@ void CBuildTaskQueue::loadQueue(CPipelineWorkspace *workspace, bool bypassDepend
}
}
// TODO_TODO_TODO Dependencies between projects *************************************************************************
// Dependencies between projects
for (std::map<std::string, CPipelineProject *>::const_iterator pr_it = projects.begin(), pr_end = projects.end(); pr_it != pr_end; ++pr_it)
{
const std::string &projectName = pr_it->first;
CPipelineProject *project = pr_it->second;
std::map<uint32, CBuildTaskInfo *> &builtTaskByPlugin = builtTaskByProjectAndPlugin[projectName];
std::vector<std::string> dependentProjects;
project->getValues(dependentProjects, "DependentProjects");
for (std::vector<std::string>::iterator it2 = dependentProjects.begin(), end2 = dependentProjects.end(); it2 != end2; ++it2)
{
const std::string &dependentProject = NLMISC::CFile::getFilenameWithoutExtension(*it2);
std::map<std::string, std::map<uint32, CBuildTaskInfo *> >::iterator dependencyTasksIt = builtTaskByProjectAndPlugin.find(dependentProject);
if (dependencyTasksIt == builtTaskByProjectAndPlugin.end())
{
nlwarning("Project '%s' depends on project '%s' which does not exist in this workspace", projectName.c_str(), dependentProject.c_str());
}
else
{
for (std::map<uint32, CBuildTaskInfo *>::iterator cur_it = builtTaskByPlugin.begin(), cur_end = builtTaskByPlugin.end(); cur_it != cur_end; ++cur_it)
{
CBuildTaskInfo *currentTask = cur_it->second;
for (std::map<uint32, CBuildTaskInfo *>::iterator dep_it = dependencyTasksIt->second.begin(), dep_end = dependencyTasksIt->second.end(); dep_it != dep_end; ++dep_it)
{
currentTask->Dependencies.push_back(dep_it->second->Id.Sub.Task);
}
}
}
}
}
m_Mutex.unlock();
}
@ -400,7 +430,7 @@ void CBuildTaskQueue::sortBuildableTaskListByMostWaitingDependents(std::vector<C
do
{
sc = 0;
for (std::vector<uint>::size_type i = 0; i < dependentsCache.size() - 1; ++i)
for (ptrdiff_t i = 0; i < (ptrdiff_t)dependentsCache.size() - 1; ++i)
{
if (dependentsCache[i + 1] > dependentsCache[i])
{

@ -68,7 +68,7 @@ bool CPipelineProject::getValue(std::string &result, const std::string &name)
}
if (!valueElm)
{
nlwarning("Node '%s' not found in '%s', valueElm returned NULL, probably using default value", name.c_str(), m_Form->getFilename().c_str());
nlwarning("Node '%s' not found in '%s', valueElm NULL, probably using default value", name.c_str(), m_Form->getFilename().c_str());
return false;
}
std::string value;
@ -100,6 +100,11 @@ bool CPipelineProject::getValues(std::vector<std::string> &resultAppend, const s
nlwarning("Node '%s' not found in '%s'", name.c_str(), m_Form->getFilename().c_str());
return false;
}
if (!elm)
{
nlwarning("Node '%s' not found in '%s', elm NULL, probably using default value", name.c_str(), m_Form->getFilename().c_str());
return false;
}
uint size;
if (!elm->getArraySize(size))
{

@ -22,6 +22,12 @@
<ATOM Name="Handler" Value="CProcessTextureDDS"/>
<ATOM Name="Info" Value="CProcessTextureDDSInfo"/>
</STRUCT>
<STRUCT>
<ATOM Name="Description" Value="Builds a big nel package"/>
<ATOM Name="Process" Value="PackageBNP"/>
<ATOM Name="Handler" Value="CProcessPackageBNP"/>
<ATOM Name="Info" Value="CProcessPackageBNPInfo"/>
</STRUCT>
</ARRAY>
</STRUCT>
<STRUCT/>
@ -50,5 +56,10 @@ Sat Aug 04 15:33:08 2012 (kaetemi) .ProcessHandlers[2].Description = Builds comp
Sat Aug 04 15:33:08 2012 (kaetemi) .ProcessHandlers[2].Handler = CProcessTextureDDS
Sat Aug 04 15:33:08 2012 (kaetemi) .ProcessHandlers[2].Info = CProcessTextureDDSInfo
Sat Aug 04 15:33:08 2012 (kaetemi) .ProcessHandlers[2].Process = TextureDDS
Sat Aug 04 15:33:08 2012 (kaetemi) formName Resized = 3</LOG>
Sat Aug 04 15:33:08 2012 (kaetemi) formName Resized = 3
Sat Aug 04 21:08:26 2012 (kaetemi) .ProcessHandlers[3].Description = Builds a big nel package
Sat Aug 04 21:08:26 2012 (kaetemi) .ProcessHandlers[3].Handler = CProcessPackageBNP
Sat Aug 04 21:08:26 2012 (kaetemi) .ProcessHandlers[3].Info = CProcessPackageBNPInfo
Sat Aug 04 21:08:26 2012 (kaetemi) .ProcessHandlers[3].Process = PackageBNP
Sat Aug 04 21:08:26 2012 (kaetemi) formName Resized = 4</LOG>
</FORM>

@ -4,6 +4,7 @@
<ATOM Name="Description" Value="Ryzom Core"/>
<ARRAY Name="Projects">
<ATOM Value="common_interface.pipeline_project"/>
<ATOM Value="interfaces.pipeline_package"/>
</ARRAY>
<ARRAY Name="Plugins">
<ATOM Value="plugin_nel.pipeline_plugin"/>
@ -22,5 +23,9 @@ Sat Feb 18 23:23:17 2012 (Kaetemi) .Description = Ryzom Core Test
Sat Feb 18 23:23:26 2012 (Kaetemi) .Description = Ryzom Core
Sat Mar 03 10:58:02 2012 (Kaetemi) .Plugins[0] = plugin_nel.pipeline_plugin
Sat Mar 03 10:58:02 2012 (Kaetemi) .Plugins[1] = plugin_max.pipeline_plugin
Sat Mar 03 10:58:02 2012 (Kaetemi) formName Resized = 2</LOG>
Sat Mar 03 10:58:02 2012 (Kaetemi) formName Resized = 2
Sat Aug 04 21:04:25 2012 (kaetemi) .Projects[1] = interfaces.pipeline_package
Sat Aug 04 21:04:25 2012 (kaetemi) formName Resized = 2
Sat Aug 04 21:09:02 2012 (kaetemi) .Projects[0] = interfaces.pipeline_package
Sat Aug 04 21:09:02 2012 (kaetemi) .Projects[1] = common_interface.pipeline_project</LOG>
</FORM>

Loading…
Cancel
Save