Last Updated: February 25, 2016
·
1.488K
· mavimo

Phing and Drush

We use phing as our build system. We do a lot of work on Drupal, so we love using drush and PhingDrushTask
To speed up integration we use this adorable peice of configuration to add in composer:

{
  "repositories": [
    {
      "type": "package",
      "package": {
        "name": "drupal/phing-drush-task",
        "version": "1.0",
        "source": {
          "url": "http://git.drupal.org/project/phingdrushtask.git",
          "type": "git",
          "reference": "7.x-1.0"
        }
      }
    }
  ],
  "require": {
    "phing/phing": "2.5.0",
    "drupal/phing-drush-task": "1.0",
  },
  "config": {
    "bin-dir": "bin/"
  },
  "minimum-stability": "dev"
}

write this in composer.json and just run composer install automatically phing and PhingDrushTask will installed and can used with bin/phing command.
We can directly use drush task inside build.xml files, like:

<target name="make">
  <echo>Running Drush Make to download all dependencies.</echo>
  <drush command="make" assume="yes">
    <param>${app.makefile}</param>
  </drush>
</target>

so we can just run

bin/phing make

or have more complex tasks (dependencies, ...).

Authored by Marco Vito Moscaritolo