Create a BUILD.bazel file for the threading 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/threading/
- Define the kt_android_library libraries
Based on the imports in the Kotlin files, add the required third_party dependencies to make the libraries build.
Run
bazel build :all
inside the directory, to verify that the libraries build.
Check the Useful links section for a list of third_party dependencies.
You can start with the following stub
load("@dagger//:workspace_defs.bzl", "dagger_rules")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
kt_android_library(
name = "annotations",
srcs = [
"BackgroundDispatcher.kt",
"BlockingDispatcher.kt",
],
visibility = ["//:oppia_api_visibility"],
)
kt_android_library(
name = "prod_module",
srcs = [
"DispatcherModule.kt",
],
deps = [
":dagger",
],
)
kt_android_library(
name = "concurrent_collections",
srcs = [
"ConcurrentCollections.kt",
],
visibility = ["//:oppia_api_visibility"],
)
dagger_rules()
-
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
-
Clean up any unused deps dependencies
-
Verify that the app builds
Useful links
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
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 >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 >The Bazel Code Base
Every repository is composed of packages, a collection of related files and a specification of the dependencies. These are specified by a file...
Read more >Command-Line Reference | Bazel
If enabled, Bazel profiles the build and writes a JSON-format profile into a file in the output base. View profile by loading into...
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 >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
Create a pull request to make it easier to diagnose. For this one, you need to add the annotations as a dependenc y to prod_module.
Thanks @yashraj-iitr. Let me know if you have any questions.