-
Notifications
You must be signed in to change notification settings - Fork 527
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
<!-- READ ME FIRST: Please fill in the explanation section below and check off every point from the Essential Checklist! --> Fix part of #4391 : Fix failing build on M1 Macs ## Explanation <!-- - Explain what your PR does. If this PR fixes an existing bug, please include - "Fixes #bugnum:" in the explanation so that GitHub can auto-close the issue - when this PR is merged. --> Some M1 Macs fail to build the Oppia app because of unused imports in some of the proto files in the project. This PR attempts to fix this issue by removing unused imports in proto files. Files affected by this fix are; - profile.proto - deprecation.proto This is a temporary fix and more investigation will need to be done to properly understand why this behavior is erratic and why it only happens in some instances and not in others. More checks are also needed to ensure that proto files only have imports that are used in the proto file before they are merged. Besides build fixes, this PR also; - Includes a fix for the `buildifier_download.sh` which previously did not work for MacOS users. - Introduces a `static_checks.sh` file to allow contributors to run all static checks locally before pushing the code to Git. - Adds a wiki entry in the Static-Analysis-Checks wiki. The entry contains instructions on how to run static checks locally with the static_checks.sh file. ## Essential Checklist <!-- Please tick the relevant boxes by putting an "x" in them. --> - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). --------- Co-authored-by: Kenneth Murerwa <[email protected]> Co-authored-by: Adhiambo Peres <[email protected]>
- Loading branch information
1 parent
2b3213c
commit d55b7e6
Showing
6 changed files
with
127 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
#!/bin/bash | ||
|
||
# INSTRUCTIONS | ||
# This script will run all script checks locally to make | ||
# sure that all script checks will still pass when run on | ||
# CI | ||
# | ||
# To run this check run the script from the Oppia-android root folder: | ||
# | ||
# bash scripts/static_checks.sh | ||
# | ||
|
||
# LINT CHECKS | ||
# Run Java lint check | ||
bash scripts/checkstyle_lint_check.sh | ||
echo "" | ||
|
||
# Run Kotlin lint check | ||
bash scripts/ktlint_lint_check.sh | ||
echo "" | ||
|
||
# Run protobuf lint checks | ||
bash scripts/buf_lint_check.sh | ||
echo "" | ||
|
||
# Download Buildifier in oppia-android-tools folder (pre-requisite for buildifier checks) | ||
echo "********************************" | ||
echo "Downloading buildifier" | ||
echo "********************************" | ||
cd ../oppia-android-tools/ | ||
bash ../oppia-android/scripts/buildifier_download.sh | ||
cd ../oppia-android/ | ||
echo "" | ||
|
||
# Run Bazel Build file lint checks (buildifier checks) | ||
bash scripts/buildifier_lint_check.sh | ||
echo "" | ||
|
||
|
||
# SCRIPT CHECKS | ||
# These checks run on Bazel. Ensure Bazel is installed and configured correctly. | ||
|
||
# Run regex pattern checks | ||
echo "********************************" | ||
echo "Running regex pattern checks" | ||
echo "********************************" | ||
bazel run //scripts:regex_pattern_validation_check -- $(pwd) | ||
echo "" | ||
|
||
# Run XML Syntax check validation | ||
echo "********************************" | ||
echo "Running XML Syntax validation checks" | ||
echo "********************************" | ||
bazel run //scripts:xml_syntax_check -- $(pwd) | ||
echo "" | ||
|
||
# Run Testfile Presence Check | ||
echo "********************************" | ||
echo "Running Testfile presence checks" | ||
echo "********************************" | ||
bazel run //scripts:test_file_check -- $(pwd) | ||
echo "" | ||
|
||
# Run Accessibility label Check | ||
echo "********************************" | ||
echo "Running Accessibility label checks" | ||
echo "********************************" | ||
bazel run //scripts:accessibility_label_check -- $(pwd) scripts/assets/accessibility_label_exemptions.pb app/src/main/AndroidManifest.xml | ||
echo "" | ||
|
||
# Run KDoc Validation Check | ||
echo "********************************" | ||
echo "Running KDoc validation checks" | ||
echo "********************************" | ||
bazel run //scripts:kdoc_validity_check -- $(pwd) scripts/assets/kdoc_validity_exemptions.pb | ||
echo "" | ||
|
||
# Run String resource validation check | ||
echo "********************************" | ||
echo "Running resource validation checks" | ||
echo "********************************" | ||
bazel run //scripts:string_resource_validation_check -- $(pwd) | ||
echo "" | ||
|
||
|
||
# THIRD PARTY DEPENDENCY CHECKS | ||
# These are checks for third party dependencies | ||
|
||
# Maven Repin Check | ||
echo "********************************" | ||
echo "Running Maven repin checks" | ||
echo "********************************" | ||
REPIN=1 bazel run @unpinned_maven//:pin | ||
echo "" | ||
|
||
# Maven Dependencies Update Check | ||
echo "********************************" | ||
echo "Running maven dependencies update checks" | ||
echo "********************************" | ||
bazel run //scripts:maven_dependencies_list_check -- $(pwd) third_party/maven_install.json scripts/assets/maven_dependencies.pb | ||
echo "" | ||
|
||
# License Texts Check | ||
echo "********************************" | ||
echo "Running license texts checks" | ||
echo "********************************" | ||
bazel run //scripts:license_texts_check -- $(pwd)/app/src/main/res/values/third_party_dependencies.xml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters