From 7a6d71c058a1fac05b038b72aac94db223507706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Mon, 11 Oct 2021 08:37:40 +0200 Subject: [PATCH] Fix Merge plugin usage (#14) --- Makefile | 3 ++ fixtures/vendor-bin/sub/composer.lock | 67 +++++++++++++++++---------- src/InheritancePlugin.php | 4 +- src/Merge/ExtraPackage.php | 2 +- src/Merge/PluginState.php | 2 +- 5 files changed, 50 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 1278c58..cef4c15 100644 --- a/Makefile +++ b/Makefile @@ -30,9 +30,12 @@ test: vendor fixtures/vendor fixtures/vendor-bin/sub/vendor vendor: composer update + touch $@ fixtures/vendor: composer update --working-dir fixtures --no-interaction ${COMPOSER_FLAGS} + touch $@ fixtures/vendor-bin/sub/vendor: composer update --working-dir fixtures/vendor-bin/sub --no-interaction ${COMPOSER_FLAGS} + touch $@ diff --git a/fixtures/vendor-bin/sub/composer.lock b/fixtures/vendor-bin/sub/composer.lock index 3a4eacb..4a21017 100644 --- a/fixtures/vendor-bin/sub/composer.lock +++ b/fixtures/vendor-bin/sub/composer.lock @@ -1,7 +1,7 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], "content-hash": "a2697ba1372bdcb8a714bf07352ac794", @@ -12,22 +12,26 @@ "source": { "type": "git", "url": "https://github.com/theofidry/composer-inheritance-plugin.git", - "reference": "2fa7015851f29ddfbb0d4e8b49b9722007c4000a" + "reference": "4bd31c5fde8999ac9a6b4048e5b249de38b5c134" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/composer-inheritance-plugin/zipball/2fa7015851f29ddfbb0d4e8b49b9722007c4000a", - "reference": "2fa7015851f29ddfbb0d4e8b49b9722007c4000a", + "url": "https://api.github.com/repos/theofidry/composer-inheritance-plugin/zipball/4bd31c5fde8999ac9a6b4048e5b249de38b5c134", + "reference": "4bd31c5fde8999ac9a6b4048e5b249de38b5c134", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": "^5.3.0 || ^7.0.0", - "wikimedia/composer-merge-plugin": "^1.3" + "composer-plugin-api": "^1.0 || ^2.0", + "php": "^7.2 || ^8.0", + "wikimedia/composer-merge-plugin": "^2.0" + }, + "conflict": { + "composer/composer": ">=2.0,<2.0.13" }, "require-dev": { - "composer/composer": "^1.0" + "composer/composer": "^1.0 || ^2.0" }, + "default-branch": true, "type": "composer-plugin", "extra": { "class": "Fidry\\Composer\\InheritancePlugin\\InheritancePlugin" @@ -48,42 +52,52 @@ } ], "description": "Composer plugin to merge multiple sub composer.json files", - "time": "2017-09-10T10:25:51+00:00" + "support": { + "issues": "https://github.com/theofidry/composer-inheritance-plugin/issues", + "source": "https://github.com/theofidry/composer-inheritance-plugin/tree/master" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2021-10-11T06:32:45+00:00" }, { "name": "wikimedia/composer-merge-plugin", - "version": "v1.4.1", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/wikimedia/composer-merge-plugin.git", - "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100" + "reference": "8ca2ed8ab97c8ebce6b39d9943e9909bb4f18912" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/81c6ac72a24a67383419c7eb9aa2b3437f2ab100", - "reference": "81c6ac72a24a67383419c7eb9aa2b3437f2ab100", + "url": "https://api.github.com/repos/wikimedia/composer-merge-plugin/zipball/8ca2ed8ab97c8ebce6b39d9943e9909bb4f18912", + "reference": "8ca2ed8ab97c8ebce6b39d9943e9909bb4f18912", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0", - "php": ">=5.3.2" + "composer-plugin-api": "^1.1||^2.0", + "php": ">=7.2.0" }, "require-dev": { - "composer/composer": "~1.0.0", - "jakub-onderka/php-parallel-lint": "~0.8", - "phpunit/phpunit": "~4.8|~5.0", - "squizlabs/php_codesniffer": "~2.1.0" + "composer/composer": "^1.1||^2.0", + "php-parallel-lint/php-parallel-lint": "~1.1.0", + "phpunit/phpunit": "^8.5||^9.0", + "squizlabs/php_codesniffer": "~3.5.4" }, "type": "composer-plugin", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "2.x-dev" }, - "class": "Wikimedia\\Composer\\MergePlugin" + "class": "Wikimedia\\Composer\\Merge\\V2\\MergePlugin" }, "autoload": { "psr-4": { - "Wikimedia\\Composer\\": "src/" + "Wikimedia\\Composer\\Merge\\V2\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -97,7 +111,11 @@ } ], "description": "Composer plugin to merge multiple composer.json files", - "time": "2017-04-25T02:31:25+00:00" + "support": { + "issues": "https://github.com/wikimedia/composer-merge-plugin/issues", + "source": "https://github.com/wikimedia/composer-merge-plugin/tree/v2.0.1" + }, + "time": "2021-02-24T05:28:06+00:00" } ], "packages-dev": [], @@ -109,5 +127,6 @@ "prefer-stable": false, "prefer-lowest": false, "platform": [], - "platform-dev": [] + "platform-dev": [], + "plugin-api-version": "2.1.0" } diff --git a/src/InheritancePlugin.php b/src/InheritancePlugin.php index f6ea983..ae0749c 100644 --- a/src/InheritancePlugin.php +++ b/src/InheritancePlugin.php @@ -15,8 +15,8 @@ use Composer\IO\IOInterface; use Composer\Package\Package; use Fidry\Composer\InheritancePlugin\Merge\PluginState; -use Wikimedia\Composer\Logger; -use Wikimedia\Composer\MergePlugin as WikimediaMergePlugin; +use Wikimedia\Composer\Merge\V2\Logger; +use Wikimedia\Composer\Merge\V2\MergePlugin as WikimediaMergePlugin; /** * @author Théo FIDRY diff --git a/src/Merge/ExtraPackage.php b/src/Merge/ExtraPackage.php index f73bc7b..c15d7d8 100644 --- a/src/Merge/ExtraPackage.php +++ b/src/Merge/ExtraPackage.php @@ -12,7 +12,7 @@ namespace Fidry\Composer\InheritancePlugin\Merge; use Fidry\Composer\InheritancePlugin\InheritancePlugin; -use Wikimedia\Composer\Merge\ExtraPackage as WikimediaExtraPackage; +use Wikimedia\Composer\Merge\V2\ExtraPackage as WikimediaExtraPackage; /** * @author Théo FIDRY diff --git a/src/Merge/PluginState.php b/src/Merge/PluginState.php index 920dc13..80dcc9e 100644 --- a/src/Merge/PluginState.php +++ b/src/Merge/PluginState.php @@ -11,7 +11,7 @@ namespace Fidry\Composer\InheritancePlugin\Merge; -use Wikimedia\Composer\Merge\PluginState as WikimediaPluginState; +use Wikimedia\Composer\Merge\V2\PluginState as WikimediaPluginState; /** * @author Théo FIDRY