Skip to content

Commit

Permalink
include missing helper
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeddada1 committed Apr 30, 2024
1 parent 17576ac commit d1b9bcb
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .kokoro/presubmit/downstream-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ EOF
popd || exit 1
}
# Find all pom.xml files that declare a specific version for the given artifact ($1)
function find_all_poms_with_versioned_dependency {
poms=($(find . -name pom.xml))
for pom in "${poms[@]}"; do
if xmllint --xpath "//*[local-name()='artifactId' and text()='$1']/following-sibling::*[local-name()='version']" "$pom" &>/dev/null; then
found+=("$pom")
fi
done
POMS=(${found[@]})
unset found
export POMS
}

# In the given directory ($1),
# find and update all pom.xmls' dependencies on the given artifact ($2) to the given version ($3)
# ex: update_all_poms_dependency google-cloud-java google-cloud-shared-dependencies 1.2.3
Expand Down

0 comments on commit d1b9bcb

Please sign in to comment.