Skip to content

Commit

Permalink
build: update dependencies check to only check for runtime and compil…
Browse files Browse the repository at this point in the history
…e scopes (#678)

* change:Updated dependencies check to only use runtime & compile scope

* Update dependencies.sh

* feat: update dependencies check to only check for runtime and compile
scopes

Co-authored-by: Saleh Mostafa <salehmostafa@google.com>
Co-authored-by: Jeffrey Rennie <rennie@google.com>
  • Loading branch information
3 people authored Aug 6, 2020
1 parent 4530cc6 commit f8823de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions synthtool/gcp/templates/java_library/.kokoro/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ function completenessCheck() {
# Output dep list with compile scope generated using the original pom
# Running mvn dependency:list on Java versions that support modules will also include the module of the dependency.
# This is stripped from the output as it is not present in the flattened pom.
# Only dependencies with 'compile' or 'runtime' scope are included from original dependency list.
msg "Generating dependency list using original pom..."
mvn dependency:list -f pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// | grep -v ':test$' >.org-list.txt
mvn dependency:list -f pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' | sed -e s/\\s--\\smodule.*// >.org-list.txt

# Output dep list generated using the flattened pom (test scope deps are ommitted)
# Output dep list generated using the flattened pom (only 'compile' and 'runtime' scopes)
msg "Generating dependency list using flattened pom..."
mvn dependency:list -f .flattened-pom.xml -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt
mvn dependency:list -f .flattened-pom.xml -DincludeScope=runtime -Dsort=true | grep '\[INFO] .*:.*:.*:.*:.*' >.new-list.txt

# Compare two dependency lists
msg "Comparing dependency lists..."
Expand Down Expand Up @@ -85,4 +86,4 @@ then
else
msg "Errors found. See log statements above."
exit 1
fi
fi

0 comments on commit f8823de

Please sign in to comment.