Skip to content

Commit d4dbea4

Browse files
committed
feat: Properly support theme packages for release action
1 parent 5319ad2 commit d4dbea4

2 files changed

Lines changed: 30 additions & 4 deletions

File tree

src/Helper/Composer.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,8 +485,9 @@ protected function _setAuthors(WrapperHordeYml $package, stdClass $composerDefin
485485
*/
486486
protected function _setAutoload(WrapperHordeYml $package, stdClass $composerDefinition): void
487487
{
488-
// Extensions don't need PHP autoloading (they're compiled C code)
489-
if ($package['type'] === 'extension') {
488+
// Extensions and themes don't need PHP autoloading
489+
if (in_array($package['type'], ['extension', 'horde-theme'], true)) {
490+
$composerDefinition->autoload = new stdClass();
490491
return;
491492
}
492493

@@ -523,6 +524,9 @@ protected function _setAutoload(WrapperHordeYml $package, stdClass $composerDefi
523524
$composerDefinition->autoload['psr-4'] = [$Psr4Name => 'src/'];
524525
}
525526
}
527+
if (empty($composerDefinition->autoload)) {
528+
$composerDefinition->autoload = new stdClass();
529+
}
526530
}
527531
/**
528532
* Configure Autoloading
@@ -534,8 +538,9 @@ protected function _setAutoload(WrapperHordeYml $package, stdClass $composerDefi
534538
*/
535539
protected function _setAutoloadDev(WrapperHordeYml $package, stdClass $composerDefinition): void
536540
{
537-
// Extensions don't need PHP autoloading (they're compiled C code)
538-
if ($package['type'] === 'extension') {
541+
// Extensions and themes don't need PHP autoloading
542+
if (in_array($package['type'], ['extension', 'horde-theme'], true)) {
543+
$composerDefinition->{'autoload-dev'} = new stdClass();
539544
return;
540545
}
541546

src/Task/Release/AddChangelogEntryTask.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,31 @@ public function __construct(
6969
}
7070

7171

72+
/**
73+
* Component types that do not use doc/changelog.yml.
74+
*/
75+
private const TYPES_WITHOUT_CHANGELOG = [
76+
'horde-theme',
77+
];
78+
7279
public function getName(): string
7380
{
7481
return "Ad\1 \2hangelo\1 \2ntry";
7582
}
83+
84+
public function shouldSkip(Context $context): bool
85+
{
86+
$componentPath = $context->getComponentPath();
87+
$hordeYmlPath = $componentPath . '/.horde.yml';
88+
if (file_exists($hordeYmlPath)) {
89+
$hordeYml = new HordeYmlFile($hordeYmlPath);
90+
if (in_array($hordeYml->getType(), self::TYPES_WITHOUT_CHANGELOG, true)) {
91+
return true;
92+
}
93+
}
94+
return false;
95+
}
96+
7697
public function run(Context $context): Result
7798
{
7899
$componentPath = $context->getComponentPath();

0 commit comments

Comments
 (0)