Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1736: Add Bazel Linter #2048

Merged
merged 30 commits into from
Feb 13, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d33a90b
bazel lint fix
anandwana001 Oct 27, 2020
a01bdbb
bazel lint fix
anandwana001 Oct 27, 2020
f0d55be
rules_android
anandwana001 Oct 27, 2020
6753a03
app package visibility modify
anandwana001 Nov 13, 2020
8806c0a
exporting app manifest file
anandwana001 Nov 13, 2020
1668680
target path fix
anandwana001 Nov 13, 2020
9c4a207
merge develop
anandwana001 Dec 18, 2020
b5d2416
nit formatting
anandwana001 Jan 4, 2021
afe258e
nit change
anandwana001 Jan 4, 2021
fde338d
nit fix
anandwana001 Jan 4, 2021
1a70341
updating visiblity
anandwana001 Jan 5, 2021
f42db09
updating visiblity
anandwana001 Jan 5, 2021
10d4d0b
shifting crashlytics and removing from app module
anandwana001 Jan 5, 2021
f5ea647
nit fix
anandwana001 Jan 5, 2021
ef4d153
nit fix
anandwana001 Jan 5, 2021
093a001
update linter command
anandwana001 Jan 5, 2021
03ac051
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
anandwana001 Jan 5, 2021
240a5ca
adding pre push
anandwana001 Jan 5, 2021
e10ac3c
using script in github workflow
anandwana001 Jan 9, 2021
222ae74
revert
anandwana001 Jan 9, 2021
1d6f2b3
merge and revert bazel pre-push
anandwana001 Jan 18, 2021
96b3d29
undo change
anandwana001 Jan 18, 2021
5ac90e8
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
anandwana001 Jan 25, 2021
fc70b42
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
anandwana001 Feb 4, 2021
14c596c
nit fix
anandwana001 Feb 4, 2021
fac0210
merge and resolve conflicts
anandwana001 Feb 11, 2021
d40e412
adding scripts
anandwana001 Feb 11, 2021
b4d8be8
putting buildifier error
anandwana001 Feb 11, 2021
0b92e55
fixing buildifier error
anandwana001 Feb 11, 2021
fad6866
Merge branch 'develop' of https://github.com/oppia/oppia-android into…
anandwana001 Feb 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,22 @@ jobs:
echo Using Bufbuild version $BUFVERSION
curl -sSL https://github.com/bufbuild/buf/releases/download/$BUFVERSION/buf-$(uname -s)-$(uname -m) > buf
chmod a+x buf

- name: Download Buildifier
run: |
BUILDIFIER="3.4.0"
echo Using Buildifier version $BUILDIFIER
curl -sSLO https://github.com/bazelbuild/buildtools/releases/download/$BUILDIFIER/buildifier > buildifier
chmod a+x buildifier

- name: Kotlin lint check
run: ./ktlint --android domain/src/**/*.kt utility/src/**/*.kt data/src/**/*.kt app/src/**/*.kt testing/src/**/*.kt && echo "Lint completed successfully"

- name: Protobuf lint check
run: ./buf check lint --input=model/src/main/proto --input-config buf.yaml && echo "Protobuf lint check completed successfully"

- name: Bazel lint check
run: ./buildifier --lint=warn --mode=check --warnings=all -r app data domain model testing utility tools BUILD.bazel WORKSPACE oppia_android_test.bzl
anandwana001 marked this conversation as resolved.
Show resolved Hide resolved

robolectric_tests:
name: Robolectric Tests (Non-App Modules)
Expand Down
6 changes: 4 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_android//android:rules.bzl", "android_binary")

# TODO(#1532): Rename file to 'BUILD' post-Gradle.
# TODO(#1640): Move binary manifest to top-level package post-Gradle.
android_binary(
Expand All @@ -7,10 +9,10 @@ android_binary(
manifest = "//app:src/main/AndroidManifest.xml",
manifest_values = {
"applicationId": "org.oppia.android",
"versionCode": "0",
"versionName": "0.1-alpha",
"minSdkVersion": "19",
"targetSdkVersion": "29",
"versionCode": "0",
"versionName": "0.1-alpha",
},
multidex = "native", # TODO(#1875): Re-enable legacy for optimized release builds.
deps = [
Expand Down
24 changes: 16 additions & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
This file lists and imports all external dependencies needed to build Oppia Android.
"""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# Android SDK configuration. For more details, see:
# https://docs.bazel.build/versions/master/be/android.html#android_sdk_repository
Expand All @@ -14,6 +13,17 @@ android_sdk_repository(
api_level = 28,
)

RULES_ANDROID_TAG = "0.1.1"

RULES_ANDROIDL_SHA = "cd06d15dd8bb59926e4d65f9003bfc20f9da4b2519985c27e190cddc8b7a7806"
BenHenning marked this conversation as resolved.
Show resolved Hide resolved

http_archive(
name = "rules_android",
sha256 = RULES_ANDROIDL_SHA,
strip_prefix = "rules_android-%s" % RULES_ANDROID_TAG,
urls = ["https://github.com/bazelbuild/rules_android/archive/v0.1.1.zip"],
)

# Add support for JVM rules: https://github.com/bazelbuild/rules_jvm_external
RULES_JVM_EXTERNAL_TAG = "2.9"

Expand Down Expand Up @@ -50,12 +60,10 @@ kotlin_repositories()

kt_register_toolchains()

"""
The proto_compiler and proto_java_toolchain bindings load the protos rules needed for the model
module while helping us avoid the unnecessary compilation of protoc. Referecences:
- https://github.com/google/startup-os/blob/5f30a62/WORKSPACE#L179-L187
- https://github.com/bazelbuild/bazel/issues/7095
"""
# The proto_compiler and proto_java_toolchain bindings load the protos rules needed for the model
# module while helping us avoid the unnecessary compilation of protoc. Referecences:
# - https://github.com/google/startup-os/blob/5f30a62/WORKSPACE#L179-L187
# - https://github.com/bazelbuild/bazel/issues/7095

bind(
name = "proto_compiler",
Expand Down
Loading