diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index b02e4cf7cca..50c8deea299 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -151,6 +151,13 @@ jobs: echo "build --disk_cache=$EXPANDED_BAZEL_CACHE_PATH" >> $HOME/.bazelrc shell: bash + - name: Binary files check + # The expression if: ${{ !cancelled() }} runs a job or step regardless of its success or failure while responding to cancellations, + # serving as a cancellation-compliant alternative to if: ${{ always() }} in concurrent workflows. + if: ${{ !cancelled() }} + run: | + bash /home/runner/work/oppia-android/oppia-android/scripts/binary_files_check.sh + - name: Regex Patterns Validation Check # The expression if: ${{ !cancelled() }} runs a job or step regardless of its success or failure while responding to cancellations, # serving as a cancellation-compliant alternative to if: ${{ always() }} in concurrent workflows. @@ -209,15 +216,6 @@ jobs: run: | bazel run //scripts:string_resource_validation_check -- $(pwd) - - name: Binary files check - # The expression if: ${{ !cancelled() }} runs a job or step regardless of its success or failure while responding to cancellations, - # serving as a cancellation-compliant alternative to if: ${{ always() }} in concurrent workflows. - if: ${{ !cancelled() }} - run: | - bash /home/runner/work/oppia-android/oppia-android/scripts/pre-commit.sh - echo "No binary files found in commit" - echo "BINARY FILES CHECK PASSED" - # Note that caching is intentionally not enabled for this check since licenses should always be # verified without any potential influence from earlier builds (i.e. always from a clean build to # ensure the results exactly match the current state of the repository). diff --git a/app/src/main/java/org/oppia/android/app/activity/route/Activity.txt b/app/src/main/java/org/oppia/android/app/activity/route/Activity.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/src/main/java/org/oppia/android/app/walkthrough/DummyWalkthrough.kt b/app/src/main/java/org/oppia/android/app/walkthrough/DummyWalkthrough.kt new file mode 100644 index 00000000000..0194a017c4e --- /dev/null +++ b/app/src/main/java/org/oppia/android/app/walkthrough/DummyWalkthrough.kt @@ -0,0 +1,3 @@ +package org.oppia.android.app.walkthrough + +class DummyWalkthrough diff --git a/app/src/main/res/drawable/cute-otter.png b/app/src/main/res/drawable/cute-otter.png new file mode 100644 index 00000000000..f680c5e7351 Binary files /dev/null and b/app/src/main/res/drawable/cute-otter.png differ diff --git a/app/src/main/res/drawable/dev flavor apk.png b/app/src/main/res/drawable/dev flavor apk.png new file mode 100644 index 00000000000..1921b5eccb6 Binary files /dev/null and b/app/src/main/res/drawable/dev flavor apk.png differ diff --git a/app/src/main/res/drawable/otter2.png b/app/src/main/res/drawable/otter2.png new file mode 100644 index 00000000000..af29912d814 Binary files /dev/null and b/app/src/main/res/drawable/otter2.png differ diff --git a/app/src/main/res/drawable/otter_cartoon.jpeg b/app/src/main/res/drawable/otter_cartoon.jpeg new file mode 100644 index 00000000000..eb41dffc278 Binary files /dev/null and b/app/src/main/res/drawable/otter_cartoon.jpeg differ diff --git a/app/src/main/res/layout/activity_otter.xml b/app/src/main/res/layout/activity_otter.xml new file mode 100644 index 00000000000..d829e291cca --- /dev/null +++ b/app/src/main/res/layout/activity_otter.xml @@ -0,0 +1,7 @@ + + + + \ No newline at end of file diff --git a/data/src/test/assets/api_mocks/mock.json b/data/src/test/assets/api_mocks/mock.json new file mode 100644 index 00000000000..e69de29bb2d diff --git a/scripts/assets/assets_proto.proto b/scripts/assets/assets_proto.proto new file mode 100644 index 00000000000..e69de29bb2d diff --git a/scripts/assets/assets_textproto.textproto b/scripts/assets/assets_textproto.textproto new file mode 100644 index 00000000000..e69de29bb2d diff --git a/scripts/assets/bread.mp4 b/scripts/assets/bread.mp4 new file mode 100644 index 00000000000..b1b24be867d Binary files /dev/null and b/scripts/assets/bread.mp4 differ diff --git a/scripts/assets/mockversion.png b/scripts/assets/mockversion.png new file mode 100644 index 00000000000..5ce5f1a1d70 Binary files /dev/null and b/scripts/assets/mockversion.png differ diff --git a/scripts/assets/newtext.textproto b/scripts/assets/newtext.textproto new file mode 100644 index 00000000000..0eb04d8790d --- /dev/null +++ b/scripts/assets/newtext.textproto @@ -0,0 +1,8 @@ +exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/forcenetworktype/testing/ForceNetworkTypeTestActivity" +exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/markchapterscompleted/testing/MarkChaptersCompletedTestActivity" +exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/markstoriescompleted/testing/MarkStoriesCompletedTestActivity" +exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/marktopicscompleted/testing/MarkTopicsCompletedTestActivity" +exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/vieweventlogs/testing/ViewEventLogsTestActivity" +exempted_activity: "app/src/main/java/org/oppia/android/app/devoptions/testing/DeveloperOptionsTestActivity" +exempted_activity: "app/src/main/java/org/oppia/android/app/home/recentlyplayed/RecentlyPlayedActivity" +exempted_activity: "app/src/main/java/org/oppia/android/app/player/state/testing/StateFragmentTestActivity" \ No newline at end of file diff --git a/scripts/assets/proto.mp4 b/scripts/assets/proto.mp4 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/scripts/binary_files_check.sh b/scripts/binary_files_check.sh new file mode 100644 index 00000000000..246ec446ef9 --- /dev/null +++ b/scripts/binary_files_check.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +source scripts/formatting.sh + +check_binary_files() { + base_commit=$(git merge-base origin/develop HEAD) + binary_files=$(git diff --numstat "$base_commit"...HEAD | awk '$1 == "-" && $2 == "-" { print $3 }') + binary_files_count=$(echo "$binary_files" | grep -c . || true) + + if [[ "$binary_files_count" -gt 0 ]]; then + echo "Detected $binary_files_count binary file(s):" + echo "$binary_files" + echo_error "\nBINARY FILES CHECK FAILED\n" + exit 1 + else + echo "No binary files detected in the commit" + echo_success "\nBINARY FILES CHECK PASSED\n" + fi +} + +check_binary_files diff --git a/scripts/formatting.sh b/scripts/formatting.sh index 0fd2c2dac94..be1f320584b 100644 --- a/scripts/formatting.sh +++ b/scripts/formatting.sh @@ -1,6 +1,6 @@ #!/bin/bash -#Defines color codes for output formatting +# Defines color codes for output formatting # Red color for error messages RED='\033[0;31m' @@ -8,23 +8,23 @@ RED='\033[0;31m' # Green color for success messages GREEN='\033[0;32m' -# Yellow color for warnings messages +# Yellow color for warning messages YELLOW='\033[0;33m' -# No color, used to reset the color after each message +# No color, resets color after message NC='\033[0m' # Function to print an error message in red function echo_error() { - echo -e "${RED}$1${NC}" + printf "${RED}%b${NC}\n" "$1" } # Function to print a success message in green function echo_success() { - echo -e "${GREEN}$1${NC}" + printf "${GREEN}%b${NC}\n" "$1" } # Function to print a warning message in yellow function echo_warning() { - echo -e "${YELLOW}$1${NC}" + printf "${YELLOW}%b${NC}\n" "$1" } diff --git a/scripts/pre-commit.sh b/scripts/pre-commit.sh old mode 100644 new mode 100755 index 26061ef5c09..cf49ab9abd7 --- a/scripts/pre-commit.sh +++ b/scripts/pre-commit.sh @@ -1,35 +1,3 @@ #!/bin/bash -# Pre-commit hook to check for binary files. - -# Find the common ancestor between develop and the current branch -base_commit=$(git merge-base 'origin/develop' HEAD) - -# Get the list of staged changes (files ready to be committed) -staged_files=$(git diff --cached --name-only) - -# Get the list of changed files compared to the base commit -changed_files=$(git diff --name-only "$base_commit" HEAD) - -# Combine both lists of files, ensuring no duplicates -all_files=$(echo -e "$staged_files\n$changed_files" | sort -u) - -function checkForBinaries() { - binaryFilesCount=0 - - # Iterate over all files (both staged and changed) - for file in $all_files; do - if [ -f "$file" ] && file --mime "$file" | grep -q 'binary'; then - ((binaryFilesCount++)) - printf "\n\033[33m%s\033[0m" "$file" - fi - done - - if [[ "${binaryFilesCount}" -gt 0 ]]; then - printf "\n\nPlease remove the %d detected binary file(s)." "$binaryFilesCount" - printf "\nBINARY FILES CHECK FAILED" - exit 1 - fi -} - -checkForBinaries +bash scripts/binary_files_check.sh diff --git a/wiki/Dummy.md b/wiki/Dummy.md new file mode 100644 index 00000000000..e69de29bb2d diff --git a/wiki/Dummy.txt b/wiki/Dummy.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/wiki/DummyWiki.kt b/wiki/DummyWiki.kt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/wiki/res/values/DummyLayout.xml b/wiki/res/values/DummyLayout.xml new file mode 100644 index 00000000000..a6b3daec935 --- /dev/null +++ b/wiki/res/values/DummyLayout.xml @@ -0,0 +1,2 @@ + + \ No newline at end of file