Skip to content

Commit e6392ca

Browse files
authored
Support composer 2 (#22)
* Support composer 2 * Testing with D9 only
1 parent 06d5288 commit e6392ca

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ language: php
77
sudo: false
88

99
php:
10-
- 7.1
11-
- 7.2
1210
- 7.3
11+
- 7.4
1312

1413
matrix:
1514
fast_finish: true
@@ -25,26 +24,26 @@ env:
2524
- SITE_NAME="mysite"
2625
- SITE_ROOT="$TRAVIS_BUILD_DIR/../$SITE_NAME"
2726
- COMPOSER_MEMORY_LIMIT=-1
27+
matrix:
28+
- COMPOSER_CHANNEL=1
29+
- COMPOSER_CHANNEL=2
2830

2931
before_install:
3032
# Disable xdebug.
3133
- phpenv config-rm xdebug.ini
3234

3335
# Update Composer.
34-
- composer self-update --stable
36+
- composer self-update "--${COMPOSER_CHANNEL}"
3537
- composer clear-cache
3638

37-
# Install composer parallel install plugin.
38-
- composer global require hirak/prestissimo --no-interaction
39-
4039
# Install PHP Code Sniffer and Drupal Coding standards.
4140
- composer global require drupal/coder --prefer-dist -vvv || exit 1
4241
- phpcs --config-set installed_paths "$COMPOSER_VENDOR_PATH/drupal/coder/coder_sniffer"
4342
- phpcs --config-set ignore_warnings_on_exit 1
4443

4544
install:
4645
# Create Drupal project.
47-
- composer create-project drupal-composer/drupal-project:8.x-dev --stability dev --no-interaction --no-dev --prefer-dist -vvv "$SITE_ROOT" || exit 1
46+
- composer create-project drupal-composer/drupal-project:9.x-dev --stability dev --no-interaction --no-dev --prefer-dist -vvv "$SITE_ROOT" || exit 1
4847

4948
# https://github.com/drupal-composer/drupal-paranoia#configuration
5049
- cd "$SITE_ROOT"; mv "$SITE_ROOT/web" "$SITE_ROOT/app"

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"license": "GPL-2.0-or-later",
66
"require": {
77
"php": ">=5.4.5",
8-
"composer-plugin-api": "^1.1"
8+
"composer-plugin-api": "^1.1 || ^2"
99
},
1010
"autoload": {
1111
"psr-4": {

src/Plugin.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ public function activate(Composer $composer, IOInterface $io) {
3131
$this->installer = new Installer($composer, $io);
3232
}
3333

34+
/**
35+
* {@inheritdoc}
36+
*/
37+
public function deactivate(Composer $composer, IOInterface $io) {}
38+
39+
/**
40+
* {@inheritdoc}
41+
*/
42+
public function uninstall(Composer $composer, IOInterface $io) {}
43+
3444
/**
3545
* {@inheritdoc}
3646
*/

0 commit comments

Comments
 (0)