From ac478a58973087bb2b9c0dc0f31594c54c8a37b0 Mon Sep 17 00:00:00 2001 From: provokateurin Date: Fri, 15 Mar 2024 11:15:47 +0100 Subject: [PATCH] feat(capabilities): Extract core capabilities from OC Signed-off-by: provokateurin --- generate-spec | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/generate-spec b/generate-spec index d3e680d..9131bda 100755 --- a/generate-spec +++ b/generate-spec @@ -159,14 +159,20 @@ if (file_exists($definitionsPath)) { $capabilities = null; $publicCapabilities = null; -$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($sourceDir)); $capabilitiesFiles = []; -foreach ($iterator as $file) { - $path = $file->getPathname(); - if (!str_ends_with($path, ".php")) { - continue; +$capabilitiesDirs = [$sourceDir]; +if ($appIsCore) { + $capabilitiesDirs[] = $sourceDir . '/../lib/private'; +} +foreach ($capabilitiesDirs as $dir) { + $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir)); + foreach ($iterator as $file) { + $path = $file->getPathname(); + if (!str_ends_with($path, ".php")) { + continue; + } + $capabilitiesFiles[] = $path; } - $capabilitiesFiles[] = $path; } sort($capabilitiesFiles); foreach ($capabilitiesFiles as $path) {