From 2b6a695b95862ee7fed32ca24a3036d0d200d0e6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 4 Feb 2020 20:29:22 +0100 Subject: [PATCH] Continued: - added make-javadoc.sh - renamed COMPANY_APPS to COMPANY_PROJECTS MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .jprojects.sh | 4 ++-- make-javadoc.sh | 60 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100755 make-javadoc.sh diff --git a/.jprojects.sh b/.jprojects.sh index feca852..9eb43e8 100644 --- a/.jprojects.sh +++ b/.jprojects.sh @@ -33,13 +33,13 @@ APPLICATIONS="pizzaservice-core pizzaservice-lib pizzaservice-mailer-ejb pizzase addressbook-core addressbook-lib addressbook-mailer-ejb addressbook-mailer-lib addressbook-ejb addressbook-war addressbook addressbook-uml" # Company-specific projects -COMPANY_APPS="jjobboards-core jjobboards-lib jjobboards-mailer-ejb jjobboards-mailer-lib jjobboards-ejb jjobboards-war jjobboards" +COMPANY_PROJECTS="jjobboards-core jjobboards-lib jjobboards-mailer-ejb jjobboards-mailer-lib jjobboards-ejb jjobboards-war jjobboards" # Broken (needs fixing) BROKEN="addressbook-swing jfinancials-swing jjobboards-swing pizzaservice-war pizzaservice" # Compile list -ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_APPS} ${BROKEN}" +ALL_PROJECTS="${THIS} ${LIBRARIES} ${APPLICATIONS} ${COMPANY_PROJECTS} ${BROKEN}" # Own home directory declare -r JPROJECTS_HOME="${PWD}" diff --git a/make-javadoc.sh b/make-javadoc.sh new file mode 100755 index 0000000..baaf0ff --- /dev/null +++ b/make-javadoc.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +. ./.jprojects.sh || exit 255 + +UPLOAD_SERVER="git.mxchange.org" +UPLOAD_BASE_PATH="/var/www/virtual/mxchange.org/docs/htdocs/javadoc" + +for project in ${LIST}; do + if [ "${project}" = "jprojects-scripts" ] + then + echo "$0: Skipping jprojects-scripts ..." + continue + elif [ ! -d "${JPROJECTS_HOME}/${project}" ] + then + echo "$0: Project '${project}' does not exist." + continue + elif [ ! -d "${JPROJECTS_HOME}/${project}/dist" ] + then + echo "$0: Project '${project}' is not generated yet." + continue + fi + + cd "${JPROJECTS_HOME}/${project}" || exit 255 + + HAS_FILE=$(find src/ -type f) + + if [ -z "${HAS_FILE}" ] + then + echo "$0: Project '${project}' has no files, skipping ..." + continue + fi + + echo "$0: Cleaning up Javadoc for '${project}' ..." + rm -rf dist/javadoc/ + + echo "$0: Generating documentation for '${project}' ..." + ant javadoc > dist/javadoc.log || exit 255 + + IS_COMPANY_PROJECT=$(echo "${COMPANY_PROJECTS}" | grep "${project}") + if [ -n "${IS_COMPANY_PROJECT}" -a -z "$1" ] + then + echo "$0: Not uploading company project='${project}'" + continue + fi + + echo "$0: Generating 'javadoc/${project}' on remote server ..." + ssh "${UPLOAD_SERVER}" "mkdir -v \"${UPLOAD_BASE_PATH}/${project}\"" + + echo "$0: Cleaning 'javadoc/${project}' on remote server ..." + ssh "${UPLOAD_SERVER}" "rm -rf \"${UPLOAD_BASE_PATH}/${project}\"/*" || exit 255 + + echo "$0: Uploading Javadoc for '${project}' ..." + scp -r dist/javadoc/* "${UPLOAD_SERVER}:${UPLOAD_BASE_PATH}/${project}" || exit 255 + + echo "$0: Cleaning local documentation for '${project}' ..." + rm -rf dist/javadoc/ +done + +echo "$0: All done." +exit 0 -- 2.39.5