3 # Name of this project, detected by it's base path
7 DIST="dist/${NAME}.jar"
10 DIST_CONFIG_FILE="${HOME}/.jprojects-dist.sh"
12 # WildFly module base path
13 WILDFLY_MODULE_BASE_PATH="${HOME}/wildfly_domain/modules/org/mxchange"
15 # And for this "module" (as WildFly calls it)
16 WILDFLY_MODULE_PATH="${WILDFLY_MODULE_BASE_PATH}/${NAME}/main"
19 WILDFLY_MODULE_XML_FILE="wildfly/module.xml"
21 # Glassfish base path (domain)
22 GLASSFISH_BASE_PATH="${HOME}/gf_domain/lib"
24 # Windows personal domain
25 PERSONAL_DOMAIN_PATH="${HOME}/personal_domain/lib"
27 # Is the configuration file there?
28 if [ ! -f "${DIST_CONFIG_FILE}" ]
30 echo "$0: Configuration file '${DIST_CONFIG_FILE}' not found"
32 echo "Following variables are needed for SSH upload:"
33 echo "- GLASSFISH_SSH_PATH"
34 echo "- GLASSFISH_SSH_USER"
35 echo "- GLASSFISH_SSH_SERVER"
37 echo "And create a password-less SSH key."
41 source "${DIST_CONFIG_FILE}"
45 LIST=$(find ../*/lib/${NAME}.jar)
46 LIST="${LIST} ${WILDFLY_MODULE_PATH}"
48 if [ -d "${GLASSFISH_BASE_PATH}" ]
50 echo "$0: Glassfish personal domain found, adding to LIST ..."
51 LIST="${LIST} ${GLASSFISH_BASE_PATH}"
54 if [ -d "${PERSONAL_DOMAIN_PATH}" ]
56 echo "$0: Personal domain found, adding to LIST ..."
57 LIST="${LIST} ${PERSONAL_DOMAIN_PATH}"
62 echo "$0: '${DIST}' not found."
64 elif [ ! -d "${WILDFLY_MODULE_BASE_PATH}" ]
66 echo "$0: WildFly base path '${WILDFLY_MODULE_BASE_PATH}' not created."
67 elif [ ! -d "${WILDFLY_MODULE_PATH}" ]
69 mkdir -vp "${WILDFLY_MODULE_PATH}"
72 for project in ${LIST};
74 if [ -d "${project}" ]
76 cp -v "${DIST}" "${project}"
77 elif [ -f "${project}" ]
79 cp -v "${DIST}" "${project}"
81 echo "$0: Project '${project}' not found."
85 if [ -n "${GLASSFISH_SSH_USER}" -a -n "${GLASSFISH_SSH_SERVER}" -a -n "${GLASSFISH_SSH_PATH}" ]
87 if [ "$1" != "r" -a "${NAME}" != "jcore" -a "${NAME}" != "jcore-swing" ]
89 echo "$0: Copying to remote '${GLASSFISH_SSH_SERVER}' ..."
90 scp "${DIST}" "${GLASSFISH_SSH_USER}@${GLASSFISH_SSH_SERVER}:${GLASSFISH_SSH_PATH}" || exit 255
93 echo "$0: SSH upload disabled."
97 if [ -f "${WILDFLY_MODULE_XML_FILE}" ]
99 echo "$0: Generating module.xml ..."
100 XML_CONTENT=$(cat "${WILDFLY_MODULE_XML_FILE}")
101 XML_CONTENT="${XML_CONTENT//NAME/$NAME}"
102 echo "${XML_CONTENT}" > "${WILDFLY_MODULE_PATH}/module.xml"