From 125810c0cc7d0cba0259c55f021ee0f2d774fa21 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 6 Sep 2018 11:56:31 -0400 Subject: [PATCH] LP#1791162 Makefile browser client build support Adds an optional --enable-build-web-client ./configure flag for building the AngularJS and Angular browser clients during Evergreen 'make'. The option is disabled by default, since it requires -developer prerequisites and is not required when using a standard Evergreen release tarball. Teach make_release to use the new --enable-build-web-client when building browser clients. Enable browser client building by default in make_release. The -c flag now disables browser client building. Signed-off-by: Bill Erickson --- Open-ILS/src/Makefile.am | 6 +++++- Open-ILS/src/eg2/Makefile.am | 21 +++++++++++++++++++ Open-ILS/web/Makefile.am | 6 ++++++ Open-ILS/web/js/ui/default/staff/Makefile.am | 21 +++++++++++++++++++ build/tools/make_release | 30 ++++++++++------------------ configure.ac | 21 +++++++++++++++++++ 6 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 Open-ILS/src/eg2/Makefile.am create mode 100644 Open-ILS/web/js/ui/default/staff/Makefile.am diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index 444846b914..ca612a79b1 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -110,6 +110,10 @@ if BUILDEGPYTHON OILSPYTHON_DIR = python endif +if BUILDEGWEBCLIENT +OILSWEBCLIENT_DIR = eg2 +endif + #------------------------------ # Build EVERGREEN JAVA #------------------------------ @@ -149,7 +153,7 @@ doc_DATA = $(gen_docs) # Take care of which subdirectories to build, and which extra files to include in a distribution. -SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR) +SUBDIRS = $(OILSCORE_DIRS) $(OILSWEB_DIR) $(OILSPYTHON_DIR) $(OILSJAVA_DIR) $(OILSWEBCLIENT_DIR) EXTRA_DIST = @srcdir@/perlmods \ @srcdir@/data \ diff --git a/Open-ILS/src/eg2/Makefile.am b/Open-ILS/src/eg2/Makefile.am new file mode 100644 index 0000000000..9176e32e94 --- /dev/null +++ b/Open-ILS/src/eg2/Makefile.am @@ -0,0 +1,21 @@ + +# Install local NodeJS dependencies and compile the Angular app. +# Note installation (i.e. copying of files) occurs via the web +# install Makefile. + +all-local: node-deps build-web-prod + +node-deps: + npm install + +build-web-prod: + ng build --prod + +build-web-dev: + ng build + +test-web: + npm run test + +clean: + rm -rf node_modules diff --git a/Open-ILS/web/Makefile.am b/Open-ILS/web/Makefile.am index 45b324c804..671f6909a3 100644 --- a/Open-ILS/web/Makefile.am +++ b/Open-ILS/web/Makefile.am @@ -13,6 +13,12 @@ reportsdir = $(WEBDIR)/reports/ if BUILDILSWEB OILSWEB_INST = webcore-install offline-install +if BUILDEGWEBCLIENT +OILSWEBCLIENT_DIR = js/ui/default/staff +endif + +SUBDIRS = $(OILSWEBCLIENT_DIR) + #webcore-install reports_SCRIPTS = @top_srcdir@/Open-ILS/xul/staff_client/server/admin/adminlib.js diff --git a/Open-ILS/web/js/ui/default/staff/Makefile.am b/Open-ILS/web/js/ui/default/staff/Makefile.am new file mode 100644 index 0000000000..b0d7cf8f7e --- /dev/null +++ b/Open-ILS/web/js/ui/default/staff/Makefile.am @@ -0,0 +1,21 @@ + +# Install local NodeJS dependencies and compile the AngularJS app. +# Note installation (i.e. copying of files) occurs via the web +# install Makefile. + +all-local: node-deps build-web-prod + +node-deps: + npm install + +build-web-prod: + npm run build-prod + +build-web-dev: + ng run build + +test-web: + npm run test + +clean: + rm -rf node_modules diff --git a/build/tools/make_release b/build/tools/make_release index 050f95bec1..0482b72e41 100755 --- a/build/tools/make_release +++ b/build/tools/make_release @@ -17,7 +17,7 @@ TAG_ONLY=NO # -t BUILD_ONLY=NO # -b UPGRADE_PREVIEW=NO # -r SKIP_I18N=NO # -i -BUILD_BROWSER_CLIENT=NO # -c +BUILD_BROWSER_CLIENT=YES # -c SKIP_XUL=NO # -x # path to OpenSRF libraries @@ -58,7 +58,7 @@ while getopts ":hv:f:F:nptbrij:cx" opt; do OSRF_JS_PATH="$OPTARG" ;; c) - BUILD_BROWSER_CLIENT=YES + BUILD_BROWSER_CLIENT=NO ;; x) SKIP_XUL=YES @@ -332,24 +332,14 @@ XULRUNNER_VERSION=${XULRUNNER_VERSION##XULRUNNER_VERSION=} echo "Prepping server download files" if [ "$BUILD_BROWSER_CLIENT" == "YES" ]; then - # AngularJS staff client - cd ../../../ - echo "Building AngularJS browser staff client" - cd Open-ILS/web/js/ui/default/staff/ - npm install # fetch build dependencies - npm run build-prod # copy to build dir and minify JS files - # npm cache is big and unnecessary in the final build. remove it. - rm -r node_modules - cd ../../../../../ # Open-ILS dir - - # Angular staff client - echo "Building Angular browser staff client" - cd src/eg2 - npm install # fetch build dependencies - ng build --prod - # npm cache is big and unnecessary in the final build. remove it. - rm -r node_modules - cd ../../../../ # release dir + echo "Building AngularJS/Angular Clients" + cd ../../../ # back to root of Evergreen + ./configure --disable-updates --disable-apache-modules \ + --disable-reporter --enable-build-web-client + make + make clean # remove node_modules, .o, .so, etc. files + cd ../ # Back to release dir + else echo "Skipping browser client build" cd ../../../../ diff --git a/configure.ac b/configure.ac index dacb5a36b7..4967b795ca 100644 --- a/configure.ac +++ b/configure.ac @@ -179,6 +179,20 @@ esac], AM_CONDITIONAL([BUILDEGPYTHON], [test x$EG_PYTHON_INSTALL = xtrue]) +# build the evergreen browser clients? + +AC_ARG_ENABLE([build-web-client], +[ --enable-build-web-client enables compilation of the Evergreen web client ], +[case "${enableval}" in + yes) EG_BUILD_WEB_CLIENT=true ;; + no) EG_BUILD_WEB_CLIENT=false ;; + *) AC_MSG_ERROR([please choose another value for --enable-build-web-client (supported values are yes or no)]) +esac], +[EG_BUILD_WEB_CLIENT=false]) + +AM_CONDITIONAL([BUILDEGWEBCLIENT], [test x$EG_BUILD_WEB_CLIENT = xtrue]) + + #----------------------------------- # Check for dependencies #----------------------------------- @@ -363,6 +377,8 @@ if test "x$openils_core" = "xtrue"; then Open-ILS/src/c-apps/Makefile Open-ILS/src/c-apps/tests/Makefile Open-ILS/src/extras/Makefile + Open-ILS/web/js/ui/default/staff/Makefile + Open-ILS/src/eg2/Makefile Open-ILS/src/java/Makefile Open-ILS/src/python/Makefile]) fi @@ -436,6 +452,11 @@ AC_MSG_RESULT([Evergreen Staff Client: yes]) else AC_MSG_RESULT([Evergreen Staff Client: no]) fi + if test "$EG_BUILD_WEB_CLIENT" = "true" ; then +AC_MSG_RESULT([Compile Browser Client: yes]) + else +AC_MSG_RESULT([Compile Browser Client: no]) + fi if test "$EG_PYTHON_INSTALL" = "true" ; then AC_MSG_RESULT([Evergreen Python Components: yes]) else -- 2.11.0