Create a BUILD.bazel file for the extensions package in the utility module
See original GitHub issueThis task is part of the build system migration from Gradle to Bazel.
Prerequesites
- Make sure you are able to build Oppia using Bazel
- Follow the Oppia Bazel Setup instructions to setup Bazel and learn the terminology.
- Read the Gradle Bazel Migration Best Practies and FAQ for more context and see if there’s an answer there to any question you have.
Task
- Create a BUILD.bazel file in
src/main/java/org/oppia/android/util/extensions/
- Define the kt_android_library library/libraries
Based on the imports in the Kotlin files, add the required third_party dependencies to make the libraries build. Check the Useful links section for a list of third_party dependencies.
You can start with the following BUILD.bazel stub
"""
Add a description of the package here
"""
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
kt_android_library(
name = "bundle_extensions",
srcs = [
"BundleExtensions.kt",
],
)
kt_android_library(
name = "live_data_ext",
srcs = [
"LiveDataExt.kt",
],
)
Note: live_data_ext might not be used anywhere.
-
Add the directory to the MIGRATED_PROD_FILES of the module’s root BUILD.bazel file
-
Add the libraries to the list of deps dependencies in the targets that require the library
You will have to set the apropriate visbility. See the list of visibilities in the link below.
-
Clean up any unused deps dependencies
-
Verify that the app builds
Useful links
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
BUILD files | Bazel
This section describes the concrete syntax used to define a package. By definition, every package contains a BUILD file, which is a short ......
Read more >Manage external dependencies with Bzlmod - Bazel
The old WORKSPACE -based external dependency system is centered around repositories (or repos), created via repository rules (or repo rules).
Read more >Workspaces, packages, and targets - Bazel
The BUILD file specifies what software outputs can be built from the source. Workspace. A workspace is a directory tree on your filesystem...
Read more >Commands and Options | Bazel
This option specifies the set of directories that are searched to find the BUILD file for a given package. Bazel finds its packages...
Read more >Concepts and terminology - Bazel 4.1.0
A package is defined as a directory containing a file named BUILD or BUILD.bazel , residing beneath the top-level directory in the workspace....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m sorry, I found my mistake. I forgot to convert the ‘.’ and the ‘:’ to ‘_’. The app builds now. Will make a PR shortly.
Yes, It’s already mentioned here. https://github.com/oppia/oppia-android/blob/0a374bdde6b9d73f50ea800ebade891aa23e888e/third_party/versions.bzl#L10-L13