function drush_make

8.0.x make.drush.inc drush_make($makefile = NULL, $build_path = NULL)
6.x make.drush.inc drush_make($makefile = NULL, $build_path = NULL)
7.x make.drush.inc drush_make($makefile = NULL, $build_path = NULL)
5.x make.drush.inc drush_make($makefile = NULL, $build_path = NULL)
master make.drush.inc drush_make($makefile = NULL, $build_path = NULL)

Drush callback; make based on the makefile.

2 string references to 'drush_make'
drush_filename_blacklist in includes/command.inc
Substrings to ignore during commandfile and site alias searching.
makeMakefileCase::listMakefileTests in tests/makeTest.php

File

commands/make/make.drush.inc, line 295
Drush Make commands.

Code

function drush_make($makefile = NULL, $build_path = NULL) {
  // Set the cache option based on our '--no-cache' option.
  _make_enable_cache();

  // Build.
  if (!drush_get_option('no-build', FALSE)) {
    $info = make_parse_info_file($makefile);
    drush_log(dt('Beginning to build !makefile.', array('!makefile' => $makefile)), LogLevel::OK);

    // Default contrib destination depends on Drupal core version.
    $core_version = str_replace('.x', '', $info['core'][0]);
    $sitewide = drush_drupal_sitewide_directory($core_version);
    $contrib_destination = drush_get_option('contrib-destination', $sitewide);

    $build_path = make_build_path($build_path);
    $make_dir = realpath(dirname($makefile));

    $success = make_projects(FALSE, $contrib_destination, $info, $build_path, $make_dir);
    if ($success) {
      make_libraries(FALSE, $contrib_destination, $info, $build_path, $make_dir);

      if (drush_get_option('prepare-install')) {
        make_prepare_install($build_path);
      }
      if ($option = drush_get_option('md5')) {
        $md5 = make_md5();
        if ($option === 'print') {
          drush_print($md5);
        }
        else {
          drush_log(dt('Build hash: %md5', array('%md5' => $md5)), LogLevel::OK);
        }
      }
      // Only take final build steps if not in testing mode.
      if (!drush_get_option('test')) {
        if (drush_get_option('tar')) {
          make_tar($build_path);
        }
        else {
          make_move_build($build_path);
        }
      }
      make_clean_tmp();
    }
    else {
      return make_error('MAKE_PROJECTS_FAILED', dt('Drush Make failed to download all projects. See the log above for the specific errors.'));
    }
  }

  // Process --lock and --bundle-lockfile
  $lockfiles = array();
  if ($result_file = drush_get_option('bundle-lockfile', FALSE)) {
    if ($result_file === TRUE) {
      $result_file = 'sites/all/drush/platform.lock';
    }
    $lockfiles[] = $build_path . '/' . $result_file;
  }
  if ($result_file = drush_get_option('lock', FALSE)) {
    $lockfiles[] = $result_file;
  }
  if (count($lockfiles)) {
    foreach ($lockfiles as $lockfile) {
      if ($lockfile !== TRUE) {
        $result_file = drush_normalize_path($lockfile);
        drush_mkdir(dirname($result_file), $required = TRUE);
        drush_set_option('result-file', $result_file);
      }
      drush_invoke('make-lock', $makefile);
      drush_unset_option('result-file');
    }
  }

  // Used by core-quick-drupal command.
  // @see drush_core_quick_drupal().
  if (drush_get_option('core-quick-drupal', FALSE)) {
    return $info;
  }
}