Added: #1440 Initial code for build_interface process

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 12 years ago
parent 656db83196
commit d3c1988edb

@ -89,8 +89,12 @@ public:
/// Find out if the plugin needs to rebuild. Input can be files or directories, output can only be files
virtual bool needsToBeRebuilt(const std::vector<std::string> &inputPaths, const std::vector<std::string> &outputPaths) = 0;
bool needsToBeRebuilt(const std::vector<std::string> &inputPaths, const std::string &outputPath) { std::vector<std::string> outputPaths; outputPaths.push_back(outputPath); return needsToBeRebuilt(inputPaths, outputPaths); }
bool needsToBeRebuilt(const std::string &inputPath, const std::vector<std::string> &outputPaths) { std::vector<std::string> inputPaths; inputPaths.push_back(inputPath); return needsToBeRebuilt(inputPaths, outputPaths); }
bool needsToBeRebuilt(const std::string &inputPath, const std::string &outputPath) { std::vector<std::string> inputPaths; inputPaths.push_back(inputPath); std::vector<std::string> outputPaths; outputPaths.push_back(outputPath); return needsToBeRebuilt(inputPaths, outputPaths); }
/// Find out if the plugin needs to rebuild. Input can only be files. Must request the service to write an .output metafile during depend log parsing.
virtual bool needsToBeRebuilt(const std::vector<std::string> &inputPaths) = 0;
bool needsToBeRebuilt(const std::string &inputPath) { std::vector<std::string> inputPaths; inputPaths.push_back(inputPath); return needsToBeRebuilt(inputPaths); }
/// Parse the depend and error logs. Only set writeOutputMeta true if the output is not known in advance by the plugin, see needsToBeRebuilt
virtual void parseToolLog(const std::string &dependLogFile, const std::string &errorLogFile, bool writeOutputMeta) = 0;

@ -29,6 +29,7 @@
#include "process_interface.h"
// STL includes
#include <sstream>
// NeL includes
#include <nel/misc/debug.h>
@ -50,10 +51,47 @@ CProcessInterface::~CProcessInterface()
}
void CProcessInterface::buildAtlas(const std::vector<std::string> &srcDirectories, const std::string &dstFile)
{
nldebug("Build atlas '%s'", dstFile.c_str());
}
void CProcessInterface::build()
{
nldebug("Building process interface!");
{
uint nb;
if (m_PipelineProcess->getValueNb(nb, "Interface.Atlas"))
{
for (uint i = 0; i < nb; ++i)
{
std::vector<std::string> srcDirectories;
{
std::stringstream ss;
ss << "Interface.Atlas[" << i << "].SrcDirectories";
if (!m_PipelineProcess->getValues(srcDirectories, ss.str())) break;
}
std::string dstFile;
{
std::stringstream ss;
ss << "Interface.Atlas[" << i << "].DstFile";
if (!m_PipelineProcess->getValue(dstFile, ss.str())) break;
}
// GO
if (m_PipelineProcess->needsToBeRebuilt(srcDirectories, dstFile))
{
// TODO
nldebug("Need to rebuild");
m_PipelineProcess->parseToolLog("", "", false);
}
else nldebug("Don't need to rebuild");
if (m_PipelineProcess->needsExit())
return;
}
}
}
m_PipelineProcess->setExit(FINISH_ERROR, "Not yet implemented");
}

@ -50,6 +50,8 @@ public:
CProcessInterface();
virtual ~CProcessInterface();
void buildAtlas(const std::vector<std::string> &srcDirectories, const std::string &dstFile);
virtual void build();
NLMISC_DECLARE_CLASS(CProcessInterface)

@ -524,7 +524,7 @@ public:
{
PIPELINE::IProcessHandler *processHandler = static_cast<PIPELINE::IProcessHandler *>(NLMISC::CClassRegistry::create(m_Slave->m_ActiveProcess->m_ActivePlugin.Handler));
processHandler->setPipelineProcess(m_Slave->m_ActiveProcess);
m_Slave->m_ActiveProcess->m_SubTaskResult = FINISH_NOT;
m_Slave->m_ActiveProcess->m_SubTaskResult = FINISH_SUCCESS;
processHandler->build();
}
break;

@ -47,7 +47,7 @@ namespace PIPELINE {
void CPipelineProcessImpl::parseToolLog(const std::string &dependLogFile, const std::string &errorLogFile, bool writeOutputMeta)
{
m_SubTaskResult = FINISH_SUCCESS;
}
} /* namespace PIPELINE */

Loading…
Cancel
Save