- Began refactoring TDF build scripts

- Separated TDF validation and mapping generation
- Moving away from the JSON mapping file, to a generated header file containing the TDF mapping.
- Other bits of tidying
This commit is contained in:
Nav
2023-12-12 23:19:21 +00:00
parent 275885e6ec
commit ec51a21846
10 changed files with 273 additions and 189 deletions

View File

@@ -12,6 +12,8 @@
#include "Pinout.hpp"
#include "Interface.hpp"
#include GENERATED_TDF_MAPPING_PATH
namespace Targets::TargetDescription
{
/**
@@ -36,24 +38,33 @@ namespace Targets::TargetDescription
class TargetDescriptionFile
{
public:
/**
* Returns a mapping of target configuration values to instances of the GeneratedMapping::BriefTargetDescriptor
* struct.
*
* The mapping is generated pre-build.
*
* The GeneratedMapping::BriefTargetDescriptor struct holds some brief info about a particular target, such as
* target name, family and TDF path. See the GeneratedMapping.hpp.in template for more.
*
* @return
*/
static const std::map<std::string, GeneratedMapping::BriefTargetDescriptor>& mapping();
/**
* Will construct a TargetDescriptionFile instance from the XML of a target description file, the path to which
* is given via xmlFilePath.
*
* @param xmlFilePath
*/
explicit TargetDescriptionFile(const QString& xmlFilePath) {
this->init(xmlFilePath);
}
explicit TargetDescriptionFile(const QString& xmlFilePath);
/**
* Will construct a TargetDescriptionFile instance from pre-loaded XML.
*
* @param xml
*/
explicit TargetDescriptionFile(const QDomDocument& xml) {
this->init(xml);
}
explicit TargetDescriptionFile(const QDomDocument& xml);
/**
* Returns the target name extracted from the TDF.