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 extensions 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/extensions/

  1. 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.

  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

You will have to set the apropriate visbility. See the list of visibilities in the link below.

  1. Clean up any unused deps dependencies

  2. Verify that the app builds

Useful links

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
Victor-Titancommented, Mar 20, 2021

I’m sorry, I found my mistake. I forgot to convert the ‘.’ and the ‘:’ to ‘_’. The app builds now. Will make a PR shortly.

0reactions
FareesHussaincommented, Mar 20, 2021

Yes, the format of the third party dependencies is not obvious. I can update the instructions next time to include their converted names.

Yes, It’s already mentioned here. https://github.com/oppia/oppia-android/blob/0a374bdde6b9d73f50ea800ebade891aa23e888e/third_party/versions.bzl#L10-L13

Read more comments on GitHub >

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

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