0) mkdir -p $CIRCLE_TEST_REPORTS /junit/productDebug/ ./gradlew clean testProductDebugUnitTest RESULT= $? find . -type f -regex ".*/build/test-results/.*xml" -exec \ cp {} $CIRCLE_TEST_REPORTS /junit/productDebug/ \; ;; 1) mkdir -p $CIRCLE_TEST_REPORTS /junit/stagingDebug/ ./gradlew clean testStagingDebugUnitTest RESULT= $? find . -type f -regex ".*/build/test-results/.*xml" -exec \ cp {} $CIRCLE_TEST_REPORTS /junit/stagingDebug/ \; ;; esac exit ${RESULT}