Repository: yetus Updated Branches: refs/heads/master 1fec6c91f -> 86632ab22
YETUS-114 add no-op build tool - Changes semantics of build plugin buildfile to allow for disabling module detection - Adds no-op build tool - docs Signed-off-by: Allen Wittenauer <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/yetus/repo Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/86632ab2 Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/86632ab2 Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/86632ab2 Branch: refs/heads/master Commit: 86632ab22e336fd341d8aab921ab157d588c71a2 Parents: 1fec6c9 Author: Sean Busbey <[email protected]> Authored: Wed Oct 21 03:03:34 2015 -0500 Committer: Allen Wittenauer <[email protected]> Committed: Wed Oct 21 09:09:54 2015 -0700 ---------------------------------------------------------------------- .../latest/precommit-buildtools.md | 2 +- dev-support/test-patch.d/nobuild.sh | 55 ++++++++++++++++++++ dev-support/test-patch.sh | 33 +++++++----- 3 files changed, 75 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/yetus/blob/86632ab2/asf-site-src/source/documentation/latest/precommit-buildtools.md ---------------------------------------------------------------------- diff --git a/asf-site-src/source/documentation/latest/precommit-buildtools.md b/asf-site-src/source/documentation/latest/precommit-buildtools.md index 0dd0f57..d581a60 100644 --- a/asf-site-src/source/documentation/latest/precommit-buildtools.md +++ b/asf-site-src/source/documentation/latest/precommit-buildtools.md @@ -42,7 +42,7 @@ For example, the gradle build tool does not have a standard way to execute check * pluginname\_buildfile - - This should be an echo of the file that controls the build system. This is used for module determination. + - This should be an echo of the file that controls the build system. This is used for module determination. If the build system wishes to disable module determination, it should echo with no args. * pluginname\_executor http://git-wip-us.apache.org/repos/asf/yetus/blob/86632ab2/dev-support/test-patch.d/nobuild.sh ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.d/nobuild.sh b/dev-support/test-patch.d/nobuild.sh new file mode 100644 index 0000000..73e2619 --- /dev/null +++ b/dev-support/test-patch.d/nobuild.sh @@ -0,0 +1,55 @@ +#!/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_build_tool nobuild + +function nobuild_buildfile +{ + echo +} + +function nobuild_executor +{ + echo "true" +} + +function nobuild_modules_worker +{ + local status=$1 + local testtype=$2 + module_workers "${status}" "${testtype}" +} + +function nobuild_builtin_personality_modules +{ + local status=$1 + local testtype=$2 + yetus_debug "built-in personality for no build system: ${status} ${testtype}" + + clear_personality_queue + for module in ${CHANGED_MODULES}; do + # shellcheck disable=SC2086 + personality_enqueue_module ${module} + done +} + +function nobuild_builtin_personality_file_tests +{ + local filename=$1 + + yetus_debug "Using built-in no build system personality_file_tests." + yetus_debug " given file ${filename}" +} http://git-wip-us.apache.org/repos/asf/yetus/blob/86632ab2/dev-support/test-patch.sh ---------------------------------------------------------------------- diff --git a/dev-support/test-patch.sh b/dev-support/test-patch.sh index 6d20959..784556c 100755 --- a/dev-support/test-patch.sh +++ b/dev-support/test-patch.sh @@ -1020,22 +1020,27 @@ function find_changed_modules changed_dirs=$(for i in ${CHANGED_FILES}; do dirname "${i}"; done | sort -u) - # Now find all the modules that were changed - for i in ${changed_dirs}; do + # Empty string indicates the build system wants to disable module detection + if [[ -z ${buildfile} ]]; then + buiddirs="." + else + # Now find all the modules that were changed + for i in ${changed_dirs}; do - module_skipdir "${i}" - if [[ $? != 0 ]]; then - continue - fi + module_skipdir "${i}" + if [[ $? != 0 ]]; then + continue + fi - builddir=$(find_buildfile_dir "${buildfile}" "${i}") - if [[ -z ${builddir} ]]; then - yetus_error "ERROR: ${buildfile} is not found. Make sure the target is a ${BUILDTOOL}-based project." - bugsystem_finalreport 1 - cleanup_and_exit 1 - fi - builddirs="${builddirs} ${builddir}" - done + builddir=$(find_buildfile_dir "${buildfile}" "${i}") + if [[ -z ${builddir} ]]; then + yetus_error "ERROR: ${buildfile} is not found. Make sure the target is a ${BUILDTOOL}-based project." + bugsystem_finalreport 1 + cleanup_and_exit 1 + fi + builddirs="${builddirs} ${builddir}" + done + fi #shellcheck disable=SC2086,SC2034 CHANGED_UNFILTERED_MODULES=$(echo ${builddirs} ${USER_MODULE_LIST} | tr ' ' '\n' | sort -u)
