https://kotlinlang.org logo
#announcements
Title
# announcements
n

nerses

05/08/2017, 1:16 PM
it’s a bit bizarre as we need to manually move the files all the time.
n

nfrankel

05/08/2017, 1:29 PM
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

nerses

05/08/2017, 1:35 PM
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

nfrankel

05/08/2017, 1:37 PM
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

gaetan

05/08/2017, 3:08 PM
@nerses you can simplify your process by keeping all files in the same root directory.
1
n

nfrankel

05/12/2017, 2:19 PM
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

nerses

05/15/2017, 6:53 PM
@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

gaetan

05/15/2017, 9:20 PM
@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

nfrankel

05/16/2017, 9:03 AM
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.
5 Views