summaryrefslogtreecommitdiff
path: root/java/plugin.go
diff options
context:
space:
mode:
author Luca Stefani <luca.stefani.ge1@gmail.com> 2024-10-12 17:55:31 +0200
committer Luca Stefani <luca.stefani.ge1@gmail.com> 2024-10-17 21:01:28 +0200
commit50098f775360a2b49ac981685dffb45366722b97 (patch)
treee9d86852f738baae570b1bdfbdcfa7b4c917b354 /java/plugin.go
parent991d11df34cc11d0dd71c8e4334fc3fc9e28e054 (diff)
Add support for kotlin plugins
Use the already existing hooks used by the compose compiler plugin to support kotlin plugins bundled alongside the compiler such as kotlin-serialize-compiler Test: m, sample app with kotlin-serialize-compiler Change-Id: I4d5fa6cd42acfc90ef437222e9e07f61c259d565
Diffstat (limited to 'java/plugin.go')
-rw-r--r--java/plugin.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/java/plugin.go b/java/plugin.go
index 9c4774a10..610c9fd11 100644
--- a/java/plugin.go
+++ b/java/plugin.go
@@ -24,6 +24,7 @@ func init() {
func registerJavaPluginBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("java_plugin", PluginFactory)
+ ctx.RegisterModuleType("kotlin_plugin", KotlinPluginFactory)
}
func PluginFactory() android.Module {
@@ -37,6 +38,16 @@ func PluginFactory() android.Module {
return module
}
+func KotlinPluginFactory() android.Module {
+ module := &KotlinPlugin{}
+
+ module.addHostProperties()
+
+ InitJavaModule(module, android.HostSupported)
+
+ return module
+}
+
// Plugin describes a java_plugin module, a host java library that will be used by javac as an annotation processor.
type Plugin struct {
Library
@@ -53,3 +64,8 @@ type PluginProperties struct {
// parallelism and cause more recompilation for modules that depend on modules that use this plugin.
Generates_api *bool
}
+
+// Plugin describes a kotlin_plugin module, a host java/kotlin library that will be used by kotlinc as a compiler plugin.
+type KotlinPlugin struct {
+ Library
+}