https://kotlinlang.org logo
k

keturn

12/03/2018, 9:47 PM
Trying to get familiar with project directory structure... getting "package directive doesn't match file location" inspection error. This Stackoverflow post claims that IntelliJ doesn't support the current recommended Kotlin coding conventions, but that doesn't seem right, given how it's the flagship Kotlin IDE. https://stackoverflow.com/a/52538331/9585
m

Mike

12/03/2018, 10:08 PM
I haven’t seen anything in release notes to indicate that Jetbrains has fixed this yet, so the Stackoverflow answer is correct. My projects are still following java package conventions as a result.
h

hho

12/04/2018, 9:18 AM
So do I, but not just because of IntelliJ – it's also Gradle, Maven etc. Everything expects Java package conventions.
m

Mike

12/04/2018, 1:10 PM
I don’t think Gradle cares as the kotlin compiler doesn’t care, but I haven’t done any major investigation on that. So used to the extra effectively empty directories that I don’t think about it anymore.
k

kyonifer

12/04/2018, 9:36 PM
The trick i've used in the past is to name the folder
foo.bar.baz
with periods in the folder name. Intellij seems to be okay with that, and it saves you having empty directories at least.
👍 1
2 Views