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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user