Is there any standard source folder for generated ...
# gradle
t
Is there any standard source folder for generated code?
src/generated/kotlin
?
1
m
Usually in
build
something as it's not to be checked in source control
t
It will be checked
m
Well then wherever you want
t
🙂
v
Imho it shouldn't be checked in if it is generated or a build artifact. But if you really want to check it in, there is no standard place I'm aware of, as it is not standard to check them in. The most common I've seen in that case is to have the files in the normal source directory. But you can also keep them separate of course.
👍 2
b
For clarity I'd just place them in src/[sourceSetName]/generated and add that to sourceSet's srcDirs
👍 1
This would at least play nicely with MPP should you decide to convert in the future.
t
I had simple variants before: 1. Genarated by Gradle plugin - use task temp dir (
build/...
) 2. Kotlin/JS declarations a. Written manually -
src/main/kotlin
b. Generated by external generator -
src/main/kotlin
i. Generated == manual editing prohibited Now I have first subproject where I will have mix of
2.a
and
2.b
Variant of @Big Chungus looks like most flexible/idiomatic