Skip to content

Commit 5d84aae

Browse files
committed
macOS (2)
1 parent fcffa61 commit 5d84aae

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

ci/scripts/java_build.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,15 @@ cp -r "${source_dir}/dev" "${build_dir}"
4747
# Instead of hardcoding the list of directories to copy, find pom.xml and then
4848
# crawl back up to the top. GNU realpath has --relative-to but this does not
4949
# work on macOS
50-
for source_root in $(find "${source_dir}" -not \( -path "${source_dir}"/build -prune \) -type f -name pom.xml -exec python -c "import os.path; print(os.path.relpath('{}', '${source_dir}'))" \; |
51-
awk -F/ '{print $1}' |
52-
sort -u); do
50+
51+
poms=$(find "${source_dir}" -not \( -path "${source_dir}"/build -prune \) -type f -name pom.xml)
52+
if [[ "$OSTYPE" == "darwin" ]]; then
53+
poms=$(echo "$poms" | xargs -n1 python -c "import os.path; print(os.path.relpath('{}', '${source_dir}'))")
54+
else
55+
poms=$(echo "$poms" | xargs -n1 realpath -s --relative-to="${source_dir}")
56+
fi
57+
58+
for source_root in $(echo "${poms}" | awk -F/ '{print $1}' | sort -u); do
5359
cp -r "${source_dir}/${source_root}" "${build_dir}"
5460
done
5561

0 commit comments

Comments
 (0)