]> git.mxchange.org Git - jprojects-scripts.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Tue, 4 Feb 2020 19:29:22 +0000 (20:29 +0100)
committerRoland Häder <roland@mxchange.org>
Thu, 6 Feb 2020 19:59:22 +0000 (20:59 +0100)
- added make-javadoc.sh
- renamed COMPANY_APPS to COMPANY_PROJECTS

Signed-off-by: Roland Häder <roland@mxchange.org>
.jprojects.sh
make-javadoc.sh [new file with mode: 0755]

index feca852b7720ab2f31b5f551a94ae909ebd2fe93..9eb43e8d6efc17c32c686deeb344b62c3f1640f3 100644 (file)
@@ -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 (executable)
index 0000000..baaf0ff
--- /dev/null
@@ -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