Skip to content

Commit

Permalink
WIP 332 Bump DTCW/DTC
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Aug 13, 2024
1 parent 168b5a8 commit c4aad56
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions dtcw
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set -o pipefail

# See https://github.com/docToolchain/docToolchain/releases for available versions.
# Set DTC_VERSION to "latest" to get the latest, yet unreleased version.
: "${DTC_VERSION:=3.3.1}"
: "${DTC_VERSION:=3.4.0}"

# if not set, public docker hub is used
: "${DTC_DOCKER_PREFIX:=}"
Expand All @@ -25,7 +25,7 @@ set -o pipefail
# export DTC_TEMPLATE1=https://....zip
# export DTC_TEMPLATE2=https://....zip

# docToolchain configurtion file may be overruled by the user
# docToolchain configuration file may be overruled by the user
: "${DTC_CONFIG_FILE:=docToolchainConfig.groovy}"

# Contains the current project git branch, "-" if not available
Expand Down Expand Up @@ -85,7 +85,7 @@ main() {
install_component_and_exit "${environment}" "${2-}"
elif [ "${1}" = "getJava" ]; then
# TODO: remove getJava in the next major release
echo "Warning: 'getJava' is deprecated and and will be removed. Use './dtcw install java' instead."
echo "Warning: 'getJava' is deprecated and will be removed. Use './dtcw install java' instead."
install_component_and_exit "${environment}" "java"
fi

Expand Down Expand Up @@ -129,7 +129,9 @@ main() {
fi

# echo "Command to invoke: ${command}"
exec ${emu} ${bash} -c "${command}"
# shellcheck disable=SC2086
# as we hope to know what we are doing here ;-)
exec ${emu} ${bash} ${DTC_SHELL_DEBUG:-} -c "${command}"
}

assert_argument_exists() {
Expand All @@ -148,8 +150,8 @@ usage() {
cat <<EOF
dtcw - Create awesome documentation the easy way with docToolchain.
Usage: ./dtcw [environment] [option...] [task...]
./dtcw [local] install {doctoolchain | java }
Usage: ./dtcw [environment] [option...] [task...]
Use 'local', 'sdk' or 'docker' as first argument to force the use of a specific
docToolchain environment:
Expand Down Expand Up @@ -642,12 +644,16 @@ build_command() {
DTC_OPTS="${DTC_OPTS} '-Dgradle.user.home=${DTC_ROOT}/.gradle'"
fi
if [ "${env}" = local ]; then
if [ -x "${DTC_HOME}/bin/doctoolchain" ]; then
cmd="${DTC_HOME}/bin/doctoolchain"
# is doctoolchain available on the path?
if command -v doctoolchain >/dev/null 2>&1; then
cmd="doctoolchain . ${*} ${DTC_OPTS}"
elif command -v doctoolchain >/dev/null 2>&1; then
cmd="doctoolchain"
else
cmd="${DTC_HOME}/bin/doctoolchain . ${*} ${DTC_OPTS}"
echo "Could not find doctoolchain executable, neither in '${DTC_HOME}' nor on PATH ('${PATH}')" >&2
exit 1
fi
cmd="${cmd} . ${*} ${DTC_OPTS}"
else
cmd="$(sdk_home_doctoolchain "${version}")/bin/doctoolchain . ${*} ${DTC_OPTS}"
fi
Expand Down

0 comments on commit c4aad56

Please sign in to comment.