From 5edc3ee98114eead0baceb0f7f8ff70aa9e00559 Mon Sep 17 00:00:00 2001 From: Travis Carden <42520-TravisCarden@users.noreply.drupalcode.org> Date: Wed, 16 Nov 2022 10:58:45 -0500 Subject: [PATCH] Issue #3321633 by Wim Leers, TravisCarden, phenaproxima: scripts/*.sh should now use 10.0.x as the default branch AND should install require-dev dependencies --- scripts/install_module.sh | 12 ++++++++++-- scripts/setup_local_dev.sh | 14 +++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/scripts/install_module.sh b/scripts/install_module.sh index d85e606504..91b4dd48a7 100755 --- a/scripts/install_module.sh +++ b/scripts/install_module.sh @@ -52,8 +52,11 @@ composer config \ # Prevent Composer from symlinking path repositories. export COMPOSER_MIRROR_PATH_REPOS=1 -# Remove the Composer platform PHP emulation. -composer config --unset platform.php +# Remove the Composer platform PHP requirement, but only on Drupal 9. +CORE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [[ "$CORE_BRANCH" =~ 9.* ]]; then + composer config --unset platform.php +fi # Prevent Composer from installing symlinks from common packages known to # contain them. @@ -66,6 +69,11 @@ composer require \ --no-ansi \ drupal/automatic_updates:*@dev +# `composer install` only installs root package development dependencies. So add +# automatic_updates' development dependencies to the root. +# @see https://getcomposer.org/doc/04-schema.md#require-dev +composer require --dev colinodell/psr-testlogger:^1 + # Revert needless changes to Core Composer metapackages. git checkout -- "$SITE_DIRECTORY/composer/Metapackage" diff --git a/scripts/setup_local_dev.sh b/scripts/setup_local_dev.sh index a78310afaa..bc3060ed8e 100755 --- a/scripts/setup_local_dev.sh +++ b/scripts/setup_local_dev.sh @@ -24,7 +24,7 @@ safe_realpath() { # your terminal session) to override their default values. # @see https://www.serverlab.ca/tutorials/linux/administration-linux/how-to-set-environment-variables-in-linux/ # Variables beginning with an underscore (_) cannot be overridden. -DRUPAL_CORE_BRANCH=${DRUPAL_CORE_BRANCH:="9.5.x"} +DRUPAL_CORE_BRANCH=${DRUPAL_CORE_BRANCH:="10.0.x"} DRUPAL_CORE_SHALLOW_CLONE=${DRUPAL_CORE_SHALLOW_CLONE:="TRUE"} AUTOMATIC_UPDATES_BRANCH=${AUTOMATIC_UPDATES_BRANCH:="8.x-2.x"} SITE_DIRECTORY=${SITE_DIRECTORY:="auto_updates_dev"} @@ -160,8 +160,11 @@ composer config \ # Prevent Composer from symlinking path repositories. export COMPOSER_MIRROR_PATH_REPOS=1 -# Remove the Composer platform PHP requirement. -composer config --unset platform.php +# Remove the Composer platform PHP requirement, but only on Drupal 9. +CORE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [[ "$CORE_BRANCH" =~ 9.* ]]; then + composer config --unset platform.php +fi # Prevent Composer from installing symlinks from common packages known to # contain them. @@ -174,6 +177,11 @@ composer require \ --no-ansi \ drupal/automatic_updates:dev-"$AUTOMATIC_UPDATES_BRANCH" +# `composer install` only installs root package development dependencies. So add +# automatic_updates' development dependencies to the root. +# @see https://getcomposer.org/doc/04-schema.md#require-dev +composer require --dev colinodell/psr-testlogger:^1 + # Revert needless changes to Core Composer metapackages. git checkout -- "$_SITE_DIRECTORY_REALPATH/composer/Metapackage" -- GitLab