E.g. `/home/me/projects/work/company/project/build...
# intellij
j
E.g.
/home/me/projects/work/company/project/build/generated/source/proto/main/java
c
1. Don't put generated sources into
build
directory, they should be under
yourproject/src/SOMETHING
2. it's strightforward and easily googleable: https://stackoverflow.com/questions/46419817/how-to-add-new-sourceset-with-gradle-kotlin-dsl
r
By the way, saw this suggestion several times: why not to put sources into the
build
directory? If I don't want to be able to navigate them and need codegen merely for my solution to work, putting results of apt into
build
will protect the code from being pushed to the repo. Are there any cons?
c
@r4zzz4k what you've described is a valid use-case, you're absolutely right. My experience is of course anecdotal by definition, but I have yet to see this use-case in production. That said if you have situation like that you're better off putting generated sources into a separate project which will be a runtime dependency of your main project.
r
I see. I was doing this, like, four years ago, so I'm not able to bring up details of this and I won't argue if that was justified enough. 🙂 The point on making generated stuff into runtime dependency is great, I agree this sounds reasonable.