question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create a BUILD.bazel file for the threading package in the utility module

See original GitHub issue

This task is part of the build system migration from Gradle to Bazel.

Prerequesites

Task

  1. Create a BUILD.bazel file in

src/main/java/org/oppia/android/util/threading/

  1. 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()
  1. Add the directory to the MIGRATED_PROD_FILES of the module’s root BUILD.bazel file

  2. Add the libraries to the list of deps dependencies in the targets that require the library

  3. Clean up any unused deps dependencies

  4. Verify that the app builds

Useful links

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
fsharpasharpcommented, Mar 22, 2021

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.

    deps = [
        ":annotations",
        ":dagger",
    ],
1reaction
fsharpasharpcommented, Mar 19, 2021

Thanks @yashraj-iitr. Let me know if you have any questions.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found