blob: f082ee64c81c2f7d68f1da752c13250f6f0e5c64 [file] [log] [blame]
load("@rules_android//android:rules.bzl", "android_library")
load("@rules_java//java:defs.bzl", "java_plugin")
load("@rules_kotlin//kotlin:android.bzl", "kt_android_library")
load("@rules_kotlin//kotlin:core.bzl", "kt_compiler_plugin", "kt_ksp_plugin")
kt_compiler_plugin(
name = "serialization_plugin",
compile_phase = True,
id = "org.jetbrains.kotlin.serialization",
stubs_phase = True,
deps = [
"@rules_kotlin//kotlin/compiler:kotlinx-serialization-compiler-plugin",
],
)
java_plugin(
name = "autovalue",
generates_api = 1,
processor_class = "com.google.auto.value.processor.AutoValueProcessor",
deps = ["@maven_rules_kotlin_example//:com_google_auto_value_auto_value"],
)
kt_ksp_plugin(
name = "moshi-kotlin-codegen",
processor_class = "com.squareup.moshi.kotlin.codegen.ksp.JsonClassSymbolProcessorProvider",
deps = [
"@maven_rules_kotlin_example//:com_squareup_moshi_moshi",
"@maven_rules_kotlin_example//:com_squareup_moshi_moshi_kotlin",
"@maven_rules_kotlin_example//:com_squareup_moshi_moshi_kotlin_codegen",
],
)
kt_android_library(
name = "my_kt",
srcs = glob(["src/main/java/**/*.kt"]),
custom_package = "examples.android.lib",
manifest = "src/main/AndroidManifest.xml",
plugins = [
":moshi-kotlin-codegen",
":serialization_plugin",
":autovalue",
],
resource_files = glob(["res/**"]),
tags = ["trace"],
visibility = ["//visibility:public"],
deps = [
":res2",
"@maven_rules_kotlin_example//:androidx_appcompat_appcompat",
"@maven_rules_kotlin_example//:com_google_auto_value_auto_value_annotations",
"@maven_rules_kotlin_example//:com_squareup_moshi_moshi",
"@maven_rules_kotlin_example//:org_jetbrains_kotlinx_kotlinx_serialization_core",
],
)
android_library(
name = "res2",
custom_package = "examples.android.lib",
manifest = "src/main/AndroidManifest.xml",
resource_files = glob(["res2/**"]),
)