From c84eb16e9468f96428c380af1f8b890f357a736f Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 2 Jan 2015 12:22:00 -0800 Subject: [PATCH] composer, distmaker - Generate and include the vendor/ folder --- distmaker/distmaker.sh | 3 +++ distmaker/dists/common.sh | 29 +++++++++++++++++++++++++++++ distmaker/dists/drupal6_php5.sh | 1 + distmaker/dists/drupal_php5.sh | 1 + distmaker/dists/drupal_sk_php5.sh | 1 + distmaker/dists/joomla_php5.sh | 1 + distmaker/dists/wordpress_php5.sh | 1 + 7 files changed, 37 insertions(+) diff --git a/distmaker/distmaker.sh b/distmaker/distmaker.sh index fea13e5c90..b3967adc45 100755 --- a/distmaker/distmaker.sh +++ b/distmaker/distmaker.sh @@ -166,6 +166,9 @@ dm_git_checkout "$DM_SOURCEDIR/packages" "$DM_REF_PACKAGES" ## in theory, this shouldn't matter, but GenCode is CMS-dependent, and we've been doing our past builds based on D7 dm_git_checkout "$DM_SOURCEDIR/drupal" "$DM_REF_DRUPAL" +## Get latest dependencies +dm_generate_vendor "$DM_SOURCEDIR" + # Before anything - regenerate DAOs cd $DM_SOURCEDIR/xml diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index 0a53b3c300..b6bfc6c186 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -135,6 +135,26 @@ function dm_install_l10n() { dm_install_dir "$repo" "$to" } +## Copy composer's "vendor" folder +## usage: dm_install_vendor +function dm_install_vendor() { + local repo="$1" + local to="$2" + + local excludes_rsync="" + for exclude in .git .svn {T,t}est{,s} {D,d}oc{,s} {E,e}xample{,s} ; do + excludes_rsync="--exclude=${exclude} ${excludes_rsync}" + done + + ## Note: These small folders have items that previously were not published, + ## but there's no real cost to including them, and excluding them seems + ## likely to cause confusion as the codebase evolves: + ## packages/Files packages/PHP packages/Text + + [ ! -d "$to" ] && mkdir "$to" + $DM_RSYNC -avC $excludes_rsync --include=core "$repo/./" "$to/./" +} + ## usage: dm_install_wordpress function dm_install_wordpress() { local repo="$1" @@ -153,6 +173,15 @@ function dm_install_wordpress() { ## Need --exclude=civicrm for self-building on WP site } +## Generate the composer "vendor" folder +## usage: dm_generate_vendor +function dm_generate_vendor() { + local repo="$1" + pushd "$repo" + composer install + popd +} + ## Generate civicrm-version.php ## usage: dm_generate_version function dm_generate_version() { diff --git a/distmaker/dists/drupal6_php5.sh b/distmaker/dists/drupal6_php5.sh index feb201e244..c6083d846d 100755 --- a/distmaker/dists/drupal6_php5.sh +++ b/distmaker/dists/drupal6_php5.sh @@ -20,6 +20,7 @@ cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php dm_generate_version "$TRG/civicrm-version.php" Drupal6 dm_install_core "$SRC" "$TRG" dm_install_packages "$SRC/packages" "$TRG/packages" +dm_install_vendor "$SRC/vendor" "$TRG/vendor" dm_install_drupal "$SRC/drupal" "$TRG/drupal" # gen tarball diff --git a/distmaker/dists/drupal_php5.sh b/distmaker/dists/drupal_php5.sh index b8b5e9ec8a..dd421936ea 100755 --- a/distmaker/dists/drupal_php5.sh +++ b/distmaker/dists/drupal_php5.sh @@ -20,6 +20,7 @@ cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php dm_generate_version "$TRG/civicrm-version.php" Drupal dm_install_core "$SRC" "$TRG" dm_install_packages "$SRC/packages" "$TRG/packages" +dm_install_vendor "$SRC/vendor" "$TRG/vendor" dm_install_drupal "$SRC/drupal" "$TRG/drupal" # gen tarball diff --git a/distmaker/dists/drupal_sk_php5.sh b/distmaker/dists/drupal_sk_php5.sh index 592cf9af97..c35d07b7e8 100755 --- a/distmaker/dists/drupal_sk_php5.sh +++ b/distmaker/dists/drupal_sk_php5.sh @@ -20,6 +20,7 @@ cp $SRC/drupal/civicrm.config.php.drupal $TRG/civicrm.config.php dm_generate_version "$TRG/civicrm-version.php" Drupal dm_install_core "$SRC" "$TRG" dm_install_packages "$SRC/packages" "$TRG/packages" +dm_install_vendor "$SRC/vendor" "$TRG/vendor" dm_install_drupal "$SRC/drupal" "$TRG/drupal" # delete packages that distributions on Drupal.org repalce if present diff --git a/distmaker/dists/joomla_php5.sh b/distmaker/dists/joomla_php5.sh index 6519cbe307..08ab281fdc 100755 --- a/distmaker/dists/joomla_php5.sh +++ b/distmaker/dists/joomla_php5.sh @@ -20,6 +20,7 @@ cp $SRC/civicrm.config.php $TRG dm_generate_version "$TRG/civicrm-version.php" Joomla dm_install_core "$SRC" "$TRG" dm_install_packages "$SRC/packages" "$TRG/packages" +dm_install_vendor "$SRC/vendor" "$TRG/vendor" ## WTF: It's so good we'll install it twice! ## (The first is probably extraneous, but there could be bugs dependent on it.) diff --git a/distmaker/dists/wordpress_php5.sh b/distmaker/dists/wordpress_php5.sh index df71cbb3b7..1982e6a4f3 100644 --- a/distmaker/dists/wordpress_php5.sh +++ b/distmaker/dists/wordpress_php5.sh @@ -20,6 +20,7 @@ cp $SRC/WordPress/civicrm.config.php.wordpress $TRG/civicrm/civicrm/civicrm.conf dm_generate_version "$TRG/civicrm/civicrm/civicrm-version.php" Wordpress dm_install_core "$SRC" "$TRG/civicrm/civicrm" dm_install_packages "$SRC/packages" "$TRG/civicrm/civicrm/packages" +dm_install_vendor "$SRC/vendor" "$TRG/civicrm/civicrm/vendor" dm_install_wordpress "$SRC/WordPress" "$TRG/civicrm" # gen tarball -- 2.25.1