Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuring what command to use for running composer in the artifact #110

Merged
merged 3 commits into from
Nov 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions defaults.properties.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ phpmd:
# File extensions to review.
suffixes: php,inc,module,theme,profile,install,test


# Configuration for running behat tests.
#
# Putting these flags in configuration allows you to vary the behat configuration per
Expand All @@ -248,3 +249,12 @@ phpmd:
# http://docs.behat.org/en/v2.5/guides/7.config.html#profiles)
behat:
args: "--suite=default --strict"


# Configuration for composer.
#
# Use this configuration if you're running on an environment where composer is not
# available on the command line as `composer` or `composer.phar`. In some cases, you may
# need to add composer to your project itself with `composer require composer/composer`.
# composer:
# composer: /path/to/composer.phar
4 changes: 3 additions & 1 deletion tasks/artifact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@

<target name="artifact-build">
<echo>Installing composer dependencies in the artifact...</echo>
<exec dir="${artifact.directory}" command="composer install --no-interaction --no-dev" checkreturn="true" />
<composer command="install" composer="${composer.composer}">
<arg line="--no-interaction --no-dev --working-dir=${artifact.directory}" />
</composer>

<echo>Deleting .git subdirectories added by Composer...</echo>
<delete includeemptydirs="true">
Expand Down
13 changes: 13 additions & 0 deletions tasks/the-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,19 @@
<property name="drush.config" value="${build.dir}/drush/drushrc.php" />


<!-- Configure the composer command, depending on whether `composer` or `composer.phar` is available. -->
<exec command="command -V composer" returnProperty="composer.not_available.composer" />
<exec command="command -V composer.phar" returnProperty="composer.not_available.composer_phar" />
<if>
<isfalse value="${composer.not_available.composer}" />
<then><property name="composer.composer" value="composer" /></then>
</if>
<if>
<isfalse value="${composer.not_available.composer_phar}" />
<then><property name="composer.composer" value="composer.phar" /></then>
</if>


<!--
Default target: the-build
This target is included only because the <project> tag requires it.
Expand Down