Replaced target architecture with target family in TDF build scripts
This commit is contained in:
@@ -4,6 +4,8 @@ namespace Bloom\BuildScripts\TargetDescriptionFiles;
|
||||
use Bloom\BuildScripts\TargetDescriptionFiles\Avr8\Avr8TargetDescriptionFile;
|
||||
|
||||
require_once __DIR__ . "/TargetDescriptionFile.php";
|
||||
require_once __DIR__ . "/TargetFamily.php";
|
||||
|
||||
require_once __DIR__ . "/AVR8/Avr8TargetDescriptionFile.php";
|
||||
|
||||
class Factory
|
||||
@@ -18,7 +20,7 @@ class Factory
|
||||
{
|
||||
$tdf = new TargetDescriptionFile($filePath);
|
||||
|
||||
if ($tdf->targetArchitecture == TargetDescriptionFile::ARCHITECTURE_AVR8) {
|
||||
if ($tdf->targetFamily == TargetFamily::AVR_8) {
|
||||
return new Avr8TargetDescriptionFile($filePath);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,15 +15,12 @@ require_once __DIR__ . "/Pinout.php";
|
||||
|
||||
class TargetDescriptionFile
|
||||
{
|
||||
const ARCHITECTURE_AVR8 = 'AVR8';
|
||||
|
||||
public string $filePath;
|
||||
public ?SimpleXMLElement $xml = null;
|
||||
|
||||
public ?string $targetName = null;
|
||||
public ?TargetFamily $targetFamily = null;
|
||||
public ?string $configurationValue = null;
|
||||
public ?string $targetArchitecture = null;
|
||||
|
||||
/** @var string[] */
|
||||
public array $deviceAttributesByName = [];
|
||||
@@ -80,11 +77,6 @@ class TargetDescriptionFile
|
||||
if (!empty($this->deviceAttributesByName['family'])) {
|
||||
$this->targetFamily = TargetFamily::tryFrom($device['family']);
|
||||
}
|
||||
|
||||
if (!empty($this->deviceAttributesByName['architecture'])) {
|
||||
$this->targetArchitecture = stristr($device['architecture'], 'avr') !== false
|
||||
? self::ARCHITECTURE_AVR8 : $device['architecture'];
|
||||
}
|
||||
}
|
||||
|
||||
$this->loadVariants();
|
||||
@@ -474,10 +466,6 @@ class TargetDescriptionFile
|
||||
$failures[] = 'Missing/invalid target family';
|
||||
}
|
||||
|
||||
if (empty($this->targetArchitecture)) {
|
||||
$failures[] = 'Target architecture not found';
|
||||
}
|
||||
|
||||
if (empty($this->variants)) {
|
||||
$failures[] = 'Missing target variants';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user