LP#1791162 Makefile browser client build support collab/berick/lp1791162-makefile-browser-client-build
authorBill Erickson <berickxx@gmail.com>
Thu, 6 Sep 2018 15:56:31 +0000 (11:56 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 6 Sep 2018 19:45:43 +0000 (15:45 -0400)
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 <berickxx@gmail.com>
Open-ILS/src/Makefile.am
Open-ILS/src/eg2/Makefile.am [new file with mode: 0644]
Open-ILS/web/Makefile.am
Open-ILS/web/js/ui/default/staff/Makefile.am [new file with mode: 0644]
build/tools/make_release
configure.ac

index 444846b..ca612a7 100644 (file)
@@ -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 (file)
index 0000000..9176e32
--- /dev/null
@@ -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
index 45b324c..671f690 100644 (file)
@@ -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 (file)
index 0000000..b0d7cf8
--- /dev/null
@@ -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
index 050f95b..0482b72 100755 (executable)
@@ -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 ../../../../
index dacb5a3..4967b79 100644 (file)
@@ -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