diff --git a/code/nel/tools/pipeline/plugin_library/pipeline_process.h b/code/nel/tools/pipeline/plugin_library/pipeline_process.h index 260225748..68256407d 100644 --- a/code/nel/tools/pipeline/plugin_library/pipeline_process.h +++ b/code/nel/tools/pipeline/plugin_library/pipeline_process.h @@ -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 &inputPaths, const std::vector &outputPaths) = 0; + bool needsToBeRebuilt(const std::vector &inputPaths, const std::string &outputPath) { std::vector outputPaths; outputPaths.push_back(outputPath); return needsToBeRebuilt(inputPaths, outputPaths); } + bool needsToBeRebuilt(const std::string &inputPath, const std::vector &outputPaths) { std::vector inputPaths; inputPaths.push_back(inputPath); return needsToBeRebuilt(inputPaths, outputPaths); } + bool needsToBeRebuilt(const std::string &inputPath, const std::string &outputPath) { std::vector inputPaths; inputPaths.push_back(inputPath); std::vector 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 &inputPaths) = 0; + bool needsToBeRebuilt(const std::string &inputPath) { std::vector 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; diff --git a/code/nel/tools/pipeline/plugin_nel/process_interface.cpp b/code/nel/tools/pipeline/plugin_nel/process_interface.cpp index e97b4ceec..9d8f07732 100644 --- a/code/nel/tools/pipeline/plugin_nel/process_interface.cpp +++ b/code/nel/tools/pipeline/plugin_nel/process_interface.cpp @@ -29,6 +29,7 @@ #include "process_interface.h" // STL includes +#include // NeL includes #include @@ -50,10 +51,47 @@ CProcessInterface::~CProcessInterface() } +void CProcessInterface::buildAtlas(const std::vector &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 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"); } diff --git a/code/nel/tools/pipeline/plugin_nel/process_interface.h b/code/nel/tools/pipeline/plugin_nel/process_interface.h index 9220002fa..d69b95041 100644 --- a/code/nel/tools/pipeline/plugin_nel/process_interface.h +++ b/code/nel/tools/pipeline/plugin_nel/process_interface.h @@ -50,6 +50,8 @@ public: CProcessInterface(); virtual ~CProcessInterface(); + void buildAtlas(const std::vector &srcDirectories, const std::string &dstFile); + virtual void build(); NLMISC_DECLARE_CLASS(CProcessInterface) diff --git a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp index 141c86dd1..746e77195 100644 --- a/code/nel/tools/pipeline/service/module_pipeline_slave.cpp +++ b/code/nel/tools/pipeline/service/module_pipeline_slave.cpp @@ -524,7 +524,7 @@ public: { PIPELINE::IProcessHandler *processHandler = static_cast(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; diff --git a/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp b/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp index 009ccf9ce..078d50883 100644 --- a/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp +++ b/code/nel/tools/pipeline/service/pipeline_process_impl_toollog.cpp @@ -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 */