BADCamp Sprinting Success Story : Drush make files support YAML
After a very successful drush code-sprint at BADCamp 2014, drush make now supports YAML format!
Instead of the old INI format
api = 2
; Set contrib directory.
defaults[projects][subdir] = "contrib"
core = "7.x"
projects[drupal][type] = "core"
projects[drupal][version] = "7.32"
; Remove scary ajax error when autocomplete terminates: https://www.drupal.org/node/1232416#comment-8748879
projects[drupal][patch][] = "https://www.drupal.org/files/issues/D7-fix_autocomplete_terminated_error-1232416-179-do-not-test.patch"
; Ensure plain text fields evaluate line breaks.
projects[drupal][patch][] = "http://drupal.org/files/text-plain-1152216-24.patch"
projects[addressfield][version] = "1.0-beta5"
projects[addressfield_tokens][version] = "1.4"
projects[admin_views][version] = "1.3"
projects[field_collection][version] = "1.0-beta7"
; Field collections are ownerless https://drupal.org/node/1954124
projects[field_collection][patch][] = "https://drupal.org/files/issues/field_collection-ownerless_fields-1954124-23.patch"
; Fixes fatal error in migrate code: https://www.drupal.org/node/2315921#comment-9028779
projects[field_collection][patch][] = "https://www.drupal.org/files/issues/migrate-fatal-error-2315921-01.patch"
YAML can be used with the latest version of Drush 7:
api: 2
# Set contrib directory.
defaults:
projects:
subdir: "contrib"
core: "7.x"
projects:
drupal:
type: "core"
version: "7.33"
patch:
# Remove scary ajax error when autocomplete terminates: https://www.drupal.org/node/1232416#comment-8748879
- "https://www.drupal.org/files/issues/D7-fix_autocomplete_terminated_error-1232416-179-do-not-test.patch"
# Ensure plain text fields evaluate line breaks.
- "http://drupal.org/files/text-plain-1152216-24.patch"
addressfield: "1.0-beta5"
addressfield_tokens: "1.4"
admin_views: "1.3"
field_collection:
version: "1.0-beta7"
patch:
# Field collections are ownerless https://drupal.org/node/1954124
- "https://drupal.org/files/issues/field_collection-ownerless_fields-1954124-23.patch"
# Fixes fatal error in migrate code: https://www.drupal.org/node/2315921#comment-9028779
- "https://www.drupal.org/files/issues/migrate-fatal-error-2315921-01.patch"
Included .make
files whether local, or discovered recursively within downloaded projects, can be in either YAML of INI format.
In order to use the newly-supported YAML format, simply name files with a .yml
extension, such as my_project.make.yml
.
The best part? This can be used now! Even though YAML files are mostly a new concept for Drupal 8, drush make will parse YAML make files for Drupal 7, and even Drupal 6. Want to learn more about DRUSH make files? Check out Joe Turgeon’s “Getting Started With Grunt Drupal Tasks“