diff --git a/.circleci/config.yml b/.circleci/config.yml index 14d3bd8a..f4b730db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -27,6 +27,10 @@ jobs: name: Configure PHP command: | echo "sendmail_path=/bin/true" | sudo tee -a "/etc/php.d/circleci.ini" + - run: + name: Update Composer + command: | + sudo composer self-update - run: name: Create artifacts directory command: mkdir /tmp/artifacts diff --git a/README.md b/README.md index 1672e826..e5564a42 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ _Note: If you are starting a new a project, you may be looking for the [drupal-s $> composer require palantirnet/the-build ``` +Composer 2.2.2 or greater is required for the-build. + ## Setting up Install the default templates and phing targets to your project: diff --git a/bin/the-build-installer b/bin/the-build-installer index fc965f9d..928b3e22 100755 --- a/bin/the-build-installer +++ b/bin/the-build-installer @@ -1,20 +1,17 @@ #!/bin/sh # # Wrapper for our install command; at least this way it's somewhat discoverable. -# Previously: +# +# The install command boils down to: # vendor/bin/phing -f vendor/palantirnet/the-build/targets/install.xml +# +# * This script requires Composer 2.2.2 or greater, because of a series of script proxying +# changes between 2.1.x and 2.2.2. This requirement is enforced in composer.json. +# * This script assumes the composer bin dir is at vendor/bin/ -# Relative path to this script. -SCRIPT=$(readlink "$0") - -# Absolute path to this script's parent directory. -SCRIPTPATH=$(cd `dirname $0` && cd `dirname $SCRIPT` && pwd) - -REPOPATH=$(cd `dirname $SCRIPTPATH` && cd ../../../ && pwd) - -if [ "$REPOPATH" = `pwd` ]; then - # Run our install task. - $SCRIPTPATH/../../../bin/phing -f $SCRIPTPATH/../targets/install.xml -else - echo "Please run this command from your project root." +# Composer 2.2.2 through 2.2.6 +if [ "$COMPOSER_BIN_DIR" != "" ]; then + COMPOSER_RUNTIME_BIN_DIR="$COMPOSER_BIN_DIR" fi + +(cd $COMPOSER_RUNTIME_BIN_DIR/../../ && $COMPOSER_RUNTIME_BIN_DIR/phing -f $COMPOSER_RUNTIME_BIN_DIR/../palantirnet/the-build/targets/install.xml) diff --git a/composer.json b/composer.json index 8b0355a5..6e146a17 100644 --- a/composer.json +++ b/composer.json @@ -12,6 +12,7 @@ "bin/the-build-installer" ], "require": { + "composer-runtime-api": "^2.2.2", "cweagans/composer-patches": "^1.7", "drupal/coder": "^8.3.6", "drush/drush": "^9 || ^10", @@ -29,7 +30,11 @@ } }, "config": { - "sort-packages": true + "sort-packages": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "cweagans/composer-patches": true + } }, "extra": { "patches": { diff --git a/defaults/install/.circleci/config.yml b/defaults/install/.circleci/config.yml index b1cda175..f1c50485 100644 --- a/defaults/install/.circleci/config.yml +++ b/defaults/install/.circleci/config.yml @@ -39,6 +39,10 @@ jobs: name: Configure PHP command: | echo "sendmail_path=/bin/true" | sudo tee -a "/etc/php.d/circleci.ini" + - run: + name: Update Composer + command: | + sudo composer self-update - run: name: Create artifacts directory command: mkdir /tmp/artifacts