DM_TMPDIR= <Set this to temporary directory>
DM_TARGETDIR= <Set this to directory where tarballs should land>
-DM_NPM= <Set this to your npm binary>
DM_PHP= <Set this to your php binary>
DM_RSYNC= <set this to your rsync binary>
DM_ZIP= <set this to your zip binary>
+## Optional
+# DM_NPM= <Set this to your npm binary> [default: npm]
+# DM_NODE= <Set this to your node binary> [default: node]
+# DM_COMPOSER= <Set this to your composer binary> [default: composer]
+
DM_VERSION= <Set this to whatever the version number should be>
## Git banch/tag name
esac
-## Install npm packages
-dm_npm_install "$DM_SOURCEDIR"
-
## Make sure we have the right branch or tag
dm_git_checkout "$DM_SOURCEDIR" "$DM_REF_CORE"
dm_git_checkout "$DM_SOURCEDIR/packages" "$DM_REF_PACKAGES"
## Get latest dependencies
dm_generate_vendor "$DM_SOURCEDIR"
+dm_generate_bower "$DM_SOURCEDIR"
# Before anything - regenerate DAOs
done
}
+## Copy all bower dependencies
+function dm_install_bower() {
+ 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
+
+ [ ! -d "$to" ] && mkdir "$to"
+ $DM_RSYNC -avC $excludes_rsync "$repo/./" "$to/./"
+}
+
## Copy all core files
## usage: dm_install_core <core_repo_path> <to_path>
function dm_install_core() {
local repo="$1"
local to="$2"
- for dir in css i js PEAR templates bin CRM api extern Reports install settings Civi partials node_modules bower_components ; do
+ for dir in css i js PEAR templates bin CRM api extern Reports install settings Civi partials ; do
[ -d "$repo/$dir" ] && dm_install_dir "$repo/$dir" "$to/$dir"
done
dm_install_files "$repo" "$to" {agpl-3.0,agpl-3.0.exception,gpl,README,CONTRIBUTORS}.txt
+ dm_install_files "$repo" "$to" composer.json composer.lock bower.json package.json
mkdir -p "$to/sql"
pushd "$repo" >> /dev/null
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/./"
+ $DM_RSYNC -avC $excludes_rsync "$repo/./" "$to/./"
}
## usage: dm_install_wordpress <wp_repo_path> <to_path>
## Need --exclude=civicrm for self-building on WP site
}
+
+## Generate the "bower_components" folder.
+## usage: dm_generate_bower <repo_path>
+function dm_generate_bower() {
+ local repo="$1"
+ pushd "$repo"
+ ${DM_NPM:-npm} install
+ ${DM_NODE:-node} node_modules/bower/bin/bower install
+ popd
+}
+
## Generate the composer "vendor" folder
## usage: dm_generate_vendor <repo_path>
function dm_generate_vendor() {
local repo="$1"
pushd "$repo"
- composer install
+ ${DM_COMPOSER:-composer} install
popd
}
git checkout "$2"
popd
}
-
-## Install npm packages
-## usage: dm_npm_install <path>
-function dm_npm_install() {
- pushd "$1"
- $DM_NPM install
- popd
-}