Skip to content

Commit

Permalink
Use kotlin_library wherever possible instead of kt_jvm_library (#123
Browse files Browse the repository at this point in the history
)

Fixes #123
  • Loading branch information
arunkumar9t2 committed Oct 25, 2023
1 parent 8d9189d commit 421f7a8
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 48 deletions.
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
load("@bazel_common_dagger//:workspace_defs.bzl", "dagger_rules")
load("@grab_bazel_common//tools/parcelize:parcelize.bzl", "parcelize_rules")
load("@io_bazel_rules_kotlin//kotlin:core.bzl", "define_kt_toolchain", "kt_javac_options", "kt_kotlinc_options")

kt_kotlinc_options(
Expand Down Expand Up @@ -26,6 +27,8 @@ dagger_rules(
repo_name = "@bazel_common_maven",
)

parcelize_rules()

load("@grab_bazel_common//toolchains:toolchains.bzl", "configure_toolchains")

configure_toolchains()
2 changes: 1 addition & 1 deletion rules/test/multi_test.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")
load(":runtime_resources.bzl", "runtime_resources")

# Unused
Expand Down
1 change: 1 addition & 0 deletions tests/android/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ android_library(
},
},
deps = [
"//:parcelize",
"@bazel_common_maven//:com_google_android_material_material",
],
)
Expand Down
5 changes: 5 additions & 0 deletions tests/android/src/main/java/com/grab/test/TestActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package com.grab.test

import android.app.Activity
import android.os.Bundle
import android.os.Parcelable
import kotlinx.parcelize.Parcelize

class TestActivity : Activity() {
val material_res = com.google.android.material.R.color.material_blue_grey_950
Expand All @@ -13,4 +15,7 @@ class TestActivity : Activity() {
fun sum(a: Int, b: Int): Int {
return a + b
}

@Parcelize
data class ParcelExample(val value: String) : Parcelable
}
5 changes: 2 additions & 3 deletions tests/kotlin/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_test")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library", "kotlin_test")

kt_jvm_library(
kotlin_library(
name = "kotlin_test_lib",
srcs = glob([
"src/main/java/**/*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "source_set",
srcs = [
"SourceSet.kt",
Expand All @@ -18,7 +18,7 @@ java_library(
],
)

kt_jvm_library(
kotlin_library(
name = "resource",
srcs = [
"OutputFixer.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/aapt_lite/src/main/java/com/grab/aapt/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "aapt",
srcs = glob([
"*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "binding",
srcs = glob([
"**/*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "model",
srcs = glob([
"Models.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "brclass",
srcs = glob([
"BrClassGenerator.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "common",
srcs = glob([
"*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "aapt_scope",
srcs = glob([
"AaptScope.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "mapper",
srcs = glob([
"*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "rclass",
srcs = glob([
"**/*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "util",
srcs = glob([
"*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "jars",
srcs = glob([
"*.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/android_mock/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "mocked_android_jar_lib",
srcs = glob([
"src/main/java/**/*.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/bazel_lib/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "bazel_lib",
srcs = glob([
"src/main/kotlin/**/*.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/binding-adapter-bridge/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_test")

kt_jvm_library(
kotlin_library(
name = "binding-adapter-processor",
srcs = glob([
"src/main/java/**/*.kt",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "buildconfig",
srcs = glob([
"*.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/maven/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "maven_lib",
srcs = glob([
"src/main/kotlin/**/*.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/parcelize/parcelize.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_compiler_plugin")

def parcelize_rules():
Expand Down Expand Up @@ -31,7 +31,7 @@ def parcelize_rules():
],
)

kt_jvm_library(
kotlin_library(
name = "parcelize",
exported_compiler_plugins = [":parcelize_plugin"],
visibility = ["//visibility:public"],
Expand Down
4 changes: 2 additions & 2 deletions tools/test_suite/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "test_suite",
srcs = glob([
"src/main/java/**/*.kt",
Expand Down
5 changes: 2 additions & 3 deletions tools/test_suite_generator/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library", "kt_jvm_test")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_test")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library", "kotlin_test")

kt_jvm_library(
kotlin_library(
name = "test_suite_generator_lib",
srcs = glob([
"src/main/java/**/*.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/worker/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_test")

kt_jvm_library(
kotlin_library(
name = "worker_lib",
srcs = glob([
"src/main/kotlin/**/*.kt",
Expand Down
4 changes: 2 additions & 2 deletions tools/worker/test_worker/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
load("@io_bazel_rules_kotlin//kotlin:jvm.bzl", "kt_jvm_library")
load("@grab_bazel_common//rules:defs.bzl", "kotlin_library")

kt_jvm_library(
kotlin_library(
name = "test_worker_lib",
srcs = glob([
"src/main/kotlin/**/*.kt",
Expand Down

0 comments on commit 421f7a8

Please sign in to comment.