You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ch...@apache.org on 2019/05/02 08:42:29 UTC

[flink] 08/10: [hotfix][travis] Speed up scala-suffix check

This is an automated email from the ASF dual-hosted git repository.

chesnay pushed a commit to branch release-1.8
in repository https://gitbox.apache.org/repos/asf/flink.git

commit 66a08d9a21618f22c608c7686ef3648da35a4e95
Author: Chesnay Schepler <ch...@apache.org>
AuthorDate: Fri Apr 26 13:28:04 2019 +0200

    [hotfix][travis] Speed up scala-suffix check
    
    - fix find -mindepth parameter
    - pass PROFILE to maven to prevent downloads of modules that weren't built beforehand
    - add -maxdepth parameter for pom.xml searches
---
 tools/travis_controller.sh     | 2 +-
 tools/verify_scala_suffixes.sh | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/tools/travis_controller.sh b/tools/travis_controller.sh
index 30b3923..c0f70a5 100755
--- a/tools/travis_controller.sh
+++ b/tools/travis_controller.sh
@@ -68,7 +68,7 @@ if [ $STAGE == "$STAGE_COMPILE" ]; then
         printf "Checking scala suffixes\n"
         printf "==============================================================================\n"
 
-        ./tools/verify_scala_suffixes.sh
+        ./tools/verify_scala_suffixes.sh "${PROFILE}"
         EXIT_CODE=$?
     else
         printf "\n==============================================================================\n"
diff --git a/tools/verify_scala_suffixes.sh b/tools/verify_scala_suffixes.sh
index c20a607..2123ab1 100755
--- a/tools/verify_scala_suffixes.sh
+++ b/tools/verify_scala_suffixes.sh
@@ -61,6 +61,7 @@
 # [INFO]       \- org.scala-lang:scala-library:jar:2.10.4:compile
 # [INFO]
 
+MAVEN_ARGUMENTS=${1:-""}
 
 if [[ `basename $PWD` == "tools" ]] ; then
     cd ..
@@ -83,7 +84,7 @@ block_infected=0
 # a) are not deployed during a release
 # b) exist only for dev purposes
 # c) no-one should depend on them
-e2e_modules=$(find flink-end-to-end-tests -mindeptha 2 -maxdepth 5 -name 'pom.xml' -printf '%h\n' | sort -u | tr '\n' ',')
+e2e_modules=$(find flink-end-to-end-tests -mindepth 2 -maxdepth 5 -name 'pom.xml' -printf '%h\n' | sort -u | tr '\n' ',')
 excluded_modules=\!${e2e_modules//,/,\!},!flink-docs
 
 echo "Analyzing modules for Scala dependencies using 'mvn dependency:tree'."
@@ -116,7 +117,7 @@ while read line; do
             block_infected=1
         fi
     fi
-done < <(mvn -nsu dependency:tree -Dincludes=org.scala-lang -pl ${excluded_modules} | tee /dev/tty)
+done < <(mvn -nsu dependency:tree -Dincludes=org.scala-lang -pl ${excluded_modules} ${MAVEN_ARGUMENTS} | tee /dev/tty)
 
 
 # deduplicate and sort
@@ -140,7 +141,7 @@ echo
 echo "Checking Scala-free modules:"
 
 for module in $clean; do
-    out=`find . -name 'pom.xml' -not -path '*target*' -exec grep "${module}_\d\+\.\d\+</artifactId>" "{}" \;`
+    out=`find . -maxdepth 3 -name 'pom.xml' -not -path '*target*' -exec grep "${module}_\d\+\.\d\+</artifactId>" "{}" \;`
     if [[ "$out" == "" ]]; then
         printf "$GREEN OK $NC $module\n"
     else
@@ -154,7 +155,7 @@ echo
 echo "Checking Scala-dependent modules:"
 
 for module in $infected; do
-    out=`find . -name 'pom.xml' -not -path '*target*' -exec grep "${module}</artifactId>" "{}" \;`
+    out=`find . -maxdepth 3 -name 'pom.xml' -not -path '*target*' -exec grep "${module}</artifactId>" "{}" \;`
     if [[ "$out" == "" ]]; then
         printf "$GREEN OK $NC $module\n"
     else