NOTE: Full source code for this is here.
I used the Gradle Init plugin to create a Scala library:
gradle init --type scala-library
./gradlew clean idea
gradle idea command to generate IntelliJ IDEA project files is not recommended, it creates legacy format project files and in most cases the project will not work correctly (it will work only for basic Java projects).
This way of generating IntelliJ IDEA projects is deprecated and you should just open
build.gradle file in IntelliJ IDEA (it's the same as using Import and specifying the build file location).
Mapping Gradle project model to IntelliJ IDEA project model is really complicated and is being maintained and supported by JetBrains developers using Gradle API, while
gradle idea was added by Gradle developers and is no longer actively maintained.