Johann Pardanaud
10/16/2023, 6:46 PMdave08
10/17/2023, 10:18 AM@Validate
data class Fixture(val foo: Foo, val baz: Baz)
will the ksp plugin generate accessors for Foo and Baz (from the main module), even though ksp is only enabled in the test module, since it has to generate for Fixture
anyways?Johann Pardanaud
10/17/2023, 11:26 AMFixture
The reason I did not do this is to avoid generating to much accessors without the developer being aware of this, I don't want this to snowball. Maybe I will change this behavior in the future, nothing is settled.dave08
10/17/2023, 11:32 AM@Validate(generateTransitive=true)
or something similar, that way it's only opt-in.Johann Pardanaud
10/17/2023, 11:44 AMvalidatableClasses
option do the trick in your case? It also avoids creating a dummy Fixture
class.dave08
10/17/2023, 11:45 AMJohann Pardanaud
10/17/2023, 11:46 AMdave08
10/17/2023, 11:48 AMinternal var validatablePackages: Set<String> = emptySet()
is not yet implemented I suppose?Johann Pardanaud
10/17/2023, 11:48 AMJohann Pardanaud
10/17/2023, 11:49 AMJohann Pardanaud
10/17/2023, 11:49 AMdave08
10/17/2023, 1:10 PMksp { arg("???", "????" }
block in build.gradle.kts? How would I separate the list of packages, one humongous string?Johann Pardanaud
10/17/2023, 1:18 PMksp { arg(...) }
block, you can write something like that:
ksp {
arg("validatableClasses", "org.example.Foo|org.example.Bar")
}
Unfortunately, ksp plugins only accept strings as option values, so have to use a "humongous string" like you said 😅, each class separated by a |
You can improve the readability by joining multiple strings into one:
listOf("org.example.Foo", "org.example.Bar").joinToString("|")