Update to support composer-plugin-api v2
This adds support(*) for the upcoming composer v2.
Background:
- https://github.com/composer/composer/issues/8726
- https://github.com/composer/composer/blob/master/UPGRADE-2.0.md#for-integrators-and-plugin-authors
- core#2015 (closed)
The question is whether this works. I believe it does, but the test suite results are mixed:
-
Both
tests/Integration/CustomPathsTest.php
andtests/Integration/DefaultPathsTest.php
pass. -
There's an issue with
tests/Integration/LifecycleTest.php
, but this patch - and the composer version - don't seem relevant. The tests passes on my Macbook but not my Linux box.1) Civi\AssetPlugin\Integration\LifecycleTest::testFileModes readlink(): No such file or directory /home/totten/src/civicrm-asset-plugin/tests/Integration/IntegrationTestCase.php:122 /home/totten/src/civicrm-asset-plugin/tests/Integration/LifecycleTest.php:50
-
tests/Integration/DrupalProjectPathsTest.php
has failures. I believe the problem is that other plugins (iedrupal-scaffold
) are not yet compatible.Your requirements could not be resolved to an installable set of packages. Problem 1 - drupal-composer/drupal-scaffold[2.5.0, ..., 2.6.1] require composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint. - Root composer.json requires drupal-composer/drupal-scaffold ^2.5 -> satisfiable by drupal-composer/drupal-scaffold[2.5.0, ..., 2.6.1]. You are using a snapshot build of Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report an issue to them to ask them to support Composer 2. To work around this you can run Composer with --ignore-platform-req=composer-plugin-api, but this may result in broken plugins and bigger problems down the line.
So I guess the question is whether there's any downside to asserting that civicrm-asset-plugin
is v2-compatible when we can't yet do a realistic E2E test.