Repository: yetus Updated Branches: refs/heads/master ff4a7c063 -> 0f30c3bea
YETUS-508. improve build tool command detection w/docker Signed-off-by: Akira Ajisaka <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/0f30c3be Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/0f30c3be Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/0f30c3be Branch: refs/heads/master Commit: 0f30c3bea80c38fadbbd90cf91860868bcffbe76 Parents: ff4a7c0 Author: Allen Wittenauer <[email protected]> Authored: Fri May 19 15:07:56 2017 -0700 Committer: Allen Wittenauer <[email protected]> Committed: Fri Jun 2 07:54:07 2017 -0700 ---------------------------------------------------------------------- precommit/test-patch.d/ant.sh | 12 ++++++++++++ precommit/test-patch.d/autoconf.sh | 14 ++++++++++++++ precommit/test-patch.d/cmake.sh | 14 ++++++++++++++ precommit/test-patch.d/gradle.sh | 12 ++++++++++++ precommit/test-patch.d/make.sh | 13 +++++++++++++ precommit/test-patch.d/maven.sh | 9 +++++---- 6 files changed, 70 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/0f30c3be/precommit/test-patch.d/ant.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/ant.sh b/precommit/test-patch.d/ant.sh index 61e13c9..ecf8b3c 100755 --- a/precommit/test-patch.d/ant.sh +++ b/precommit/test-patch.d/ant.sh @@ -14,6 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# there's nothing in here public, so don't publish docs +# SHELLDOC-IGNORE + if [[ -z "${ANT_HOME:-}" ]]; then ANT=ant else @@ -60,6 +63,15 @@ function ant_initialize fi } +function ant_precheck +{ + if ! verify_command ant "${ANT}"; then + add_vote_table -1 ant "ERROR: ant is not available." + return 1 + fi + return 0 +} + function ant_filefilter { declare filename=$1 http://git-wip-us.apache.org/repos/asf/yetus/blob/0f30c3be/precommit/test-patch.d/autoconf.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/autoconf.sh b/precommit/test-patch.d/autoconf.sh index 933a8c0..7f8d5a7 100755 --- a/precommit/test-patch.d/autoconf.sh +++ b/precommit/test-patch.d/autoconf.sh @@ -54,6 +54,20 @@ function autoconf_initialize fi } +## @description precheck autoconf +## @audience private +## @stability evolving +## @replaceable no +function autoconf_precheck +{ + if ! verify_command autoconf autoreconf; then + add_vote_table -1 autoconf "autoreconf was not available." + return 1 + fi + + make_precheck +} + ## @description get the name of the autoconf build filename ## @audience private ## @stability evolving http://git-wip-us.apache.org/repos/asf/yetus/blob/0f30c3be/precommit/test-patch.d/cmake.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/cmake.sh b/precommit/test-patch.d/cmake.sh index 7e68a4d..9c1da70 100755 --- a/precommit/test-patch.d/cmake.sh +++ b/precommit/test-patch.d/cmake.sh @@ -64,9 +64,23 @@ function cmake_initialize yetus_error "ERROR: cmake requires make to be enabled." return 1 fi +} +## @description precheck cmake +## @audience private +## @stability evolving +## @replaceable no +function cmake_precheck +{ + if ! verify_command cmake "${CMAKE}"; then + add_vote_table -1 cmake "cmake was not available." + return 1 + fi + + make_precheck } + ## @description cmake module manipulation ## @audience private ## @stability evolving http://git-wip-us.apache.org/repos/asf/yetus/blob/0f30c3be/precommit/test-patch.d/gradle.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/gradle.sh b/precommit/test-patch.d/gradle.sh index e809465..9311c49 100755 --- a/precommit/test-patch.d/gradle.sh +++ b/precommit/test-patch.d/gradle.sh @@ -14,6 +14,9 @@ # See the License for the specific language governing permissions and # limitations under the License. +# there's nothing in here public, so don't publish docs +# SHELLDOC-IGNORE + add_build_tool gradle declare -a GRADLE_ARGS=() @@ -48,6 +51,15 @@ function gradle_parse_args GRADLEW=${GRADLEW:-"${BASEDIR}/gradlew"} } +function gradle_precheck +{ + if ! verify_command gradle "${GRADLE}"; then + add_vote_table -1 gradle "ERROR: gradle is not available." + return 1 + fi + return 0 +} + function gradle_initialize { if [[ "${BUILDTOOL}" = gradle ]]; then http://git-wip-us.apache.org/repos/asf/yetus/blob/0f30c3be/precommit/test-patch.d/make.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/make.sh b/precommit/test-patch.d/make.sh index 92ba8e6..19a8196 100755 --- a/precommit/test-patch.d/make.sh +++ b/precommit/test-patch.d/make.sh @@ -29,6 +29,19 @@ function make_usage yetus_add_option "--make-file=<filename>" "The name of the file the make cmd should work on (default: '${MAKEFILE}')" } +## @description precheck make +## @audience private +## @stability evolving +## @replaceable no +function cmake_precheck +{ + if ! verify_command make "${MAKE}"; then + add_vote_table -1 make "make was not available." + return 1 + fi + return 0 +} + ## @description make argument parser ## @audience private ## @stability evolving http://git-wip-us.apache.org/repos/asf/yetus/blob/0f30c3be/precommit/test-patch.d/maven.sh ---------------------------------------------------------------------- diff --git a/precommit/test-patch.d/maven.sh b/precommit/test-patch.d/maven.sh index dcefdd4..60fa1b6 100755 --- a/precommit/test-patch.d/maven.sh +++ b/precommit/test-patch.d/maven.sh @@ -95,10 +95,6 @@ function maven_parse_args 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 @@ -138,6 +134,11 @@ function maven_precheck declare logfile="${PATCH_DIR}/mvnrepoclean.log" declare line + if ! verify_command maven "${MAVEN}"; then + add_vote_table -1 maven "ERROR: maven was not available." + return 1 + fi + if [[ ! ${MAVEN_CUSTOM_REPOS_DIR} =~ ^/ ]]; then yetus_error "ERROR: --mvn-custom-repos-dir must be an absolute path." return 1
