Skip to content

Commit 64ba622

Browse files
BenHenningadhiamboperesseanlip
authored
Fix #1535, part of #4120: Upgrade to rules_kotlin v1.5.0 beta 3 (#5400)
## Explanation Fixes #1535 Fixes part of #4120 This PR preps for the codebase-wide migration to Kotlin 1.6 (done in #4937) by first upgrading rules_kotlin from 1.5.0 alpha 2 to 1.5.0 beta 3. This upgrade, while small, produces a few nice benefits: - It removes the need for extra WORKSPACE dependency setup (thus addressing #1535). - It moves a bunch of rules_kotlin macros to new locations which results in changing nearly every ``BUILD.bazel`` file in the codebase. The changes are straightforward to review in isolation, so this PR acts as a means to help reduce the complexity of #4937 by pulling ahead these groups of ``BUILD.bazel`` changes while also moving rules_kotlin the smallest number of versions (ahead of the more major upgrades which will occur downstream). Note that this change is needed because: - We'll need to upgrade to a newer version of rules_kotlin in order to bring in Kotlin 1.6 support. - rules_kotlin moved these macros and using the old ones results in a _lot_ of build warnings that spam the local console when trying to build. Separately, this PR includes some minor trailing space cleanup in wiki/Oppia-Bazel-Setup-Instructions.md that was noticed when editing the file (since my local development environment auto-strips trailing spaces). ## Essential Checklist - [x] The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".) - [x] Any changes to [scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets) files have their rationale included in the PR explanation. - [x] The PR follows the [style guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide). - [x] The PR does not contain any unnecessary code changes from Android Studio ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)). - [x] The PR is made from a branch that's **not** called "develop" and is up-to-date with "develop". - [x] The PR is **assigned** to the appropriate reviewers ([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)). ## For UI-specific PRs only N/A -- This should only affect build infrastructure, and barely impact resulting binary builds. --------- Co-authored-by: Adhiambo Peres <[email protected]> Co-authored-by: Sean Lip <[email protected]>
1 parent 6b724ac commit 64ba622

File tree

145 files changed

+156
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+156
-160
lines changed

WORKSPACE

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ http_archive(
3030
urls = ["https://github.com/bazelbuild/rules_kotlin/releases/download/%s/rules_kotlin_release.tgz" % HTTP_DEPENDENCY_VERSIONS["rules_kotlin"]["version"]],
3131
)
3232

33-
# TODO(#1535): Remove once rules_kotlin is released because these lines become unnecessary
34-
load("@io_bazel_rules_kotlin//kotlin:dependencies.bzl", "kt_download_local_dev_dependencies")
35-
36-
kt_download_local_dev_dependencies()
37-
38-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kotlin_repositories", "kt_register_toolchains")
33+
load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
3934

4035
kotlin_repositories()
4136

37+
load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
38+
4239
kt_register_toolchains()
4340

4441
# The proto_compiler and proto_java_toolchain bindings load the protos rules needed for the model

app/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ order to build with Bazel.
1010
- All binding adapters must be written in Java.
1111
"""
1212

13-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
13+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
1414
load("@tools_android//tools/crashlytics:defs.bzl", "crashlytics_android_library")
1515
load("@tools_android//tools/googleservices:defs.bzl", "google_services_xml")
1616
load("//app:app_test.bzl", "app_test")

app/src/main/java/org/oppia/android/app/activity/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Constructs for setting up activities for injection in the Dagger graph.
33
"""
44

5-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
5+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
66

77
# TODO(#59): Define these exported files as separate libraries from top-level targets.
88
exports_files([

app/src/main/java/org/oppia/android/app/activity/route/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Constructs for setting up activity routing support in the Dagger graph.
33
"""
44

5-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
5+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
66

77
# TODO(#59): Define these exported files as separate libraries from top-level targets.
88
exports_files([

app/src/main/java/org/oppia/android/app/application/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Dagger graph.
55
Specific application implementations can be found in subpackages.
66
"""
77

8-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
8+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
99

1010
kt_android_library(
1111
name = "abstract_application",

app/src/main/java/org/oppia/android/app/application/alpha/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This package contains the root application definitions for alpha builds of the app.
33
"""
44

5-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
5+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
66

77
kt_android_library(
88
name = "alpha_application",

app/src/main/java/org/oppia/android/app/application/alphakenya/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ This package contains the root application definitions for a Kenya user study sp
33
of the app.
44
"""
55

6-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
6+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
77

88
kt_android_library(
99
name = "alpha_kenya_application",

app/src/main/java/org/oppia/android/app/application/beta/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This package contains the root application definitions for beta builds of the app.
33
"""
44

5-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
5+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
66

77
kt_android_library(
88
name = "beta_application",

app/src/main/java/org/oppia/android/app/application/dev/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ there are specially defined top-level build flavors which will select their corr
66
application configuration.
77
"""
88

9-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
9+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
1010

1111
kt_android_library(
1212
name = "developer_application",

app/src/main/java/org/oppia/android/app/application/ga/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
This package contains the root application definitions for general availability builds of the app.
33
"""
44

5-
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_android_library")
5+
load("@io_bazel_rules_kotlin//kotlin:android.bzl", "kt_android_library")
66

77
kt_android_library(
88
name = "general_availability_application",

0 commit comments

Comments
 (0)