Repository: JetBrains/compose-multiplatform
File: gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/resources/GenerateResourceAccessorsTask.kt (Kotlin)

Code before:
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.SkipWhenEmpty
import org.jetbrains.compose.internal.IdeaImportTask
import java.io.File
import java.nio.file.Path
import kotlin.io.path.relativeTo

/**
 * Defines a property responsible for enabling or disabling
 * generation of @ResourceContentHash annotation for resource accessors.
 */
interface ResourceContentHashAnnotationGenerationConfiguration {
    @get:Input
    val generateResourceContentHashAnnotation: Property<Boolean>
}

internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(),
    ResourceContentHashAnnotationGenerationConfiguration
{
    @get:Input
    abstract val packageName: Property<String>

    @get:Input
    abstract val resClassName: Property<String>

    @get:Input
    abstract val sourceSetName: Property<String>

    @get:Input
    @get:Optional
    abstract val packagingDir: Property<File>

    @get:Input
    abstract val makeAccessorsPublic: Property<Boolean>

    @get:InputFiles
    @get:SkipWhenEmpty
    @get:PathSensitive(PathSensitivity.RELATIVE)
    abstract val resDir: Property<File>

    @get:OutputDirectory
    abstract val codeDir: DirectoryProperty

    override fun safeAction() {

Review comment (refactor):
```kotlin
internal abstract class GenerateResourceAccessorsTask :
    IdeaImportTask(),
    ResourceContentHashAnnotationGenerationConfiguration {
    //...
}
```

Code after:
import org.gradle.api.file.DirectoryProperty
import org.gradle.api.provider.Property
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFiles
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.SkipWhenEmpty
import org.jetbrains.compose.internal.IdeaImportTask
import java.io.File
import java.nio.file.Path
import kotlin.io.path.relativeTo

/**
 * Configuration for resource accessors generation.
 */
interface ResourceAccessorsConfiguration {

    /**
     * Property that defines whether to generate `@ResourceContentHash` annotation for resource accessors.
     *
     * `@ResourceContentHash` annotation is used to mark resource accessors with the resource content hash.
     * It can be used by a client to determine if the resource content is changed or not.
     * By default, the annotation is not generated but the client may override it by setting this property to `true`.
     */
    val generateResourceContentHashAnnotation: Property<Boolean>
}

internal abstract class GenerateResourceAccessorsTask : IdeaImportTask(), ResourceAccessorsConfiguration {
    @get:Input
    abstract val packageName: Property<String>

    @get:Input
    abstract val resClassName: Property<String>

    @get:Input
    abstract val sourceSetName: Property<String>

    @get:Input
    @get:Optional
    abstract val packagingDir: Property<File>

    @get:Input
    abstract val makeAccessorsPublic: Property<Boolean>

    @get:Input
    abstract override val generateResourceContentHashAnnotation: Property<Boolean>

    @get:InputFiles
    @get:SkipWhenEmpty