Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose parcelize plugin and add an example for using it #522

Merged
merged 1 commit into from
Apr 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions examples/plugin/src/parcelize/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
load("//kotlin:kotlin.bzl", "kt_compiler_plugin", "kt_jvm_library", "kt_jvm_test")

kt_compiler_plugin(
name = "parcelize_plugin",
compile_phase = True,
id = "org.jetbrains.kotlin.parcelize",
stubs_phase = True,
deps = [
"@com_github_jetbrains_kotlin//:parcelize-compiler-plugin",
],
)

kt_jvm_library(
name = "parcelize",
srcs = [],
exported_compiler_plugins = [":parcelize_plugin"],
plugins = [
":parcelize_plugin",
],
visibility = ["//visibility:public"],
exports = [
"@com_github_jetbrains_kotlin//:parcelize-runtime",
],
)

kt_android_library(
name = "parcelable",
srcs = [
"ParcelableObject.kt",
],
deps = [
":parcelize",
],
)
6 changes: 6 additions & 0 deletions examples/plugin/src/parcelize/ParcelableObject.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package plugins.parcelize

import android.os.Parcelable
import kotlinx.parcelize.Parcelize

@Parcelize class ParcelableObject(val name: String) : Parcelable
10 changes: 10 additions & 0 deletions kotlin/internal/repositories/BUILD.com_github_jetbrains_kotlin
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ kt_jvm_import(
jar = "lib/sam-with-receiver-compiler-plugin.jar",
)

kt_jvm_import(
name = "parcelize-compiler-plugin",
jar = "lib/parcelize-compiler.jar",
)

kt_jvm_import(
name = "parcelize-runtime",
jar = "lib/parcelize-runtime.jar",
)

# Kotlin dependencies that are internal to this repo and may be linked.
[
java_import(
Expand Down