From commits-return-1347-archive-asf-public=cust-asf.ponee.io@yetus.apache.org Fri May 17 14:26:31 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 0BE2C18060F for ; Fri, 17 May 2019 16:26:30 +0200 (CEST) Received: (qmail 41143 invoked by uid 500); 17 May 2019 14:26:30 -0000 Mailing-List: contact commits-help@yetus.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@yetus.apache.org Delivered-To: mailing list commits@yetus.apache.org Received: (qmail 41130 invoked by uid 99); 17 May 2019 14:26:30 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 May 2019 14:26:30 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C04FE85CD5; Fri, 17 May 2019 14:26:29 +0000 (UTC) Date: Fri, 17 May 2019 14:26:29 +0000 To: "commits@yetus.apache.org" Subject: [yetus] branch master updated: YETUS-860. mvn dependency order needs special handling for version change (#55) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155810318972.4499.4006801453884003111@gitbox.apache.org> From: aw@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: yetus X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 047829203e877810cf201b98458589e168b9511a X-Git-Newrev: 29770a34f867c1daffb9fec2d9d73882290aa445 X-Git-Rev: 29770a34f867c1daffb9fec2d9d73882290aa445 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. aw pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/yetus.git The following commit(s) were added to refs/heads/master by this push: new 29770a3 YETUS-860. mvn dependency order needs special handling for version change (#55) 29770a3 is described below commit 29770a34f867c1daffb9fec2d9d73882290aa445 Author: Allen Wittenauer AuthorDate: Fri May 17 07:26:25 2019 -0700 YETUS-860. mvn dependency order needs special handling for version change (#55) --- precommit/src/main/shell/test-patch.d/maven.sh | 40 ++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/precommit/src/main/shell/test-patch.d/maven.sh b/precommit/src/main/shell/test-patch.d/maven.sh index 09690ee..22ad6a4 100755 --- a/precommit/src/main/shell/test-patch.d/maven.sh +++ b/precommit/src/main/shell/test-patch.d/maven.sh @@ -25,6 +25,7 @@ fi MAVEN_CUSTOM_REPOS=false MAVEN_CUSTOM_REPOS_DIR="@@@WORKSPACE@@@/yetus-m2" MAVEN_DEPENDENCY_ORDER=true +MAVEN_FOUND_ROOT_POM=false add_test_type mvnsite add_build_tool maven @@ -269,6 +270,9 @@ function maven_filefilter if [[ ${filename} =~ pom\.xml$ ]]; then yetus_debug "tests/compile: ${filename}" add_test compile + if [[ "${filename}" =~ ^pom\.xml$ ]]; then + MAVEN_FOUND_ROOT_POM=true + fi fi } @@ -474,7 +478,7 @@ function maven_builtin_personality_modules if [[ ${repostatus} == branch && ${testtype} == mvninstall ]] || [[ "${BUILDMODE}" = full ]];then - personality_enqueue_module "${CHANGED_UNION_MODULES}" + personality_enqueue_module . return fi @@ -610,7 +614,7 @@ function maven_precompile { declare repostatus=$1 declare result=0 - declare need=false + declare need=${2:-false} if [[ ${BUILDTOOL} != maven ]]; then return 0 @@ -625,11 +629,11 @@ function maven_precompile fi done - if [[ "${need}" = false ]]; then + if [[ "${need}" == false ]]; then return 0 fi - if [[ "${repostatus}" = branch ]]; then + if [[ "${repostatus}" == branch ]]; then big_console_header "maven install: ${PATCH_BRANCH}" else big_console_header "maven install: ${BUILDMODE}" @@ -690,8 +694,32 @@ function maven_reorder_module_process fi done - fn=$(module_file_fragment "${CHANGED_UNION_MODULES}") - pushd "${BASEDIR}/${CHANGED_UNION_MODULES}" >/dev/null || return 1 + if [[ "${BUILDMODE}" == patch ]] && [[ "${MAVEN_FOUND_ROOT_POM}" == true ]]; then + + echo "" + echo "Testing root pom.xml file for version change" + echo "" + fn=$(module_file_fragment "${CHANGED_UNION_MODULES}") + pushd "${BASEDIR}/${CHANGED_UNION_MODULES}" >/dev/null || return 1 + + # shellcheck disable=SC2046 + echo_and_redirect \ + "${PATCH_DIR}/maven-${repostatus}-version-${fn}.txt" \ + $("${BUILDTOOL}_executor") \ + "-fae" \ + "org.apache.maven.plugins:maven-help-plugin:evaluate" \ + '-Dexpression=project.version' \ + "-Doutput=${PATCH_DIR}/maven-${repostatus}-version.txt" + + projectversion=$(cat "${PATCH_DIR}/maven-${repostatus}-version.txt") + + if [[ -z "${MAVEN_DETECTED_PROJECT_VERSION}" ]]; then + MAVEN_DETECTED_PROJECT_VERSION=${projectversion} + elif [[ "${MAVEN_DETECTED_PROJECT_VERSION}" != "${projectversion}" ]]; then + echo "Patch changes root pom.xml project.version: forcing an extra mvn install on the patched branch" + maven_precompile branch true + fi + fi # get the module directory list in the correct order based on maven dependencies # shellcheck disable=SC2046