registerKotlinJvmCompileTask
Registers a new standalone Kotlin compilation task for the JVM platform.
This task is not associated with any KotlinTarget or KotlinCompilation. It is not executed as part of the common compilation pipeline.
Here's an example of how to register a new task:
project.plugins.apply<KotlinApiPlugin>()
val kotlinApiPlugin = project.plugins.getPlugin(KotlinApiPlugin::class)
val kotlinJvmOptions = kotlinApiPlugin.createCompilerJvmOptions()
val kotlinJvmCompileTask = kotlinApiPlugin.registerKotlinJvmCompileTask(
"customKotlinCompile",
kotlinJvmOptions,
project.providers.provider { ExplicitApiMode.Strict }
)
Since
2.1.0
Parameters
the name of the task.
values of this KotlinJvmCompilerOptions instance that are used as convention values for KotlinJvmCompilerOptions's inside task.
desired ExplicitApiMode mode in the task. The Provider can have null
value which is the same as specify ExplicitApiMode.Disabled. By default, the value is ExplicitApiMode.Disabled.
Deprecated
Replaced with 'registerKotlinJvmCompileTask(taskName, compilerOptions, explicitApiMode)'
Registers a new standalone Kotlin compilation task with the given taskName for the JVM platform.
Since
1.7.0
Deprecated
Replaced with 'registerKotlinJvmCompileTask(taskName, compilerOptions, explicitApiMode)'
Registers a new standalone Kotlin compilation task for the JVM platform.
Since
1.9.20
Parameters
The name of the task to be created.
The name of the module for which the task is being created. For more information, see KotlinJvmCompilerOptions.moduleName.