In my project, I got some warnings and I want to know how to resolve them.
I would appreciate it if you could help me.
Warnings:
Plugin validation failed. See Authoring Tasks for more information on how to annotate task properties.
Warning: Type ‘JarmonicaCreateTask’: field ‘taskType’ without corresponding getter has been annotated with @Internal.
Warning: Type ‘JarmonicaCreateTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.
Warning: Type ‘JarmonicaDownTask’: property ‘taskType$harmonica’ is not annotated with an input > or output annotation.
Warning: Type ‘JarmonicaMigrationTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.
Warning: Type ‘JarmonicaUpTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.
Warning: Type ‘JarmonicaVersionTask’: property ‘taskType$harmonica’ is not annotated with an input or output annotation.
Code:
// Kotlin
package com.improve_future.harmonica.plugin
import org.gradle.api.tasks.Internal
open class JarmonicaCreateTask : JarmonicaMigrationTask() {
@Internal
override val taskType = JarmonicaTaskType.Create
override fun exec() {
val migrationName =
if (project.hasProperty("migrationName"))
project.properties["migrationName"] as String
else "Migration"
jvmArgs = listOf<String>()
args = buildJarmonicaArgument(migrationName).toList()
super.exec()
}
}
I think the problem is this parent class has an internal field. But when I add @Internal annotation to it, the error “This annotation is not applicable to target 'member property without backing field or delegate” rises.
// Kotlin
abstract class JarmonicaMigrationTask : JavaExec() {
internal abstract val taskType: JarmonicaTaskType
Thanks in advance