Composer Make

Categories

Component ID

2428217

Component name

Composer Make

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

This is not a module. This is a Drush extension. It was designed to work with Drupal 7 and is therefore no longer maintained.

The Composer Manager module comes with a really nifty set of Drush commands that can fulfill modules’ library requirements without duplication. Unfortunately, they require a fully-bootstrapped Drupal in order to run. In the case of custom Drupal profiles, it may be necessary to consolidate all the dependency information and run composer before the profile install begins. In cases where drush make is used to create distribution builds, this is especially problematic.

Enter Composer Make. This drush command will find all composer.json files which lie in the same directory as a module or theme’s .info file, will consolidate them into a single composer.json file which Composer Manager can find and consume, and will run the actual composer install.

It is suggested that as part of an automated build process, drush cmake is invoked directly after drush make.

Requirements

  • composer or composer.phar somewhere in your path, or at a location specified at time of invocation.
  • drush (of course)
  • PHP >= 5.3.0

Usage

Invocation

drush composer-make or drush cmake

Options

--composer: If composer or composer.phar is not in your path, you will need to specify its path here.
--composer-json-dir: Directory where Composer Manager will expect to find the master composer.json file. Defaults to sites/default/files/composer.
--vendor-dir: Directory where Composer Manager will expect to find autoload.php and the dependency subdirectories. Defaults to sites/all/vendor.
--profile: If set to a valid profile name, that profile will also be searched for composer.json files.
--require-dev: If set, development requirements for all packages will also be installed.

Acknowledgements

Some chunks of code were copypasta’d from files in the Composer Manager module. I felt this was completely justified since Composer Make is meant to work hand-in-hand with Composer Manager.