Closed jonmcclung closed 6 years ago
I think generating them into the same directory isn't an error, though generating multiple files with the same path is. In the example apps (and in our real apps at Dropbox) we put the prefix Native
on the name of the JNI C++ files, so the names don't collide.
It would be possible for Djinni to detect and avoid name collisions. It could be done by tracking the list of files created over a full generation run to look for duplicates. Right now all the files are generated independently, though.
I'm trying to get started with Djinni and I couldn't figure out why I seemed not to have all the headers I needed until I realized the JNI headers were overwriting the C++ headers. This is because I had them set to output to the same directory and they are given the same names. My suggestion for how to address this would be to raise an error when both of these files are set to output to the same directory.