From b5b11311a2ab20c3cbee032c836385ef5b5440f8 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 13 Mar 2018 15:08:32 +1300 Subject: [PATCH] BUG Fix non-library modules fixing their dependencies on tag --- src/Steps/Release/PublishRelease.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Steps/Release/PublishRelease.php b/src/Steps/Release/PublishRelease.php index 21888bd..c9b68d4 100644 --- a/src/Steps/Release/PublishRelease.php +++ b/src/Steps/Release/PublishRelease.php @@ -124,14 +124,18 @@ protected function stabiliseRequirements(OutputInterface $output, LibraryRelease $items = $this->getReleasePlan()->getAllItems(); foreach ($items as $item) { $childName = $item->getLibrary()->getName(); - // Only rewrite actual dependencies - if (isset($composerData['require'][$childName])) { - $composerData['require'][$childName] = $this->stabiliseDependencyRequirement( - $output, - $item, - $constraintType - ); + + // Ensure this library is allowed to release this dependency (even if shared) + if (!isset($composerData['require'][$childName]) || !$parentLibrary->isChildLibrary($childName)) { + continue; } + + // Update dependency + $composerData['require'][$childName] = $this->stabiliseDependencyRequirement( + $output, + $item, + $constraintType + ); } // Save modifications to the composer.json for this module