New project in IntelliJ, catch-22


#1

Hi All,

I recently downloaded IntelliJ and tried to setup a new Kotlin project.

One way to create a Kotlin project is “New -> New Project -> Kotlin”. Another is via “New -> New Project -> Gradle” and then “Tools -> Kotlin -> Configure Kotlin in Project”.

The first way, it is easy to write/build/run Kotlin – but there is no build script (build.gradle or pom.xml) so there is way to add dependencies. The second way, there is a build.gradle but it does not seem to find my Kotlin files (even though I put them in src/main/kotlin/<name of artifact>.

It would be nice to have Kotlin+Gradle and to create through a blessed path in the IntelliJ UI (might as well know the right way to do things). Anyone been through this and have some thoughts about my predicament?

Kind Regards,
Jason


#2

If you are using the Android plugin (are building android) the src/kotlin directory is not recognised. You can add it manually or just put your kotlin files in the java directory, either works.


#3

Where does the Kotlin Gradle plugin expect to find Kotlin sources by
default?
Paul de Vrieze kotlinlang@discoursemail.com schrieb am Sa. 27. Mai 2017
um 10:55:


#4

The default for non-android is src/main/kotlin where main is the sourceset.