Skip to content
Snippets Groups Projects
Verified Commit 9352ce57 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

ADD build properties AUTO_DISCOVER_MODULES, JS_DIST_BUNDLE

parent 941271a7
Branches
Tags
1 merge request!36merge f-boot-tour to dev
Pipeline #8776 passed with warnings
......@@ -69,7 +69,7 @@ merge_xsl:
merge_js:
for f in ${BUILDFILELIST} ; do source "$$f" ; done ; \
BUILD_JS_DIST_BUNDLE=$${BUILD_JS_DIST_BUNDLE} misc/merge_js.sh $${MODULE_DEPENDENCIES[*]}
JS_DIST_BUNDLE=$${JS_DIST_BUNDLE} AUTO_DISCOVER_MODULES=$$AUTO_DISCOVER_MODULES misc/merge_js.sh $${MODULE_DEPENDENCIES[*]}
EXCLUDE_EXPR = %~ %.backup
BUILDFILELIST = $(filter-out $(EXCLUDE_EXPR),$(wildcard build.properties.d/*))
......
......@@ -91,6 +91,18 @@ BUILD_CUSTOM_IMPRINT='<p> Put an imprint note here </p>'
##############################################################################
BUILD_MODULE_EXT_TRIGGER_CRAWLER_FORM_TOOLBOX="Tools"
##############################################################################
# Build a dist file containing all JS code from the files in the
# MODULE_DEPENDENCIES array.
##############################################################################
JS_DIST_BUNDLE=TRUE
##############################################################################
# TRUE means that all javascript sources which are no mentioned in the
# MODULE_DEPENDENCIES array will be added in no particular order into the
# build. If you need to guarantee a specific order (in which the are loaded or
# appear in the dit file) you need to add them to the MODULE_DEPENDENCIES.
##############################################################################
AUTO_DISCOVER_MODULES=TRUE
##############################################################################
# Module dependencies
# Override or extend to specify the order of js files in the resulting
......
......@@ -41,7 +41,7 @@ ALL_SOURCES=()
_create_jsheader () {
_JS_INCLUDE=
if [ "$BUILD_JS_DIST_BUNDLE" == "TRUE" ] ; then
if [ "$JS_DIST_BUNDLE" == "TRUE" ] ; then
_SIZE=$(( $(wc -c ${DIST_BUNDLE_TARGET} | awk '{print $1}')/1024))
echo "including ${DIST_BUNDLE} (${_SIZE}kB) into ${JSHEADER_TARGET}"
_JS_INCLUDE="
......@@ -85,7 +85,7 @@ _create_jsheader () {
}
function _merge () {
if [ "$BUILD_JS_DIST_BUNDLE" != "TRUE" ] ; then
if [ "$JS_DIST_BUNDLE" != "TRUE" ] ; then
return 0
fi
_SOURCE=$2
......@@ -110,11 +110,13 @@ for _SOURCE in ${CORE_MODULES[@]} ; do
_merge "core" "${PUBLIC_JS_DIR}${_SOURCE}" $DIST_BUNDLE_TARGET
done
if [ "$AUTO_DISCOVER_MODULES" == "TRUE" ] ; then
# load other js files but exclude any subdirectory
for _SOURCE in $(find ${PUBLIC_JS_DIR}* -prune -iname "*.js") ; do
[[ ! " ${ALL_SOURCES[@]} " =~ " ${_SOURCE} " ]] && ALL_SOURCES+=(${_SOURCE})
_merge "extension" ${_SOURCE} $DIST_BUNDLE_TARGET
done
fi
# for `make test`
for _SOURCE in $(find ${PUBLIC_JS_DIR} -ipath "${PUBLIC_JS_DIR}modules/*.js") ; do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment