-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose parcelize plugin and add an example for using it (#522)
Co-authored-by: Alex <alexburdusel@google.com>
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters