diff --git a/dist/codecov.sh b/dist/codecov.sh index 4366df3..e0c1266 100755 --- a/dist/codecov.sh +++ b/dist/codecov.sh @@ -119,73 +119,63 @@ cc_cli_args+=( $(write_existing_args CC_AUTO_LOAD_PARAMS_FROM) ) cc_cli_args+=( $(write_existing_args CC_ENTERPRISE_URL) ) cc_cli_args+=( $(write_existing_args CC_YML_PATH) ) cc_cli_args+=( $(write_truthy_args CC_VERBOSE) ) -cc_cc_args=() -cc_cc_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) -cc_cc_args+=( $(write_existing_args CC_GIT_SERVICE) ) -cc_cc_args+=( $(write_existing_args CC_PARENT_SHA) ) -cc_cc_args+=( $(write_existing_args CC_PR) ) -cc_cc_args+=( $(write_existing_args CC_SHA) ) -cc_cc_args+=( $(write_existing_args CC_SLUG) ) -cc_create_report_args=() -cc_cr_args+=( $(write_existing_args CC_CODE) ) -cc_cr_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) -cc_cr_args+=( $(write_existing_args CC_GIT_SERVICE) ) -cc_cr_args+=( $(write_existing_args CC_PR) ) -cc_cr_args+=( $(write_existing_args CC_SHA) ) -cc_cr_args+=( $(write_existing_args CC_SLUG) ) -cc_du_args=() -cc_du_args+=( $(write_existing_args CC_ENV) ) +cc_uc_args=() +# Args for create commit +cc_uc_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) +cc_uc_args+=( $(write_existing_args CC_GIT_SERVICE) ) +cc_uc_args+=( $(write_existing_args CC_PARENT_SHA) ) +cc_uc_args+=( $(write_existing_args CC_PR) ) +cc_uc_args+=( $(write_existing_args CC_SHA) ) +cc_uc_args+=( $(write_existing_args CC_SLUG) ) +# Args for create report +cc_uc_args+=( $(write_existing_args CC_CODE) ) +# Args for do upload +cc_uc_args+=( $(write_existing_args CC_ENV) ) OLDIFS=$IFS;IFS=, -cc_du_args+=( $(write_existing_args CC_BRANCH) ) -cc_du_args+=( $(write_existing_args CC_BUILD) ) -cc_du_args+=( $(write_existing_args CC_BUILD_URL) ) -cc_du_args+=( $(write_existing_args CC_CODE) ) -cc_du_args+=( $(write_existing_args CC_DIR) ) -cc_du_args+=( $(write_truthy_args CC_DISABLE_FILE_FIXES) ) -cc_du_args+=( $(write_truthy_args CC_DISABLE_SEARCH) ) -cc_du_args+=( $(write_truthy_args CC_DRY_RUN) ) +cc_uc_args+=( $(write_existing_args CC_BRANCH) ) +cc_uc_args+=( $(write_existing_args CC_BUILD) ) +cc_uc_args+=( $(write_existing_args CC_BUILD_URL) ) +cc_uc_args+=( $(write_existing_args CC_DIR) ) +cc_uc_args+=( $(write_truthy_args CC_DISABLE_FILE_FIXES) ) +cc_uc_args+=( $(write_truthy_args CC_DISABLE_SEARCH) ) +cc_uc_args+=( $(write_truthy_args CC_DRY_RUN) ) if [ -n "$CC_EXCLUDES" ]; then for directory in $CC_EXCLUDES; do - cc_du_args+=( " --exclude " "$directory" ) + cc_uc_args+=( " --exclude " "$directory" ) done fi -cc_du_args+=( $(write_truthy_args CC_FAIL_ON_ERROR) ) if [ -n "$CC_FILES" ]; then for file in $CC_FILES; do - cc_du_args+=( " --file " "$file" ) + cc_uc_args+=( " --file " "$file" ) done fi if [ -n "$CC_FLAGS" ]; then for flag in $CC_FLAGS; do - cc_du_args+=( " --flag " "$flag" ) + cc_uc_args+=( " --flag " "$flag" ) done fi -cc_du_args+=( $(write_existing_args CC_GCOV_ARGS) ) -cc_du_args+=( $(write_existing_args CC_GCOV_EXECUTABLE) ) -cc_du_args+=( $(write_existing_args CC_GCOV_IGNORE) ) -cc_du_args+=( $(write_existing_args CC_GCOV_INCLUDE) ) -cc_du_args+=( $(write_existing_args CC_GIT_SERVICE) ) -cc_du_args+=( $(write_truthy_args CC_HANDLE_NO_REPORTS_FOUND) ) -cc_du_args+=( $(write_existing_args CC_JOB_CODE) ) -cc_du_args+=( $(write_truthy_args CC_LEGACY) ) -cc_du_args+=( $(write_existing_args CC_NAME) ) -cc_du_args+=( $(write_existing_args CC_NETWORK_FILTER) ) -cc_du_args+=( $(write_existing_args CC_NETWORK_PREFIX) ) -cc_du_args+=( $(write_existing_args CC_NETWORK_ROOT_FOLDER) ) +cc_uc_args+=( $(write_existing_args CC_GCOV_ARGS) ) +cc_uc_args+=( $(write_existing_args CC_GCOV_EXECUTABLE) ) +cc_uc_args+=( $(write_existing_args CC_GCOV_IGNORE) ) +cc_uc_args+=( $(write_existing_args CC_GCOV_INCLUDE) ) +cc_uc_args+=( $(write_truthy_args CC_HANDLE_NO_REPORTS_FOUND) ) +cc_uc_args+=( $(write_existing_args CC_JOB_CODE) ) +cc_uc_args+=( $(write_truthy_args CC_LEGACY) ) +cc_uc_args+=( $(write_existing_args CC_NAME) ) +cc_uc_args+=( $(write_existing_args CC_NETWORK_FILTER) ) +cc_uc_args+=( $(write_existing_args CC_NETWORK_PREFIX) ) +cc_uc_args+=( $(write_existing_args CC_NETWORK_ROOT_FOLDER) ) if [ -n "$CC_PLUGINS" ]; then for plugin in $CC_PLUGINS; do - cc_du_args+=( " --plugin " "$plugin" ) + cc_uc_args+=( " --plugin " "$plugin" ) done fi -cc_du_args+=( $(write_existing_args CC_PR) ) -cc_du_args+=( $(write_existing_args CC_REPORT_TYPE) ) -cc_du_args+=( $(write_existing_args CC_SHA) ) -cc_du_args+=( $(write_existing_args CC_SLUG) ) -cc_du_args+=( $(write_existing_args CC_SWIFT_PROJECT) ) +cc_uc_args+=( $(write_existing_args CC_REPORT_TYPE) ) +cc_uc_args+=( $(write_existing_args CC_SWIFT_PROJECT) ) IFS=$OLDIFS unset NODE_OPTIONS # See https://github.com/codecov/uploader/issues/475 diff --git a/scripts/run.sh b/scripts/run.sh index 24db745..5522891 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -6,7 +6,5 @@ . ./validate.sh . ./set_cli_args.sh -. ./set_create_commit_args.sh -. ./set_create_report_args.sh -. ./set_do_upload_args.sh +. ./set_upload_coverage_args.sh . ./upload.sh diff --git a/scripts/set_create_commit_args.sh b/scripts/set_create_commit_args.sh deleted file mode 100755 index 5723c32..0000000 --- a/scripts/set_create_commit_args.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -codecov_cc_args=() - -codecov_cc_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) -codecov_cc_args+=( $(write_existing_args CODECOV_GIT_SERVICE) ) -codecov_cc_args+=( $(write_existing_args CODECOV_PARENT_SHA) ) -codecov_cc_args+=( $(write_existing_args CODECOV_PR) ) -codecov_cc_args+=( $(write_existing_args CODECOV_SHA) ) -codecov_cc_args+=( $(write_existing_args CODECOV_SLUG) ) diff --git a/scripts/set_create_report_args.sh b/scripts/set_create_report_args.sh deleted file mode 100755 index 1ca7744..0000000 --- a/scripts/set_create_report_args.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -codecov_create_report_args=() - -codecov_cr_args+=( $(write_existing_args CODECOV_CODE) ) -codecov_cr_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) -codecov_cr_args+=( $(write_existing_args CODECOV_GIT_SERVICE) ) -codecov_cr_args+=( $(write_existing_args CODECOV_PR) ) -codecov_cr_args+=( $(write_existing_args CODECOV_SHA) ) -codecov_cr_args+=( $(write_existing_args CODECOV_SLUG) ) diff --git a/scripts/set_do_upload_args.sh b/scripts/set_do_upload_args.sh deleted file mode 100755 index c5cb6fb..0000000 --- a/scripts/set_do_upload_args.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -codecov_du_args=() - -codecov_du_args+=( $(write_existing_args CODECOV_ENV) ) - -OLDIFS=$IFS;IFS=, - -codecov_du_args+=( $(write_existing_args CODECOV_BRANCH) ) -codecov_du_args+=( $(write_existing_args CODECOV_BUILD) ) -codecov_du_args+=( $(write_existing_args CODECOV_BUILD_URL) ) -codecov_du_args+=( $(write_existing_args CODECOV_CODE) ) -codecov_du_args+=( $(write_existing_args CODECOV_DIR) ) -codecov_du_args+=( $(write_truthy_args CODECOV_DISABLE_FILE_FIXES) ) -codecov_du_args+=( $(write_truthy_args CODECOV_DISABLE_SEARCH) ) -codecov_du_args+=( $(write_truthy_args CODECOV_DRY_RUN) ) - -if [ -n "$CODECOV_EXCLUDES" ]; -then - for directory in $CODECOV_EXCLUDES; do - codecov_du_args+=( " --exclude " "$directory" ) - done -fi - -codecov_du_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) - -if [ -n "$CODECOV_FILES" ]; -then - for file in $CODECOV_FILES; do - codecov_du_args+=( " --file " "$file" ) - done -fi - -if [ -n "$CODECOV_FLAGS" ]; -then - for flag in $CODECOV_FLAGS; do - codecov_du_args+=( " --flag " "$flag" ) - done -fi - -codecov_du_args+=( $(write_existing_args CODECOV_GCOV_ARGS) ) -codecov_du_args+=( $(write_existing_args CODECOV_GCOV_EXECUTABLE) ) -codecov_du_args+=( $(write_existing_args CODECOV_GCOV_IGNORE) ) -codecov_du_args+=( $(write_existing_args CODECOV_GCOV_INCLUDE) ) -codecov_du_args+=( $(write_existing_args CODECOV_GIT_SERVICE) ) -codecov_du_args+=( $(write_truthy_args CODECOV_HANDLE_NO_REPORTS_FOUND) ) -codecov_du_args+=( $(write_existing_args CODECOV_JOB_CODE) ) -codecov_du_args+=( $(write_truthy_args CODECOV_LEGACY) ) -codecov_du_args+=( $(write_existing_args CODECOV_NAME) ) -codecov_du_args+=( $(write_existing_args CODECOV_NETWORK_FILTER) ) -codecov_du_args+=( $(write_existing_args CODECOV_NETWORK_PREFIX) ) -codecov_du_args+=( $(write_existing_args CODECOV_NETWORK_ROOT_FOLDER) ) - -if [ -n "$CODECOV_PLUGINS" ]; -then - for plugin in $CODECOV_PLUGINS; do - codecov_du_args+=( " --plugin " "$plugin" ) - done -fi - -codecov_du_args+=( $(write_existing_args CODECOV_PR) ) -codecov_du_args+=( $(write_existing_args CODECOV_REPORT_TYPE) ) -codecov_du_args+=( $(write_existing_args CODECOV_SHA) ) -codecov_du_args+=( $(write_existing_args CODECOV_SLUG) ) -codecov_du_args+=( $(write_existing_args CODECOV_SWIFT_PROJECT) ) - -IFS=$OLDIFS diff --git a/scripts/set_upload_coverage_args.sh b/scripts/set_upload_coverage_args.sh new file mode 100644 index 0000000..095ef1a --- /dev/null +++ b/scripts/set_upload_coverage_args.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +codecov_uc_args=() + +# Args for create commit +codecov_uc_args+=( $(write_truthy_args CODECOV_FAIL_ON_ERROR) ) +codecov_uc_args+=( $(write_existing_args CODECOV_GIT_SERVICE) ) +codecov_uc_args+=( $(write_existing_args CODECOV_PARENT_SHA) ) +codecov_uc_args+=( $(write_existing_args CODECOV_PR) ) +codecov_uc_args+=( $(write_existing_args CODECOV_SHA) ) +codecov_uc_args+=( $(write_existing_args CODECOV_SLUG) ) + +# Args for create report +codecov_uc_args+=( $(write_existing_args CODECOV_CODE) ) + +# Args for do upload +codecov_uc_args+=( $(write_existing_args CODECOV_ENV) ) + +OLDIFS=$IFS;IFS=, + +codecov_uc_args+=( $(write_existing_args CODECOV_BRANCH) ) +codecov_uc_args+=( $(write_existing_args CODECOV_BUILD) ) +codecov_uc_args+=( $(write_existing_args CODECOV_BUILD_URL) ) +codecov_uc_args+=( $(write_existing_args CODECOV_DIR) ) +codecov_uc_args+=( $(write_truthy_args CODECOV_DISABLE_FILE_FIXES) ) +codecov_uc_args+=( $(write_truthy_args CODECOV_DISABLE_SEARCH) ) +codecov_uc_args+=( $(write_truthy_args CODECOV_DRY_RUN) ) + +if [ -n "$CODECOV_EXCLUDES" ]; +then + for directory in $CODECOV_EXCLUDES; do + codecov_uc_args+=( " --exclude " "$directory" ) + done +fi + +if [ -n "$CODECOV_FILES" ]; +then + for file in $CODECOV_FILES; do + codecov_uc_args+=( " --file " "$file" ) + done +fi + +if [ -n "$CODECOV_FLAGS" ]; +then + for flag in $CODECOV_FLAGS; do + codecov_uc_args+=( " --flag " "$flag" ) + done +fi + +codecov_uc_args+=( $(write_existing_args CODECOV_GCOV_ARGS) ) +codecov_uc_args+=( $(write_existing_args CODECOV_GCOV_EXECUTABLE) ) +codecov_uc_args+=( $(write_existing_args CODECOV_GCOV_IGNORE) ) +codecov_uc_args+=( $(write_existing_args CODECOV_GCOV_INCLUDE) ) +codecov_uc_args+=( $(write_truthy_args CODECOV_HANDLE_NO_REPORTS_FOUND) ) +codecov_uc_args+=( $(write_existing_args CODECOV_JOB_CODE) ) +codecov_uc_args+=( $(write_truthy_args CODECOV_LEGACY) ) +codecov_uc_args+=( $(write_existing_args CODECOV_NAME) ) +codecov_uc_args+=( $(write_existing_args CODECOV_NETWORK_FILTER) ) +codecov_uc_args+=( $(write_existing_args CODECOV_NETWORK_PREFIX) ) +codecov_uc_args+=( $(write_existing_args CODECOV_NETWORK_ROOT_FOLDER) ) + +if [ -n "$CODECOV_PLUGINS" ]; +then + for plugin in $CODECOV_PLUGINS; do + codecov_uc_args+=( " --plugin " "$plugin" ) + done +fi + +codecov_uc_args+=( $(write_existing_args CODECOV_REPORT_TYPE) ) +codecov_uc_args+=( $(write_existing_args CODECOV_SWIFT_PROJECT) ) + +IFS=$OLDIFS