diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh index 146a40cf7a..a790f11b1c 100755 --- a/ci/scripts/build.sh +++ b/ci/scripts/build.sh @@ -43,17 +43,11 @@ cp -r "${source_dir}/arrow-format" "${build_dir}" cp -r "${source_dir}/dev" "${build_dir}" # Instead of hardcoding the list of directories to copy, find pom.xml and then -# crawl back up to the top. GNU realpath has --relative-to but this does not -# work on macOS - -poms=$(find "${source_dir}" -not \( -path "${source_dir}"/build -prune \) -type f -name pom.xml) -if [[ "$OSTYPE" == "darwin"* ]]; then - poms=$(echo "$poms" | xargs -n1 python -c "import sys; import os.path; print(os.path.relpath(sys.argv[1], '${source_dir}'))") -else - poms=$(echo "$poms" | xargs -n1 realpath -s --relative-to="${source_dir}") -fi +# crawl back up to the top. +poms=$(cd "${source_dir}" && find . -not \( -path ./build -prune \) -type f -name pom.xml) -for source_root in $(echo "${poms}" | awk -F/ '{print $1}' | sort -u); do +# ./dataset/pom.xml -> dataset +for source_root in $(echo "${poms}" | awk -F/ '{print $2}' | sort -u); do cp -r "${source_dir}/${source_root}" "${build_dir}" done