This is an automated email from the ASF dual-hosted git repository. chesnay pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
commit e638115336b2c88c16fbc421dd2ae931e39d1df4 Author: Chesnay Schepler <ches...@apache.org> AuthorDate: Fri Aug 11 11:02:59 2023 +0200 [FLINK-32834] Decouple low-level scripts from maven-utlls - ease usage by reducing number of parameters - avoid CI-exclusive maven-utils - use mvnw by default --- tools/ci/compile.sh | 6 +++--- tools/ci/license_check.sh | 7 +++---- tools/ci/verify_bundled_optional.sh | 7 +++---- tools/ci/verify_scala_suffixes.sh | 8 +++----- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/tools/ci/compile.sh b/tools/ci/compile.sh index 11e1e22e9e6..271501033e4 100755 --- a/tools/ci/compile.sh +++ b/tools/ci/compile.sh @@ -97,11 +97,11 @@ fi echo "============ Checking bundled dependencies marked as optional ============" -${CI_DIR}/verify_bundled_optional.sh $MVN_CLEAN_COMPILE_OUT "$CI_DIR" || exit $? +MVN=run_mvn ${CI_DIR}/verify_bundled_optional.sh $MVN_CLEAN_COMPILE_OUT || exit $? echo "============ Checking scala suffixes ============" -${CI_DIR}/verify_scala_suffixes.sh "$CI_DIR" || exit $? +MVN=run_mvn ${CI_DIR}/verify_scala_suffixes.sh || exit $? echo "============ Checking shaded dependencies ============" @@ -117,7 +117,7 @@ echo "============ Run license check ============" find $MVN_VALIDATION_DIR # We use a different Scala version with Java 17 if [[ ${PROFILE} != *"jdk17"* ]]; then - ${CI_DIR}/license_check.sh $MVN_CLEAN_COMPILE_OUT $CI_DIR $MVN_VALIDATION_DIR || exit $? + MVN=run_mvn ${CI_DIR}/license_check.sh $MVN_CLEAN_COMPILE_OUT $MVN_VALIDATION_DIR || exit $? fi exit $EXIT_CODE diff --git a/tools/ci/license_check.sh b/tools/ci/license_check.sh index 3b3e02603c0..4f2aebbde00 100755 --- a/tools/ci/license_check.sh +++ b/tools/ci/license_check.sh @@ -18,12 +18,11 @@ ################################################################################ MVN_CLEAN_COMPILE_OUT=$1 -CI_DIR=$2 -FLINK_DEPLOYED_ROOT=$3 +FLINK_DEPLOYED_ROOT=$2 -source "${CI_DIR}/maven-utils.sh" +MVN=${MVN:-./mvnw} -run_mvn -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.licensecheck.LicenseChecker -Dexec.args="$MVN_CLEAN_COMPILE_OUT $(pwd) $FLINK_DEPLOYED_ROOT" +$MVN -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.licensecheck.LicenseChecker -Dexec.args="$MVN_CLEAN_COMPILE_OUT $(pwd) $FLINK_DEPLOYED_ROOT" EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then diff --git a/tools/ci/verify_bundled_optional.sh b/tools/ci/verify_bundled_optional.sh index bcacc705f43..34fff60ca2d 100755 --- a/tools/ci/verify_bundled_optional.sh +++ b/tools/ci/verify_bundled_optional.sh @@ -19,17 +19,16 @@ ## Checks that all bundled dependencies are marked as optional in the poms MVN_CLEAN_COMPILE_OUT=$1 -CI_DIR=$2 -source "${CI_DIR}/maven-utils.sh" +MVN=${MVN:-./mvnw} dependency_plugin_output=/tmp/optional_dep.txt -run_mvn dependency:tree -B > "${dependency_plugin_output}" +$MVN dependency:tree -B > "${dependency_plugin_output}" cat "${dependency_plugin_output}" -run_mvn -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.optional.ShadeOptionalChecker -Dexec.args="${MVN_CLEAN_COMPILE_OUT} ${dependency_plugin_output}" +$MVN -pl tools/ci/flink-ci-tools exec:java -Dexec.mainClass=org.apache.flink.tools.ci.optional.ShadeOptionalChecker -Dexec.args="${MVN_CLEAN_COMPILE_OUT} ${dependency_plugin_output}" EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then diff --git a/tools/ci/verify_scala_suffixes.sh b/tools/ci/verify_scala_suffixes.sh index 37581b472b3..4c5cc389eb3 100755 --- a/tools/ci/verify_scala_suffixes.sh +++ b/tools/ci/verify_scala_suffixes.sh @@ -37,17 +37,15 @@ # # The script uses 'mvn dependency:tree -Dincludes=org.scala-lang' to list Scala # dependent modules. -CI_DIR=$1 +MVN=${MVN:-./mvnw} echo "--- Flink Scala Dependency Analyzer ---" echo "Analyzing modules for Scala dependencies using 'mvn dependency:tree'." echo "If you haven't built the project, please do so first by running \"mvn clean install -DskipTests\"" -source "${CI_DIR}/maven-utils.sh" - dependency_plugin_output=/tmp/dep.txt -run_mvn dependency:tree -Dincludes=org.scala-lang,:*_2.1*:: ${MAVEN_ARGUMENTS} > "${dependency_plugin_output}" +$MVN dependency:tree -Dincludes=org.scala-lang,:*_2.1*:: ${MAVEN_ARGUMENTS} > "${dependency_plugin_output}" EXIT_CODE=$? if [ $EXIT_CODE != 0 ]; then @@ -58,7 +56,7 @@ if [ $EXIT_CODE != 0 ]; then exit 1 fi -run_mvn -pl tools/ci/flink-ci-tools exec:java exec:java -Dexec.mainClass=org.apache.flink.tools.ci.suffixcheck.ScalaSuffixChecker -Dexec.args="${dependency_plugin_output} $(pwd)" +$MVN -pl tools/ci/flink-ci-tools exec:java exec:java -Dexec.mainClass=org.apache.flink.tools.ci.suffixcheck.ScalaSuffixChecker -Dexec.args="${dependency_plugin_output} $(pwd)" EXIT_CODE=$? if [ $EXIT_CODE == 0 ]; then