it’s a bit bizarre as we need to manually move the...
# announcements
n
it’s a bit bizarre as we need to manually move the files all the time.
n
nerses: it’s not bizarre how does the ide know that java files are in
src/main/java
and kotlin in
src/main/kotlin
?
maven doesn’t know it either
n
when moving files IDE asks where you want to move and you can choose where to drop the file
so it has an understanding that those are separate things
and maybe kotlin plugin could have some default where to drop the converted file
n
but the nature of the folders is not known
you can put kotlin/java files into any one of those or called them
foo
and `bar``
g
@nerses you can simplify your process by keeping all files in the same root directory.
1
n
i wouldn’t do that to hava java files in
src/main/kotlin
and vice versa is opposite to the principle of least surprise
n
@gaetan I agree with @nfrankel the goal is to migrate java to Kotlin and not have a mix of files in one place. It’s the same as why we create maven modules we could just have one module instead
g
@nerses No, it’s not like maven modules. Usually you separate layers in different modules, each module having it’s own dependencies and so on… When you are migrating a project from java to kotlin the code is completely interconnected. It’s not java being compiled before kotlin nor the opposite. Java and kotlin code are compiled all together using stubs and other interesting techniques. There is no conceptual difference between java and kotlin code. It’s like the resources directory: it contains properties, yaml, xml, files. There is not really a reason to separate them. But you can do it if you prefer. It’s a matter of taste.
And if you keep java and kotlin files together, you don’t have to create another directory, to move your files, … I’m a very lazy guy. The less lines I have to make it working the better.
n
the problem is to have
.kt
files in
src/main/java
or
.java
files in
src/main/kotlin
it’s not about being lazy but about being misleading.