kopykat-kt / kopykat

Little utilities for more pleasant immutable data in Kotlin
Other
283 stars 16 forks source link

Does 'superCopy' observe the 'generate' is 'annotated' setting #71

Closed slawluc closed 2 years ago

slawluc commented 2 years ago

Given these gradle settings

buildscript {
    dependencies {
        .....
        classpath "com.google.devtools.ksp:symbol-processing-gradle-plugin:1.7.10-1.0.6"
    }
}

dependencies {
    .......
    ksp("at.kopyk:kopykat-ksp:1.0-rc7")
    compileOnly("at.kopyk:kopykat-annotations:1.0-rc7")
}

ksp {
    arg("generate","annotated")
    arg("mutableCopy", "true")
    arg("copyMap", "true")
    arg("hierarchyCopy", "true")
    arg("superCopy", "true")
}

When I attempt to annotate this class with @CopyExtensions a nullable middle name

@CopyExtensions
data class Person(
    val firstName: String,
    val surname: String
)

Then It generates classes for other classes that have not been annotated with CopyExtension.

When gradle is configured like this

ksp {
    arg("generate","annotated")
    arg("superCopy", "false")
}

Then I only have generated classes for 'Person'

Note This is the only class annotated with CopyExtension in the project

serras commented 2 years ago

This feature is actually being removed in favor of #68. We see now that the way you annotate things is not clear, this is part of the reason why we are removing it. Closing since this behavior won't be available in the next version.