Skip to content

Commit 41cb69f

Browse files
author
Threepwood-7
committed
CI-051 honor workspace output root for Windows builds
1 parent e0cecf6 commit 41cb69f

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

packaging/windows/build.sh

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ usage() {
1111
cat >&2 <<EOF
1212
usage: $0 [build|installer|sign]
1313
14-
build default action: cmake configurebuildinstall portable tree
14+
build default action: cmake configure, build, install portable tree, and
1515
zip into dist/. Idempotent; reuses existing build/ if present.
1616
installer build the NSIS installer .exe on top of an already-staged
1717
portable tree (run \`$0\` first). Idempotent.
@@ -48,9 +48,25 @@ case "${WINDOWS_MSYSTEM}" in
4848
*) echo "fatal: unsupported WINDOWS_MSYSTEM=${WINDOWS_MSYSTEM}" >&2; exit 1 ;;
4949
esac
5050

51-
BUILD_DIR="${REPO_ROOT}/build-windows-${ARCH}"
52-
PORTABLE_DIR="${REPO_ROOT}/amule-portable-${ARCH}"
53-
DIST_DIR="${REPO_ROOT}/dist"
51+
to_msys_path() {
52+
local value="$1"
53+
if command -v cygpath >/dev/null && [[ "${value}" =~ ^[A-Za-z]:[\\/] ]]; then
54+
cygpath -u "${value}"
55+
else
56+
printf '%s\n' "${value}"
57+
fi
58+
}
59+
60+
if [[ -n "${EMULEBB_WORKSPACE_OUTPUT_ROOT:-}" ]]; then
61+
OUTPUT_ROOT="$(to_msys_path "${EMULEBB_WORKSPACE_OUTPUT_ROOT}")"
62+
BUILD_DIR="${OUTPUT_ROOT}/builds/amule/windows-${ARCH}"
63+
PORTABLE_DIR="${OUTPUT_ROOT}/builds/amule/amule-portable-${ARCH}"
64+
DIST_DIR="${OUTPUT_ROOT}/release/amule"
65+
else
66+
BUILD_DIR="${REPO_ROOT}/build-windows-${ARCH}"
67+
PORTABLE_DIR="${REPO_ROOT}/amule-portable-${ARCH}"
68+
DIST_DIR="${REPO_ROOT}/dist"
69+
fi
5470
mkdir -p "${DIST_DIR}"
5571

5672
VERSION=$(cd "${REPO_ROOT}" && git describe --tags --always 2>/dev/null || echo "snapshot")

0 commit comments

Comments
 (0)