From: Roland Häder Date: Tue, 4 Feb 2020 19:29:22 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b6a695b95862ee7fed32ca24a3036d0d200d0e6;p=jprojects-scripts.git Continued: - added make-javadoc.sh - renamed COMPANY_APPS to COMPANY_PROJECTS Signed-off-by: Roland Häder --- 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