diff --git a/resources/builder.inc.sh b/resources/builder.inc.sh index d550ba3906..caed5bea9d 100755 --- a/resources/builder.inc.sh +++ b/resources/builder.inc.sh @@ -402,6 +402,22 @@ builder_has_action() { fi } +_builder_dep_output_defined() { + if [[ ! -z ${_builder_dep_path[$1]+x} ]]; then + return 0 + else + return 1 + fi +} + +_builder_dep_output_exists() { + if _builder_dep_output_defined $1 && [[ -e "$KEYMAN_ROOT/${_builder_dep_path[$1]}" ]]; then + return 0 + else + return 1 + fi +} + # # Returns `0` if the user has asked to perform action on target on the command # line, and then starts the action. Should be paired with @@ -433,8 +449,7 @@ builder_start_action() { # verify whether a target output is present. if builder_is_dep_build && ! builder_is_full_dep_build && - [[ ! -z ${_builder_dep_path[$_builder_matched_action]+x} ]] && - [[ -e "$KEYMAN_ROOT/${_builder_dep_path[$_builder_matched_action]}" ]]; then + _builder_dep_output_exists $_builder_matched_action; then echo "$scope skipping $_builder_matched_action_name, up-to-date" return 1 fi @@ -1190,10 +1205,18 @@ builder_finish_action() { fi local scope="[$THIS_SCRIPT_IDENTIFIER] " + local matched_action="$action$target" - if [[ "$action$target" == "${_builder_current_action}" ]]; then + if [[ "$matched_action" == "${_builder_current_action}" ]]; then if [[ $result == success ]]; then - echo "${COLOR_GREEN}## $scope$action_name completed successfully${COLOR_RESET}" + # Sanity check: if there is a described output for this action, does the corresponding + # file or directory exist now? + if _builder_dep_output_defined $matched_action && ! _builder_dep_output_exists "$matched_action"; then + builder_warn "## $scope$action_name was successful, but output does not exist" + builder_warn "## ${scope}Expected output: '${_builder_dep_path[$matched_action]}'." + else + echo "${COLOR_GREEN}## $scope$action_name completed successfully${COLOR_RESET}" + fi elif [[ $result == failure ]]; then echo "${COLOR_RED}## $scope$action_name failed${COLOR_RESET}" else diff --git a/resources/shellHelperFunctions.sh b/resources/shellHelperFunctions.sh index a973cf23bd..d7612c74f5 100755 --- a/resources/shellHelperFunctions.sh +++ b/resources/shellHelperFunctions.sh @@ -26,24 +26,6 @@ verify_project() { fi } -# The list of valid platforms that our build scripts ought expect. -platforms=("android" "ios" "linux" "lmlayer" "mac" "web" "desktop" "developer") - -# Used to validate a specified 'platform' parameter. -verify_platform() { - match=false - for proj in ${platforms[@]} - do - if [ $proj = $1 ]; then - match=true - fi - done - - if [ $match = false ]; then - builder_die "Invalid platform specified!" - fi -} - displayInfo() { if [ "$QUIET" != true ]; then while [[ $# -gt 0 ]] ; do