diff --git a/cli/version_set_platform.php b/cli/version_set_platform.php index 8e9a4c7..4752b45 100644 --- a/cli/version_set_platform.php +++ b/cli/version_set_platform.php @@ -64,16 +64,32 @@ if ($suffix !== '' && !str_ends_with($version, $suffix)) { $root = realpath($path) ?: $path; -// Detect platform +// Detect platform — check manifest.xml first, then legacy .mokostandards $platform = ''; -$mokoStandards = "{$root}/.github/.mokostandards"; -if (!file_exists($mokoStandards)) { - $mokoStandards = "{$root}/.mokostandards"; + +// New format: .mokogitea/manifest.xml (XML with tag) +$manifestXml = "{$root}/.mokogitea/manifest.xml"; +if (file_exists($manifestXml)) { + $xml = @simplexml_load_file($manifestXml); + if ($xml && isset($xml->governance->platform)) { + $platform = (string) $xml->governance->platform; + } } -if (file_exists($mokoStandards)) { - $content = file_get_contents($mokoStandards); - if (preg_match('/^platform:\s*(.+)/m', $content, $m)) { - $platform = trim($m[1], " \t\n\r\"'"); + +// Legacy: .mokostandards YAML file +if (empty($platform)) { + $mokoStandards = "{$root}/.github/.mokostandards"; + if (!file_exists($mokoStandards)) { + $mokoStandards = "{$root}/.mokogitea/.mokostandards"; + } + if (!file_exists($mokoStandards)) { + $mokoStandards = "{$root}/.mokostandards"; + } + if (file_exists($mokoStandards)) { + $content = file_get_contents($mokoStandards); + if (preg_match('/^platform:\s*(.+)/m', $content, $m)) { + $platform = trim($m[1], " \t\n\r\"'"); + } } } @@ -116,7 +132,7 @@ if ($platform === 'crm-module') { } // Joomla: in XML manifests -if ($platform === 'waas-component') { +if (in_array($platform, ['waas-component', 'joomla'], true)) { foreach (glob("{$root}/src/*.xml") ?: glob("{$root}/*.xml") ?: [] as $file) { $content = file_get_contents($file); if (!str_contains($content, '