-
Notifications
You must be signed in to change notification settings - Fork 499
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
Fixes #2881: Creating BUILD.bazel for statusbar utility #2959
Conversation
Fixes oppia#2881 by creating a BUILD.bazel file
@Arjupta Please complete all the installation steps - https://github.com/oppia/oppia-android/wiki#installation |
I have completed the setup again, but it isn't formatting the Bazel files as needed. Any hints ? |
visibility = ["//:oppia_api_visibility"], | ||
deps = [ | ||
"//third_party:androidx_appcompat_appcompat", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
] | |
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for now, this will fix it. I will create a bazel lint guide in our wiki this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, by the time you can setup this, if you are not on windows - https://formulae.brew.sh/formula-linux/buildifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also used buildifier earlier, but it was just mentioning that there is a some lint failure in both the BUILD.bazel files I have changed. It was not actually pointing out the cause of failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildifier has a different type of output while sending error, like #reformat
. Will try to cover all possible cases in wiki page.
by the time, if you want to check what command we run in checks, you can look at this script - https://github.com/oppia/oppia-android/blob/develop/scripts/buildifier_lint_check.sh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arjupta you can run buildifier on the file itself to let buildifier format the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bazel lint successfully pass
utility/BUILD.bazel
Outdated
@@ -51,6 +52,7 @@ kt_android_library( | |||
"//third_party:com_google_guava_guava", | |||
"//third_party:org_jetbrains_kotlinx_kotlinx-coroutines-core", | |||
"//utility/src/main/java/org/oppia/android/util/datetime:date_time_util", | |||
"//utility/src/main/java/org/oppia/android/util/statusbar:status_bar_color", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you try moving this dependency directly to the app module? I don't see any intradependency on this library in the utility module.
Hi @Arjupta, are you still working on this? Let me know if you need any clarification on my part. |
Yes, please explain a bit, why a dependency from utility module must be taken up to the app module. |
Ultimately, we will be removing the utility library. So whichever package needs the statusbar utility will directly add that to its list of dependencies. Eventually we will also be modularizing the app module, but by adding this dependency to the app library, we remove one layer of indirection. Right now it looks like this
we can remove one layer and let app depend on statusbar
|
Pardon for the delay, @fsharpasharp I have been busy with GSOC proposal all this time. I understand what you are trying to do finally. But where do we include statusBarUtility in the app module. It is used by several activities like onboarding, profile, walkthrough. Also in this branch all these files don't have their own BUILD.bazel . What do you suggest to do? |
Yes, for now we'll just add the dependency to the app library of app/BUILD.bazel, but eventually we will also create BUILD.bazel files for each package. |
Will we need to make a new library for this? I wasn't able to find a place where this status bar utility can be added as a dependecy. This is because status bar utility is only used by Presenters in our codebase and we don't have any separate library for presenters i guess. |
Does it work when you add the dependency to this library? kt_android_library(
name = "app",
srcs = APP_FILES,
custom_package = "org.oppia.android.app.ui",
enable_data_binding = 1,
manifest = "src/main/AppAndroidManifest.xml",
visibility = ["//visibility:public"],
deps = [
":binding_adapters",
":dagger",
":databinding_resources",
":resources",
":view_models",
":views",
"//data/src/main/java/org/oppia/android/data/backends/gae:prod_module",
"//model",
"//third_party:androidx_databinding_databinding-adapters",
"//third_party:androidx_databinding_databinding-common",
"//third_party:androidx_databinding_databinding-runtime",
"//third_party:androidx_lifecycle_lifecycle-extensions",
"//third_party:androidx_lifecycle_lifecycle-livedata-core",
"//third_party:androidx_lifecycle_lifecycle-livedata-ktx",
"//third_party:androidx_multidex_multidex",
"//third_party:androidx_viewpager2_viewpager2",
"//third_party:androidx_viewpager_viewpager",
"//third_party:androidx_work_work-runtime-ktx",
"//third_party:com_caverock_androidsvg-aar",
"//third_party:com_google_android_flexbox",
"//third_party:javax_annotation_javax_annotation-api_jar",
"//utility",
"//utility/src/main/java/org/oppia/android/util/accessibility:prod_module",
"//utility/src/main/java/org/oppia/android/util/extensions:bundle_extensions",
],
) |
Commited this change. @fsharpasharp PTAL |
utility/BUILD.bazel
Outdated
@@ -16,7 +16,6 @@ MIGRATED_PROD_FILES = glob([ | |||
"src/main/java/org/oppia/android/util/profile/*.kt", | |||
"src/main/java/org/oppia/android/util/datetime/*.kt", | |||
"src/main/java/org/oppia/android/util/system/*.kt", | |||
"src/main/java/org/oppia/android/util/statusbar/*.kt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@fsharpasharp PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this I will have to differ to @fsharpasharp and @BenHenning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utility/src/main/java/org/oppia/android/util/statusbar/BUILD.bazel
Outdated
Show resolved
Hide resolved
@BenHenning PTAL. Also the check which failed right now was not failing in the previous commit, the only change that was done in the latest commit was to change the desctiption of BUILD.bazel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Arjupta. I agree that the failure is unrelated, though it's surprising. This is the first time I've noticed a flake in ExplorationActivityTest. We'll need to keep an eye out for this.
Explanation
Fixes #2881 by creating a BUILD.bazel file
Checklist