From cb578d2903f6a2835749da47e86c688df3b06ddb Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Tue, 27 Jun 2023 22:57:12 -0700 Subject: [PATCH] distmaker - Add options DM_KEEP_GIT, DM_KEEP_DEPS, DM_SKIP_ALT If you're going through a frequent build/test cycle on Joomla patches, it's nice to cutdown unnecessary build steps. --- distmaker/distmaker.conf.dist | 9 +++++++++ distmaker/distmaker.sh | 10 ++++++---- distmaker/dists/common.sh | 4 ++++ distmaker/dists/joomla_php5.sh | 10 ++++++---- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/distmaker/distmaker.conf.dist b/distmaker/distmaker.conf.dist index df6d4c20ba..45918b8cff 100644 --- a/distmaker/distmaker.conf.dist +++ b/distmaker/distmaker.conf.dist @@ -22,3 +22,12 @@ DM_REF_DRUPAL8=${DM_REF_CORE} DM_REF_JOOMLA=${DM_REF_CORE} DM_REF_WORDPRESS=${DM_REF_CORE} DM_REF_PACKAGES=${DM_REF_CORE} + +## Keep the existing git checkouts +# DM_KEEP_GIT=1 + +## Keep the existing dependencies +# DM_KEEP_DEPS=1 + +## Don't build Joomla's alt. Useful if you're frequently rebuilding Joomla for dev-test process. +# DM_SKIP_ALT=1 diff --git a/distmaker/distmaker.sh b/distmaker/distmaker.sh index 95ae8da186..2230d89c1c 100755 --- a/distmaker/distmaker.sh +++ b/distmaker/distmaker.sh @@ -238,10 +238,12 @@ if [ -d "$DM_SOURCEDIR/drupal-8" ]; then dm_git_checkout "$DM_SOURCEDIR/drupal-8" "$DM_REF_DRUPAL8" fi -## Get fresh dependencies -[ -d "$DM_SOURCEDIR/vendor" ] && rm -rf $DM_SOURCEDIR/vendor -[ -d "$DM_SOURCEDIR/bower_components" ] && rm -rf $DM_SOURCEDIR/bower_components -dm_generate_vendor "$DM_SOURCEDIR" +if [ -z "$DM_KEEP_DEPS" ]; then + ## Get fresh dependencies + [ -d "$DM_SOURCEDIR/vendor" ] && rm -rf $DM_SOURCEDIR/vendor + [ -d "$DM_SOURCEDIR/bower_components" ] && rm -rf $DM_SOURCEDIR/bower_components + dm_generate_vendor "$DM_SOURCEDIR" +fi # Before anything - regenerate DAOs diff --git a/distmaker/dists/common.sh b/distmaker/dists/common.sh index f5199898a3..ef39f6f956 100644 --- a/distmaker/dists/common.sh +++ b/distmaker/dists/common.sh @@ -258,6 +258,10 @@ function civicrmVersion( ) { ## Perform a hard checkout on a given report ## usage: dm_git_checkout function dm_git_checkout() { + if [ -n "$DM_KEEP_GIT" ]; then + echo "Skip git checkout ($1 => $2)" + return + fi pushd "$1" git checkout . git checkout "$2" diff --git a/distmaker/dists/joomla_php5.sh b/distmaker/dists/joomla_php5.sh index 80ff9840cc..4b5a7d0995 100755 --- a/distmaker/dists/joomla_php5.sh +++ b/distmaker/dists/joomla_php5.sh @@ -37,10 +37,12 @@ cp "$SRC/joomla/admin/admin.civicrm.php" "$DM_TMPDIR/com_civicrm/admin/civicrm.p cd $DM_TMPDIR; # generate alt version of package -cp -R -p civicrm com_civicrm/admin/civicrm -${DM_PHP:-php} $DM_SOURCEDIR/distmaker/utils/joomlaxml.php $DM_SOURCEDIR com_civicrm $DM_VERSION alt -${DM_ZIP:-zip} -q -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-joomla-alt.zip com_civicrm -rm -rf com_civicrm/admin/civicrm +if [ -z "$DM_SKIP_ALT" ]; then + cp -R -p civicrm com_civicrm/admin/civicrm + ${DM_PHP:-php} $DM_SOURCEDIR/distmaker/utils/joomlaxml.php $DM_SOURCEDIR com_civicrm $DM_VERSION alt + ${DM_ZIP:-zip} -q -r -9 $DM_TARGETDIR/civicrm-$DM_VERSION-joomla-alt.zip com_civicrm + rm -rf com_civicrm/admin/civicrm +fi # generate zip version of civicrm.xml ${DM_PHP:-php} $DM_SOURCEDIR/distmaker/utils/joomlaxml.php $DM_SOURCEDIR com_civicrm $DM_VERSION zip -- 2.25.1