HIVE-17107: Upgrade Yetus to 0.5.0 (Barna Zsombor Klara via Peter Vary)
Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/9a5381cb Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/9a5381cb Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/9a5381cb Branch: refs/heads/hive-14535 Commit: 9a5381cb942b0a12aad3abe83f03b4cbe5ddc92f Parents: 1923e21 Author: Peter Vary <pv...@cloudera.com> Authored: Wed Sep 6 13:35:29 2017 +0200 Committer: Peter Vary <pv...@cloudera.com> Committed: Wed Sep 6 13:35:29 2017 +0200 ---------------------------------------------------------------------- dev-support/checkstyle_YETUS-484.sh | 406 ------------------ dev-support/findbugs_YETUS-471.sh | 488 ---------------------- dev-support/maven_YETUS-506.sh | 687 ------------------------------- dev-support/yetus-wrapper.sh | 11 +- 4 files changed, 1 insertion(+), 1591 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/9a5381cb/dev-support/checkstyle_YETUS-484.sh ---------------------------------------------------------------------- diff --git a/dev-support/checkstyle_YETUS-484.sh b/dev-support/checkstyle_YETUS-484.sh deleted file mode 100644 index e297a13..0000000 --- a/dev-support/checkstyle_YETUS-484.sh +++ /dev/null @@ -1,406 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -add_test_type checkstyle - -CHECKSTYLE_TIMER=0 -CHECKSTYLE_GOAL_DEFAULT="checkstyle" -CHECKSTYLE_GOAL="${CHECKSTYLE_GOAL_DEFAULT}" -CHECKSTYLE_OPTIONS_DEFAULT="-Dcheckstyle.consoleOutput=true" -CHECKSTYLE_OPTIONS="${CHECKSTYLE_OPTIONS_DEFAULT}" - -function checkstyle_filefilter -{ - local filename=$1 - - if [[ ${BUILDTOOL} == maven - || ${BUILDTOOL} == ant ]]; then - if [[ ${filename} =~ \.java$ ]]; then - add_test checkstyle - fi - fi -} - -## @description usage help for checkstyle -## @audience private -## @stability evolving -## @replaceable no -function checkstyle_usage -{ - yetus_add_option "--checkstyle-goal=<goal>" "Checkstyle maven plugin goal to use, 'check' and 'checkstyle' supported. Defaults to '${CHECKSTYLE_GOAL_DEFAULT}'." -} - -## @description parse checkstyle args -## @audience private -## @stability evolving -## @replaceable no -## @param arg -## @param .. -function checkstyle_parse_args -{ - local i - - for i in "$@"; do - case ${i} in - --checkstyle-goal=*) - CHECKSTYLE_GOAL=${i#*=} - case ${CHECKSTYLE_GOAL} in - check) - CHECKSTYLE_OPTIONS="-Dcheckstyle.consoleOutput=true -Dcheckstyle.failOnViolation=false" - ;; - checkstyle) - ;; - *) - yetus_error "Warning: checkstyle goal ${CHECKSTYLE_GOAL} not supported. It may have unexpected behavior" - ;; - esac - ;; - esac - done -} - -## @description initialize the checkstyle plug-in -## @audience private -## @stability evolving -## @replaceable no -function checkstyle_initialize -{ - if declare -f maven_add_install >/dev/null 2>&1; then - maven_add_install checkstyle - fi -} - -## @description checkstyle plug-in specific difference calculator -## @audience private -## @stability evolving -## @replaceable no -## @param branchlog -## @param patchlog -## @return differences -function checkstyle_calcdiffs -{ - declare orig=$1 - declare new=$2 - declare tmp=${PATCH_DIR}/pl.$$.${RANDOM} - declare j - - # first, strip filenames:line: - # this keeps column: in an attempt to increase - # accuracy in case of multiple, repeated errors - # since the column number shouldn't change - # if the line of code hasn't been touched - # remove the numbers from the error message for comparing - # so if only the error message numbers change - # we do not report new error - # shellcheck disable=SC2016 - cut -f3- -d: "${orig}" | awk -F'\1' '{ gsub("[0-9,]+", "", $2) ;print $1":"$2}' > "${tmp}.branch" - # shellcheck disable=SC2016 - cut -f3- -d: "${new}" | awk -F'\1' '{ gsub("[0-9,]+", "", $2) ;print $1":"$2}' > "${tmp}.patch" - - # compare the errors, generating a string of line - # numbers. Sorry portability: GNU diff makes this too easy - ${DIFF} --unchanged-line-format="" \ - --old-line-format="" \ - --new-line-format="%dn " \ - "${tmp}.branch" \ - "${tmp}.patch" > "${tmp}.lined" - - # now, pull out those lines of the raw output - # removing extra marker before the chekstyle error - # message which was needed for calculations - # shellcheck disable=SC2013 - for j in $(cat "${tmp}.lined"); do - # shellcheck disable=SC2086 - head -${j} "${new}" | tail -1 | tr -d $'\x01' - done - - rm "${tmp}.branch" "${tmp}.patch" "${tmp}.lined" 2>/dev/null -} - -## @description execute checkstyle -## @audience private -## @stability stable -## @replaceable no -function checkstyle_runner -{ - declare repostatus=$1 - declare tmp=${PATCH_DIR}/$$.${RANDOM} - declare j - declare i=0 - declare fn - declare savestart=${TIMER} - declare savestop - declare output - declare logfile - declare modulesuffix - declare cmd - declare logline - declare text - declare linenum - declare codeline - - # first, let's clear out any previous run information - modules_reset - - # loop through the modules we've been given - #shellcheck disable=SC2153 - until [[ $i -eq ${#MODULE[@]} ]]; do - - # start the clock per module, setup some help vars, etc - start_clock - fn=$(module_file_fragment "${MODULE[${i}]}") - modulesuffix=$(basename "${MODULE[${i}]}") - output="${PATCH_DIR}/${repostatus}-checkstyle-${fn}.txt" - logfile="${PATCH_DIR}/maven-${repostatus}-checkstyle-${fn}.txt" - - buildtool_cwd "${i}" - - case ${BUILDTOOL} in - ant) - cmd="${ANT} \ - -Dcheckstyle.consoleOutput=true \ - ${MODULEEXTRAPARAM[${i}]//@@@MODULEFN@@@/${fn}} \ - ${ANT_ARGS[*]} checkstyle" - ;; - maven) - cmd="${MAVEN} ${MAVEN_ARGS[*]} \ - checkstyle:${CHECKSTYLE_GOAL} \ - ${CHECKSTYLE_OPTIONS} \ - ${MODULEEXTRAPARAM[${i}]//@@@MODULEFN@@@/${fn}} -Ptest-patch" - ;; - *) - UNSUPPORTED_TEST=true - return 0 - ;; - esac - - # we're going to execute it and pull out - # anything that beings with a /. that's - # almost certainly checkstyle output. - # checkstyle 6.14 or upper adds severity - # to the beginning of line, so removing it - - #shellcheck disable=SC2086 - echo_and_redirect "${logfile}" ${cmd} - ${SED} -e "s,^\[ERROR\] ,,g" -e "s,^\[WARN\] ,,g" "${logfile}" \ - | ${GREP} ^/ \ - | ${SED} -e "s,${BASEDIR},.,g" \ - > "${tmp}" - - if [[ $? == 0 ]] ; then - module_status ${i} +1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} passed checkstyle" - else - module_status ${i} -1 "${logfile}" "${BUILDMODEMSG} ${modulesuffix} failed checkstyle" - ((result = result + 1)) - fi - - # if we have some output, we need to do more work: - if [[ -s ${tmp} && "${BUILDMODE}" = patch ]]; then - - # first, let's pull out all of the files that - # we actually care about, esp since that run - # above is likely from the entire source - # this will grealy cut down how much work we - # have to do later - - for j in "${CHANGED_FILES[@]}"; do - ${GREP} "${j}" "${tmp}" >> "${tmp}.1" - done - - - # now that we have just the files we care about, - # let's unscrew it. You see... - - # checkstyle seems to do everything it possibly can - # to make it hard to process, including inconsistent - # output (sometimes it has columns, sometimes it doesn't!) - # and giving very generic errors when context would be - # helpful, esp when doing diffs. - - # in order to help calcdiff and the user out, we're - # going to reprocess the output to include the code - # line being flagged. When calcdiff gets a hold of this - # it will have the code to act as context to help - # report the correct line - - # file:linenum:(column:)error ====> - # file:linenum:code(:column)\x01:error - # \x01 will later used to identify the begining - # of the checkstyle error message - pushd "${BASEDIR}" >/dev/null - while read -r logline; do - file=$(echo "${logline}" | cut -f1 -d:) - linenum=$(echo "${logline}" | cut -f2 -d:) - text=$(echo "${logline}" | cut -f3- -d:) - codeline=$(head -n "+${linenum}" "${file}" | tail -1 ) - { - echo -n "${file}:${linenum}:${codeline}" - echo -ne "\x01" - echo ":${text}" - } >> "${output}" - done < <(cat "${tmp}.1") - - popd >/dev/null - # later on, calcdiff will turn this into code(:column):error - # compare, and then put the file:line back onto it. - else - cp -p "${tmp}" "${output}" - fi - - rm "${tmp}" "${tmp}.1" 2>/dev/null - - savestop=$(stop_clock) - #shellcheck disable=SC2034 - MODULE_STATUS_TIMER[${i}]=${savestop} - - popd >/dev/null - ((i=i+1)) - done - - TIMER=${savestart} - - if [[ ${result} -gt 0 ]]; then - return 1 - fi - return 0 -} - -function checkstyle_postcompile -{ - declare repostatus=$1 - - if [[ "${repostatus}" = branch ]]; then - checkstyle_preapply - else - checkstyle_postapply - fi -} - -function checkstyle_preapply -{ - local result - - if ! verify_needed_test checkstyle; then - return 0 - fi - - big_console_header "checkstyle: ${PATCH_BRANCH}" - - start_clock - - personality_modules branch checkstyle - checkstyle_runner branch - result=$? - modules_messages branch checkstyle true - - # keep track of how much as elapsed for us already - CHECKSTYLE_TIMER=$(stop_clock) - if [[ ${result} != 0 ]]; then - return 1 - fi - return 0 -} - -function checkstyle_postapply -{ - declare result - declare module - declare mod - declare fn - declare i=0 - declare numbranch=0 - declare numpatch=0 - declare addpatch=0 - declare summarize=true - - if ! verify_needed_test checkstyle; then - return 0 - fi - - big_console_header "checkstyle: ${BUILDMODE}" - - start_clock - - personality_modules patch checkstyle - checkstyle_runner patch - result=$? - - if [[ ${UNSUPPORTED_TEST} = true ]]; then - return 0 - fi - - # add our previous elapsed to our new timer - # by setting the clock back - offset_clock "${CHECKSTYLE_TIMER}" - - until [[ $i -eq ${#MODULE[@]} ]]; do - if [[ ${MODULE_STATUS[${i}]} == -1 ]]; then - ((result=result+1)) - ((i=i+1)) - continue - fi - module=${MODULE[$i]} - fn=$(module_file_fragment "${module}") - - # if there is no comparison to be done, - # we can speed this up tremendously - if [[ "${BUILDMODE}" = full ]]; then - touch "${PATCH_DIR}/branch-checkstyle-${fn}.txt" - cp -p "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \ - "${PATCH_DIR}/diff-checkstyle-${fn}.txt" - else - - # call calcdiffs to allow overrides - calcdiffs \ - "${PATCH_DIR}/branch-checkstyle-${fn}.txt" \ - "${PATCH_DIR}/patch-checkstyle-${fn}.txt" \ - checkstyle \ - > "${PATCH_DIR}/diff-checkstyle-${fn}.txt" - fi - - #shellcheck disable=SC2016 - numbranch=$(wc -l "${PATCH_DIR}/branch-checkstyle-${fn}.txt" | ${AWK} '{print $1}') - #shellcheck disable=SC2016 - numpatch=$(wc -l "${PATCH_DIR}/patch-checkstyle-${fn}.txt" | ${AWK} '{print $1}') - #shellcheck disable=SC2016 - addpatch=$(wc -l "${PATCH_DIR}/diff-checkstyle-${fn}.txt" | ${AWK} '{print $1}') - - ((fixedpatch=numbranch-numpatch+addpatch)) - - statstring=$(generic_calcdiff_status "${numbranch}" "${numpatch}" "${addpatch}" ) - - mod=${module} - if [[ ${mod} = \. ]]; then - mod=root - fi - - if [[ ${addpatch} -gt 0 ]] ; then - ((result = result + 1)) - module_status ${i} -1 "diff-checkstyle-${fn}.txt" "${mod}: ${BUILDMODEMSG} ${statstring}" - elif [[ ${fixedpatch} -gt 0 ]]; then - module_status ${i} +1 "diff-checkstyle-${fn}.txt" "${mod}: ${BUILDMODEMSG} ${statstring}" - summarize=false - fi - ((i=i+1)) - done - - modules_messages patch checkstyle "${summarize}" - - if [[ ${result} != 0 ]]; then - return 1 - fi - return 0 -} http://git-wip-us.apache.org/repos/asf/hive/blob/9a5381cb/dev-support/findbugs_YETUS-471.sh ---------------------------------------------------------------------- diff --git a/dev-support/findbugs_YETUS-471.sh b/dev-support/findbugs_YETUS-471.sh deleted file mode 100644 index 84a807b..0000000 --- a/dev-support/findbugs_YETUS-471.sh +++ /dev/null @@ -1,488 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -FINDBUGS_HOME=${FINDBUGS_HOME:-} -FINDBUGS_WARNINGS_FAIL_PRECHECK=false -FINDBUGS_SKIP_MAVEN_SOURCE_CHECK=false - -add_test_type findbugs - -function findbugs_usage -{ - yetus_add_option "--findbugs-home=<path>" "Findbugs home directory (default \${FINDBUGS_HOME})" - yetus_add_option "--findbugs-strict-precheck" "If there are Findbugs warnings during precheck, fail" - yetus_add_option "--findbugs-skip-maven-source-check" "If the buildtool is maven, then skip the source check and run Findbugs for every module" -} - -function findbugs_parse_args -{ - local i - - for i in "$@"; do - case ${i} in - --findbugs-home=*) - FINDBUGS_HOME=${i#*=} - ;; - --findbugs-strict-precheck) - FINDBUGS_WARNINGS_FAIL_PRECHECK=true - ;; - --findbugs-skip-maven-source-check) - FINDBUGS_SKIP_MAVEN_SOURCE_CHECK=true - ;; - esac - done -} - -## @description initialize the findbugs plug-in -## @audience private -## @stability evolving -## @replaceable no -function findbugs_initialize -{ - if declare -f maven_add_install >/dev/null 2>&1; then - maven_add_install findbugs - fi -} - -function findbugs_filefilter -{ - local filename=$1 - - if [[ ${BUILDTOOL} == maven - || ${BUILDTOOL} == ant ]]; then - if [[ ${filename} =~ \.java$ - || ${filename} =~ (^|/)findbugs-exclude.xml$ ]]; then - add_test findbugs - fi - fi -} - -function findbugs_precheck -{ - declare exec - declare status=0 - - if [[ -z ${FINDBUGS_HOME} ]]; then - yetus_error "FINDBUGS_HOME was not specified." - status=1 - else - for exec in findbugs \ - computeBugHistory \ - convertXmlToText \ - filterBugs \ - setBugDatabaseInfo; do - if ! verify_command "${exec}" "${FINDBUGS_HOME}/bin/${exec}"; then - status=1 - fi - done - fi - if [[ ${status} == 1 ]]; then - add_vote_table 0 findbugs "Findbugs executables are not available." - delete_test findbugs - fi -} - -## @description Dequeue maven modules that lack java sources -## @audience private -## @stability evolving -## @replaceable no -function findbugs_maven_skipper -{ - declare -i i=0 - declare skiplist=() - declare modname - - start_clock - #shellcheck disable=SC2153 - until [[ ${i} -eq ${#MODULE[@]} ]]; do - # If there are no java source code in the module, - # skip parsing output xml file. - if [[ ! -d "${MODULE[${i}]}/src/main/java" ]]; then - skiplist=("${skiplist[@]}" "${MODULE[$i]}") - fi - ((i=i+1)) - done - - i=0 - - for modname in "${skiplist[@]}"; do - dequeue_personality_module "${modname}" - done - - if [[ -n "${modname}" ]]; then - if [[ "${BUILDMODE}" = patch ]]; then - add_vote_table 0 findbugs "Skipped patched modules with no Java source: ${skiplist[*]}" - else - add_vote_table 0 findbugs "Skipped ${#skiplist[@]} modules in the source tree with no Java source." - fi - fi -} - -## @description Run the maven findbugs plugin and record found issues in a bug database -## @audience private -## @stability evolving -## @replaceable no -## @return 0 on success -## @return 1 on failure -## @param repostatus -function findbugs_runner -{ - local name=$1 - local module - local result=0 - local fn - local warnings_file - local i=0 - local savestop - - personality_modules "${name}" findbugs - - # strip out any modules that aren't actually java modules - # this can save a lot of time during testing - if [[ "${BUILDTOOL}" = maven && ${FINDBUGS_SKIP_MAVEN_SOURCE_CHECK} == false ]]; then - findbugs_maven_skipper - fi - - "${BUILDTOOL}_modules_worker" "${name}" findbugs - - if [[ ${UNSUPPORTED_TEST} = true ]]; then - return 0 - fi - - #shellcheck disable=SC2153 - until [[ ${i} -eq ${#MODULE[@]} ]]; do - if [[ ${MODULE_STATUS[${i}]} == -1 ]]; then - ((result=result+1)) - ((i=i+1)) - continue - fi - start_clock - offset_clock "${MODULE_STATUS_TIMER[${i}]}" - module="${MODULE[${i}]}" - fn=$(module_file_fragment "${module}") - - case ${BUILDTOOL} in - maven) - file="${module}/target/findbugsXml.xml" - ;; - ant) - file="${ANT_FINDBUGSXML}" - ;; - esac - - if [[ ! -f ${file} ]]; then - module_status ${i} -1 "" "${name}/${module} no findbugs output file (${file})" - ((i=i+1)) - continue - fi - - warnings_file="${PATCH_DIR}/${name}-findbugs-${fn}-warnings" - - cp -p "${file}" "${warnings_file}.xml" - - if [[ ${name} == branch ]]; then - "${FINDBUGS_HOME}/bin/setBugDatabaseInfo" -name "${PATCH_BRANCH}" \ - "${warnings_file}.xml" "${warnings_file}.xml" - else - "${FINDBUGS_HOME}/bin/setBugDatabaseInfo" -name patch \ - "${warnings_file}.xml" "${warnings_file}.xml" - fi - if [[ $? != 0 ]]; then - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${i}]=${savestop} - module_status ${i} -1 "" "${name}/${module} cannot run setBugDatabaseInfo from findbugs" - ((result=result+1)) - ((i=i+1)) - continue - fi - - "${FINDBUGS_HOME}/bin/convertXmlToText" -html \ - "${warnings_file}.xml" \ - "${warnings_file}.html" - if [[ $? != 0 ]]; then - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${i}]=${savestop} - module_status ${i} -1 "" "${name}/${module} cannot run convertXmlToText from findbugs" - ((result=result+1)) - fi - - if [[ -z ${FINDBUGS_VERSION} - && ${name} == branch ]]; then - FINDBUGS_VERSION=$(${GREP} -i "BugCollection version=" "${warnings_file}.xml" \ - | cut -f2 -d\" \ - | cut -f1 -d\" ) - if [[ -n ${FINDBUGS_VERSION} ]]; then - add_footer_table findbugs "v${FINDBUGS_VERSION}" - fi - fi - - ((i=i+1)) - done - return ${result} -} - -## @description Track pre-existing findbugs warnings -## @audience private -## @stability evolving -## @replaceable no -## @return 0 on success -## @return 1 on failure -function findbugs_preapply -{ - declare fn - declare module - declare modindex=0 - declare warnings_file - declare module_findbugs_warnings - declare result=0 - declare msg - - if ! verify_needed_test findbugs; then - return 0 - fi - - big_console_header "findbugs detection: ${PATCH_BRANCH}" - - findbugs_runner branch - result=$? - - if [[ ${UNSUPPORTED_TEST} = true ]]; then - return 0 - fi - - until [[ ${modindex} -eq ${#MODULE[@]} ]]; do - if [[ ${MODULE_STATUS[${modindex}]} == -1 ]]; then - ((result=result+1)) - ((modindex=modindex+1)) - continue - fi - - module=${MODULE[${modindex}]} - start_clock - offset_clock "${MODULE_STATUS_TIMER[${modindex}]}" - fn=$(module_file_fragment "${module}") - warnings_file="${PATCH_DIR}/branch-findbugs-${fn}-warnings" - # shellcheck disable=SC2016 - module_findbugs_warnings=$("${FINDBUGS_HOME}/bin/filterBugs" -first \ - "${PATCH_BRANCH}" \ - "${warnings_file}.xml" \ - "${warnings_file}.xml" \ - | ${AWK} '{print $1}') - - if [[ ${module_findbugs_warnings} -gt 0 ]] ; then - msg="${module} in ${PATCH_BRANCH} has ${module_findbugs_warnings} extant Findbugs warnings." - if [[ "${FINDBUGS_WARNINGS_FAIL_PRECHECK}" = "true" ]]; then - module_status ${modindex} -1 "branch-findbugs-${fn}-warnings.html" "${msg}" - ((result=result+1)) - elif [[ "${BUILDMODE}" = full ]]; then - module_status ${modindex} -1 "branch-findbugs-${fn}-warnings.html" "${msg}" - ((result=result+1)) - populate_test_table FindBugs "module:${module}" - #shellcheck disable=SC2162 - while read line; do - firstpart=$(echo "${line}" | cut -f2 -d:) - secondpart=$(echo "${line}" | cut -f9- -d' ') - add_test_table "" "${firstpart}:${secondpart}" - done < <("${FINDBUGS_HOME}/bin/convertXmlToText" "${warnings_file}.xml") - else - module_status ${modindex} 0 "branch-findbugs-${fn}-warnings.html" "${msg}" - fi - fi - - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${modindex}]=${savestop} - ((modindex=modindex+1)) - done - modules_messages branch findbugs true - - if [[ ${result} != 0 ]]; then - return 1 - fi - return 0 -} - -## @description Verify patch does not trigger any findbugs warnings -## @audience private -## @stability evolving -## @replaceable no -## @return 0 on success -## @return 1 on failure -function findbugs_postinstall -{ - declare module - declare fn - declare combined_xml - declare branchxml - declare patchxml - declare newbugsbase - declare fixedbugsbase - declare branch_warnings - declare patch_warnings - declare fixed_warnings - declare line - declare firstpart - declare secondpart - declare i=0 - declare result=0 - declare savestop - declare summarize=true - declare statstring - - if ! verify_needed_test findbugs; then - return 0 - fi - - big_console_header "findbugs detection: ${BUILDMODE}" - - findbugs_runner patch - - if [[ ${UNSUPPORTED_TEST} = true ]]; then - return 0 - fi - - until [[ $i -eq ${#MODULE[@]} ]]; do - if [[ ${MODULE_STATUS[${i}]} == -1 ]]; then - ((result=result+1)) - ((i=i+1)) - continue - fi - - start_clock - offset_clock "${MODULE_STATUS_TIMER[${i}]}" - module="${MODULE[${i}]}" - - buildtool_cwd "${i}" - - fn=$(module_file_fragment "${module}") - - combined_xml="${PATCH_DIR}/combined-findbugs-${fn}.xml" - branchxml="${PATCH_DIR}/branch-findbugs-${fn}-warnings.xml" - patchxml="${PATCH_DIR}/patch-findbugs-${fn}-warnings.xml" - - if [[ -f "${branchxml}" ]]; then - # shellcheck disable=SC2016 - branch_warnings=$("${FINDBUGS_HOME}/bin/filterBugs" -first \ - "${PATCH_BRANCH}" \ - "${branchxml}" \ - "${branchxml}" \ - | ${AWK} '{print $1}') - else - branchxml=${patchxml} - fi - - newbugsbase="${PATCH_DIR}/new-findbugs-${fn}" - fixedbugsbase="${PATCH_DIR}/fixed-findbugs-${fn}" - - "${FINDBUGS_HOME}/bin/computeBugHistory" -useAnalysisTimes -withMessages \ - -output "${combined_xml}" \ - "${branchxml}" \ - "${patchxml}" - if [[ $? != 0 ]]; then - popd >/dev/null - module_status ${i} -1 "" "${module} cannot run computeBugHistory from findbugs" - ((result=result+1)) - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${i}]=${savestop} - ((i=i+1)) - continue - fi - - # shellcheck disable=SC2016 - patch_warnings=$("${FINDBUGS_HOME}/bin/filterBugs" -first \ - "patch" \ - "${patchxml}" \ - "${patchxml}" \ - | ${AWK} '{print $1}') - - #shellcheck disable=SC2016 - add_warnings=$("${FINDBUGS_HOME}/bin/filterBugs" -first patch \ - "${combined_xml}" "${newbugsbase}.xml" | ${AWK} '{print $1}') - if [[ $? != 0 ]]; then - popd >/dev/null - module_status ${i} -1 "" "${module} cannot run filterBugs (#1) from findbugs" - ((result=result+1)) - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${i}]=${savestop} - ((i=i+1)) - continue - fi - - #shellcheck disable=SC2016 - fixed_warnings=$("${FINDBUGS_HOME}/bin/filterBugs" -fixed patch \ - "${combined_xml}" "${fixedbugsbase}.xml" | ${AWK} '{print $1}') - if [[ $? != 0 ]]; then - popd >/dev/null - module_status ${i} -1 "" "${module} cannot run filterBugs (#2) from findbugs" - ((result=result+1)) - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${i}]=${savestop} - ((i=i+1)) - continue - fi - - statstring=$(generic_calcdiff_status "${branch_warnings}" "${patch_warnings}" "${add_warnings}") - - "${FINDBUGS_HOME}/bin/convertXmlToText" -html "${newbugsbase}.xml" \ - "${newbugsbase}.html" - if [[ $? != 0 ]]; then - popd >/dev/null - module_status ${i} -1 "" "${module} cannot run convertXmlToText from findbugs" - ((result=result+1)) - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${i}]=${savestop} - ((i=i+1)) - continue - fi - - if [[ ${add_warnings} -gt 0 ]] ; then - populate_test_table FindBugs "module:${module}" - #shellcheck disable=SC2162 - while read line; do - firstpart=$(echo "${line}" | cut -f2 -d:) - secondpart=$(echo "${line}" | cut -f9- -d' ') - add_test_table "" "${firstpart}:${secondpart}" - done < <("${FINDBUGS_HOME}/bin/convertXmlToText" "${newbugsbase}.xml") - - module_status ${i} -1 "new-findbugs-${fn}.html" "${module} ${statstring}" - ((result=result+1)) - elif [[ ${fixed_warnings} -gt 0 ]]; then - module_status ${i} +1 "" "${module} ${statstring}" - summarize=false - fi - savestop=$(stop_clock) - MODULE_STATUS_TIMER[${i}]=${savestop} - popd >/dev/null - ((i=i+1)) - done - - modules_messages patch findbugs "${summarize}" - if [[ ${result} != 0 ]]; then - return 1 - fi - return 0 -} - -function findbugs_rebuild -{ - declare repostatus=$1 - - if [[ "${repostatus}" = branch || "${BUILDMODE}" = full ]]; then - findbugs_preapply - else - findbugs_postinstall - fi -} http://git-wip-us.apache.org/repos/asf/hive/blob/9a5381cb/dev-support/maven_YETUS-506.sh ---------------------------------------------------------------------- diff --git a/dev-support/maven_YETUS-506.sh b/dev-support/maven_YETUS-506.sh deleted file mode 100755 index dcefdd4..0000000 --- a/dev-support/maven_YETUS-506.sh +++ /dev/null @@ -1,687 +0,0 @@ -#!/usr/bin/env bash -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -declare -a MAVEN_ARGS=("--batch-mode") - -if [[ -z "${MAVEN_HOME:-}" ]]; then - MAVEN=mvn -else - MAVEN=${MAVEN_HOME}/bin/mvn -fi - -MAVEN_CUSTOM_REPOS=false -MAVEN_CUSTOM_REPOS_DIR="${HOME}/yetus-m2" -MAVEN_DEPENDENCY_ORDER=true - -add_test_type mvnsite -add_test_type mvneclipse -add_build_tool maven - -## @description Add the given test type as requiring a mvn install during the branch phase -## @audience public -## @stability stable -## @replaceable yes -## @param test -function maven_add_install -{ - yetus_add_entry MAVEN_NEED_INSTALL "${1}" -} - -## @description Remove the given test type as requiring a mvn install -## @audience public -## @stability stable -## @replaceable yes -## @param test -function maven_delete_install -{ - yetus_delete_entry MAVEN_NEED_INSTALL "${1}" -} - -function maven_usage -{ - yetus_add_option "--mvn-cmd=<cmd>" "The 'mvn' command to use (default \${MAVEN_HOME}/bin/mvn, or 'mvn')" - yetus_add_option "--mvn-custom-repos" "Use per-project maven repos" - yetus_add_option "--mvn-custom-repos-dir=dir" "Location of repos, default is '${MAVEN_CUSTOM_REPOS_DIR}'" - yetus_add_option "--mvn-deps-order=<bool>" "Disable maven's auto-dependency module ordering (Default: '${MAVEN_DEPENDENCY_ORDER}')" - yetus_add_option "--mvn-settings=file" "File to use for settings.xml" -} - -function maven_parse_args -{ - local i - - for i in "$@"; do - case ${i} in - --mvn-cmd=*) - MAVEN=${i#*=} - ;; - --mvn-custom-repos) - MAVEN_CUSTOM_REPOS=true - ;; - --mvn-custom-repos-dir=*) - MAVEN_CUSTOM_REPOS_DIR=${i#*=} - ;; - --mvn-deps-order=*) - MAVEN_DEPENDENCY_ORDER=${i#*=} - ;; - --mvn-settings=*) - MAVEN_SETTINGS=${i#*=} - if [[ -f ${MAVEN_SETTINGS} ]]; then - MAVEN_ARGS=("${MAVEN_ARGS[@]}" "--settings=${MAVEN_SETTINGS}") - else - yetus_error "WARNING: ${MAVEN_SETTINGS} not found. Ignoring." - fi - ;; - esac - done - - if [[ ${OFFLINE} == "true" ]]; then - MAVEN_ARGS=("${MAVEN_ARGS[@]}" --offline) - fi -} - -function maven_initialize -{ - if ! verify_command "maven" "${MAVEN}"; then - return 1 - fi - - # we need to do this before docker does it as root - - maven_add_install mvneclipse - maven_add_install mvnsite - maven_add_install unit - - # we need to do this before docker does it as root - if [[ ! ${MAVEN_CUSTOM_REPOS_DIR} =~ ^/ ]]; then - yetus_error "ERROR: --mvn-custom-repos-dir must be an absolute path." - return 1 - fi - - if [[ ${MAVEN_CUSTOM_REPOS} = true ]]; then - MAVEN_LOCAL_REPO="${MAVEN_CUSTOM_REPOS_DIR}" - if [[ -e "${MAVEN_CUSTOM_REPOS_DIR}" - && ! -d "${MAVEN_CUSTOM_REPOS_DIR}" ]]; then - yetus_error "ERROR: ${MAVEN_CUSTOM_REPOS_DIR} is not a directory." - return 1 - elif [[ ! -d "${MAVEN_CUSTOM_REPOS_DIR}" ]]; then - yetus_debug "Creating ${MAVEN_CUSTOM_REPOS_DIR}" - mkdir -p "${MAVEN_CUSTOM_REPOS_DIR}" - fi - fi - - if [[ -e "${HOME}/.m2" - && ! -d "${HOME}/.m2" ]]; then - yetus_error "ERROR: ${HOME}/.m2 is not a directory." - return 1 - elif [[ ! -e "${HOME}/.m2" ]]; then - yetus_debug "Creating ${HOME}/.m2" - mkdir -p "${HOME}/.m2" - fi -} - -function maven_precheck -{ - declare logfile="${PATCH_DIR}/mvnrepoclean.log" - declare line - - if [[ ! ${MAVEN_CUSTOM_REPOS_DIR} =~ ^/ ]]; then - yetus_error "ERROR: --mvn-custom-repos-dir must be an absolute path." - return 1 - fi - - if [[ ${MAVEN_CUSTOM_REPOS} = true ]]; then - MAVEN_LOCAL_REPO="${MAVEN_CUSTOM_REPOS_DIR}/${PROJECT_NAME}-${PATCH_BRANCH}-${BUILDMODE}-${INSTANCE}" - if [[ -e "${MAVEN_LOCAL_REPO}" - && ! -d "${MAVEN_LOCAL_REPO}" ]]; then - yetus_error "ERROR: ${MAVEN_LOCAL_REPO} is not a directory." - return 1 - fi - - if [[ ! -d "${MAVEN_LOCAL_REPO}" ]]; then - yetus_debug "Creating ${MAVEN_LOCAL_REPO}" - mkdir -p "${MAVEN_LOCAL_REPO}" - if [[ $? -ne 0 ]]; then - yetus_error "ERROR: Unable to create ${MAVEN_LOCAL_REPO}" - return 1 - fi - fi - touch "${MAVEN_LOCAL_REPO}" - - # if we have a local settings.xml file, we copy it. - if [[ -f "${HOME}/.m2/settings.xml" ]]; then - cp -p "${HOME}/.m2/settings.xml" "${MAVEN_LOCAL_REPO}" - fi - MAVEN_ARGS=("${MAVEN_ARGS[@]}" "-Dmaven.repo.local=${MAVEN_LOCAL_REPO}") - - # let's do some cleanup while we're here - - find "${MAVEN_CUSTOM_REPOS_DIR}" \ - -name '*-*-*' \ - -type d \ - -mtime +30 \ - -maxdepth 1 \ - -print \ - > "${logfile}" - - while read -r line; do - echo "Removing old maven repo ${line}" - rm -rf "${line}" - done < "${logfile}" - fi -} - -function maven_filefilter -{ - declare filename=$1 - - if [[ ${filename} =~ pom\.xml$ ]]; then - yetus_debug "tests/compile: ${filename}" - add_test compile - fi -} - -function maven_buildfile -{ - echo "pom.xml" -} - -function maven_executor -{ - echo "${MAVEN}" "${MAVEN_ARGS[@]}" -} - -function mvnsite_filefilter -{ - local filename=$1 - - if [[ ${BUILDTOOL} = maven ]]; then - if [[ ${filename} =~ src/site ]]; then - yetus_debug "tests/mvnsite: ${filename}" - add_test mvnsite - fi - fi -} - -function maven_modules_worker -{ - declare repostatus=$1 - declare tst=$2 - - # shellcheck disable=SC2034 - UNSUPPORTED_TEST=false - - case ${tst} in - findbugs) - modules_workers "${repostatus}" findbugs test-compile findbugs:findbugs -DskipTests=true - ;; - compile) - modules_workers "${repostatus}" compile clean test-compile -DskipTests=true - ;; - distclean) - modules_workers "${repostatus}" distclean clean -DskipTests=true - ;; - javadoc) - modules_workers "${repostatus}" javadoc clean javadoc:javadoc -DskipTests=true - ;; - scaladoc) - modules_workers "${repostatus}" scaladoc clean scala:doc -DskipTests=true - ;; - unit) - modules_workers "${repostatus}" unit clean test -fae - ;; - *) - # shellcheck disable=SC2034 - UNSUPPORTED_TEST=true - if [[ ${repostatus} = patch ]]; then - add_footer_table "${tst}" "not supported by the ${BUILDTOOL} plugin" - fi - yetus_error "WARNING: ${tst} is unsupported by ${BUILDTOOL}" - return 1 - ;; - esac -} - -function maven_javac_logfilter -{ - declare input=$1 - declare output=$2 - - ${GREP} -E '\[(ERROR|WARNING)\] /.*\.java:' "${input}" > "${output}" -} - -## @description Helper for check_patch_javadoc -## @audience private -## @stability evolving -## @replaceable no -## @return 0 on success -## @return 1 on failure -function maven_javadoc_logfilter -{ - declare input=$1 - declare output=$2 - - ${GREP} -E '\[(ERROR|WARNING)\] /.*\.java:' "${input}" > "${output}" -} - -## @description handle diffing maven javac errors -## @audience private -## @stability evolving -## @replaceable no -## @param branchlog -## @param patchlog -## @return differences -function maven_javac_calcdiffs -{ - declare orig=$1 - declare new=$2 - declare tmp=${PATCH_DIR}/pl.$$.${RANDOM} - declare j - - # first, strip :[line - # this keeps file,column in an attempt to increase - # accuracy in case of multiple, repeated errors - # since the column number shouldn't change - # if the line of code hasn't been touched - # shellcheck disable=SC2016 - ${SED} -e 's#:\[[0-9]*,#:#' "${orig}" > "${tmp}.branch" - # shellcheck disable=SC2016 - ${SED} -e 's#:\[[0-9]*,#:#' "${new}" > "${tmp}.patch" - - # compare the errors, generating a string of line - # numbers. Sorry portability: GNU diff makes this too easy - ${DIFF} --unchanged-line-format="" \ - --old-line-format="" \ - --new-line-format="%dn " \ - "${tmp}.branch" \ - "${tmp}.patch" > "${tmp}.lined" - - # now, pull out those lines of the raw output - # shellcheck disable=SC2013 - for j in $(cat "${tmp}.lined"); do - # shellcheck disable=SC2086 - head -${j} "${new}" | tail -1 - done - - rm "${tmp}.branch" "${tmp}.patch" "${tmp}.lined" 2>/dev/null -} - -## @description handle diffing maven javadoc errors -## @audience private -## @stability evolving -## @replaceable no -## @param branchlog -## @param patchlog -## @return differences -function maven_javadoc_calcdiffs -{ - declare orig=$1 - declare new=$2 - declare tmp=${PATCH_DIR}/pl.$$.${RANDOM} - declare j - - # can't use the generic handler for this because of the - # [WARNING], etc headers. - # strip :linenum from the output, keeping the filename - # shellcheck disable=SC2016 - ${SED} -e 's#:[0-9]*:#:#' "${orig}" > "${tmp}.branch" - # shellcheck disable=SC2016 - ${SED} -e 's#:[0-9]*:#:#' "${new}" > "${tmp}.patch" - - # compare the errors, generating a string of line - # numbers. Sorry portability: GNU diff makes this too easy - ${DIFF} --unchanged-line-format="" \ - --old-line-format="" \ - --new-line-format="%dn " \ - "${tmp}.branch" \ - "${tmp}.patch" > "${tmp}.lined" - - # now, pull out those lines of the raw output - # shellcheck disable=SC2013 - for j in $(cat "${tmp}.lined"); do - # shellcheck disable=SC2086 - head -${j} "${new}" | tail -1 - done - - rm "${tmp}.branch" "${tmp}.patch" "${tmp}.lined" 2>/dev/null -} - -function maven_builtin_personality_modules -{ - declare repostatus=$1 - declare testtype=$2 - - declare module - - yetus_debug "Using builtin personality_modules" - yetus_debug "Personality: ${repostatus} ${testtype}" - - clear_personality_queue - - # this always makes sure the local repo has a fresh - # copy of everything per pom rules. - if [[ ${repostatus} == branch - && ${testtype} == mvninstall ]] || - [[ "${BUILDMODE}" = full ]];then - personality_enqueue_module "${CHANGED_UNION_MODULES}" - return - fi - - for module in "${CHANGED_MODULES[@]}"; do - personality_enqueue_module "${module}" - done -} - -function maven_builtin_personality_file_tests -{ - local filename=$1 - - yetus_debug "Using builtin mvn personality_file_tests" - - if [[ ${filename} =~ src/main/webapp ]]; then - yetus_debug "tests/webapp: ${filename}" - elif [[ ${filename} =~ \.sh - || ${filename} =~ \.cmd - || ${filename} =~ src/main/scripts - || ${filename} =~ src/test/scripts - ]]; then - yetus_debug "tests/shell: ${filename}" - elif [[ ${filename} =~ \.c$ - || ${filename} =~ \.cc$ - || ${filename} =~ \.h$ - || ${filename} =~ \.hh$ - || ${filename} =~ \.proto$ - || ${filename} =~ \.cmake$ - || ${filename} =~ CMakeLists.txt - ]]; then - yetus_debug "tests/units: ${filename}" - add_test cc - add_test unit - elif [[ ${filename} =~ \.scala$ - || ${filename} =~ src/scala ]]; then - add_test scalac - add_test scaladoc - add_test unit - elif [[ ${filename} =~ build.xml$ - || ${filename} =~ pom.xml$ - || ${filename} =~ \.java$ - || ${filename} =~ src/main - ]]; then - yetus_debug "tests/javadoc+units: ${filename}" - add_test javac - add_test javadoc - add_test unit - fi - - if [[ ${filename} =~ src/test ]]; then - yetus_debug "tests" - add_test unit - fi - - if [[ ${filename} =~ \.java$ ]]; then - add_test findbugs - fi -} - -## @description Confirm site pre-patch -## @audience private -## @stability stable -## @replaceable no -## @return 0 on success -## @return 1 on failure -function mvnsite_postcompile -{ - declare repostatus=$1 - declare result=0 - - if [[ ${BUILDTOOL} != maven ]]; then - return 0 - fi - - if ! verify_needed_test mvnsite; then - return 0 - fi - - if [[ "${repostatus}" = branch ]]; then - big_console_header "maven site verification: ${PATCH_BRANCH}" - else - big_console_header "maven site verification: ${BUILDMODE}" - fi - - personality_modules "${repostatus}" mvnsite - modules_workers "${repostatus}" mvnsite clean site site:stage - result=$? - modules_messages "${repostatus}" mvnsite true - if [[ ${result} != 0 ]]; then - return 1 - fi - return 0 -} - -## @description Make sure Maven's eclipse generation works. -## @audience private -## @stability evolving -## @replaceable no -## @return 0 on success -## @return 1 on failure -function mvneclipse_postcompile -{ - declare repostatus=$1 - declare result=0 - - if [[ ${BUILDTOOL} != maven ]]; then - return 0 - fi - - if ! verify_needed_test javac; then - return 0 - fi - - if [[ "${repostatus}" = branch ]]; then - big_console_header "maven eclipse verification: ${PATCH_BRANCH}" - else - big_console_header "maven eclipse verification: ${BUILDMODE}" - fi - - personality_modules "${repostatus}" mvneclipse - modules_workers "${repostatus}" mvneclipse eclipse:clean eclipse:eclipse - result=$? - modules_messages "${repostatus}" mvneclipse true - if [[ ${result} != 0 ]]; then - return 1 - fi - return 0 -} - -## @description Verify mvn install works -## @audience private -## @stability evolving -## @replaceable no -## @return 0 on success -## @return 1 on failure -function maven_precompile -{ - declare repostatus=$1 - declare result=0 - declare need=false - - if [[ ${BUILDTOOL} != maven ]]; then - return 0 - fi - - if verify_needed_test javac; then - need=true - else - # not everything needs a maven install - # but quite a few do ... - # shellcheck disable=SC2086 - for index in ${MAVEN_NEED_INSTALL}; do - if verify_needed_test ${index}; then - need=branch - fi - done - fi - - if [[ "${need}" = false ]]; then - return 0 - elif [[ "${need}" = branch - && "${repostatus}" = patch ]]; then - return 0 - fi - - if [[ "${repostatus}" = branch ]]; then - big_console_header "maven install: ${PATCH_BRANCH}" - else - big_console_header "maven install: ${BUILDMODE}" - fi - - personality_modules "${repostatus}" mvninstall - modules_workers "${repostatus}" mvninstall -fae clean install -DskipTests=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Dfindbugs.skip=true - result=$? - modules_messages "${repostatus}" mvninstall true - if [[ ${result} != 0 ]]; then - return 1 - fi - return 0 -} - -function maven_docker_support -{ - DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS[@]}" "-v" "${HOME}/.m2:${HOME}/.m2") - - if [[ ${MAVEN_CUSTOM_REPOS} = true ]]; then - DOCKER_EXTRAARGS=("${DOCKER_EXTRAARGS[@]}" "-v" "${MAVEN_CUSTOM_REPOS_DIR}:${MAVEN_CUSTOM_REPOS_DIR}") - fi -} - -## @description worker for maven reordering -## @audience private -## @stability evolving -## @replaceable no -## @param repostatus -function maven_reorder_module_process -{ - declare repostatus=$1 - declare module - declare line - declare indexm - declare indexn - declare -a newlist - declare fn - declare needroot=false - declare found - - for module in "${CHANGED_MODULES[@]}"; do - if [[ "${module}" = \. ]]; then - needroot=true - fi - done - - fn=$(module_file_fragment "${CHANGED_UNION_MODULES}") - pushd "${BASEDIR}/${CHANGED_UNION_MODULES}" >/dev/null - - # get the module directory list in the correct order based on maven dependencies - # shellcheck disable=SC2046 - echo_and_redirect "${PATCH_DIR}/maven-${repostatus}-dirlist-${fn}.txt" \ - $("${BUILDTOOL}_executor") "-q" "exec:exec" "-Dexec.executable=pwd" "-Dexec.args=''" - - while read -r line; do - for indexm in "${CHANGED_MODULES[@]}"; do - if [[ ${line} == "${BASEDIR}/${indexm}" ]]; then - yetus_debug "mrm: placing ${indexm} from dir: ${line}" - newlist=("${newlist[@]}" "${indexm}") - break - fi - done - done < "${PATCH_DIR}/maven-${repostatus}-dirlist-${fn}.txt" - popd >/dev/null - - if [[ "${needroot}" = true ]]; then - newlist=("${newlist[@]}" ".") - fi - - indexm="${#CHANGED_MODULES[@]}" - indexn="${#newlist[@]}" - - if [[ ${indexm} -ne ${indexn} ]]; then - yetus_debug "mrm: Missed a module" - for indexm in "${CHANGED_MODULES[@]}"; do - found=false - for indexn in "${newlist[@]}"; do - if [[ "${indexn}" = "${indexm}" ]]; then - found=true - break - fi - done - if [[ ${found} = false ]]; then - yetus_debug "mrm: missed ${indexm}" - newlist=("${newlist[@]}" "${indexm}") - fi - done - fi - - CHANGED_MODULES=("${newlist[@]}") -} - -## @description take a stab at reordering modules based upon -## @description maven dependency order -## @audience private -## @stability evolving -## @replaceable no -## @param repostatus -## @param module -function maven_reorder_modules -{ - declare repostatus=$1 - declare index - - if [[ "${MAVEN_DEPENDENCY_ORDER}" != "true" ]]; then - return - fi - - # don't bother if there is only one - index="${#CHANGED_MODULES[@]}" - if [[ ${index} -eq 1 ]]; then - return - fi - - big_console_header "Determining Maven Dependency Order (downloading dependencies in the process)" - - start_clock - - maven_reorder_module_process "${repostatus}" - - yetus_debug "Maven: finish re-ordering modules" - yetus_debug "Finished list: ${CHANGED_MODULES[*]}" - - # build some utility module lists for maven modules - for index in "${CHANGED_MODULES[@]}"; do - if [[ -d "${index}/src" ]]; then - MAVEN_SRC_MODULES=("${MAVEN_SRC_MODULES[@]}" "${index}") - if [[ -d "${index}/src/test" ]]; then - MAVEN_SRCTEST_MODULES=("${MAVEN_SRCTEST_MODULES[@]}" "${index}") - fi - fi - done - - if [[ "${BUILDMODE}" = patch ]]; then - add_vote_table 0 mvndep "Maven dependency ordering for ${repostatus}" - else - add_vote_table 0 mvndep "Maven dependency ordering" - fi - - echo "Elapsed: $(clock_display $(stop_clock))" -} http://git-wip-us.apache.org/repos/asf/hive/blob/9a5381cb/dev-support/yetus-wrapper.sh ---------------------------------------------------------------------- diff --git a/dev-support/yetus-wrapper.sh b/dev-support/yetus-wrapper.sh index 5d1c2f9..3a814d5 100755 --- a/dev-support/yetus-wrapper.sh +++ b/dev-support/yetus-wrapper.sh @@ -63,7 +63,7 @@ WANTED="$1" shift ARGV=("$@") -HIVE_YETUS_VERSION=${HIVE_YETUS_VERSION:-0.4.0} +HIVE_YETUS_VERSION=${HIVE_YETUS_VERSION:-0.5.0} BIN=$(yetus_abs "${BASH_SOURCE-$0}") BINDIR=$(dirname "${BIN}") @@ -72,9 +72,6 @@ BINDIR=$(dirname "${BIN}") ### if [[ -n "${YETUS_HOME}" && -x "${YETUS_HOME}/bin/${WANTED}" ]]; then - cp ${BINDIR}/findbugs_YETUS-471.sh ${YETUS_HOME}/lib/precommit/test-patch.d/findbugs.sh - cp ${BINDIR}/checkstyle_YETUS-484.sh ${YETUS_HOME}/lib/precommit/test-patch.d/checkstyle.sh - cp ${BINDIR}/maven_YETUS-506.sh ${YETUS_HOME}/lib/precommit/test-patch.d/maven.sh exec "${YETUS_HOME}/bin/${WANTED}" "${ARGV[@]}" fi @@ -98,9 +95,6 @@ HIVE_PATCHPROCESS=${mytmpdir} ## if we've already DL'd it, then short cut ## if [[ -x "${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/bin/${WANTED}" ]]; then - cp ${BINDIR}/findbugs_YETUS-471.sh ${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/lib/precommit/test-patch.d/findbugs.sh - cp ${BINDIR}/checkstyle_YETUS-484.sh ${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/lib/precommit/test-patch.d/checkstyle.sh - cp ${BINDIR}/maven_YETUS-506.sh ${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/lib/precommit/test-patch.d/maven.sh exec "${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/bin/${WANTED}" "${ARGV[@]}" fi @@ -172,9 +166,6 @@ fi if [[ -x "${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/bin/${WANTED}" ]]; then popd >/dev/null - cp ${BINDIR}/findbugs_YETUS-471.sh ${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/lib/precommit/test-patch.d/findbugs.sh - cp ${BINDIR}/checkstyle_YETUS-484.sh ${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/lib/precommit/test-patch.d/checkstyle.sh - cp ${BINDIR}/maven_YETUS-506.sh ${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/lib/precommit/test-patch.d/maven.sh exec "${HIVE_PATCHPROCESS}/yetus-${HIVE_YETUS_VERSION}/bin/${WANTED}" "${ARGV[@]}" fi