$ mkdir learn-scala
$ cd learn-scala
$ gradle init --type scala-library
:wrapper
:init
BUILD SUCCESSFUL in 4s
2 actionable tasks: 2 executed
Add id 'idea'
to plugins
in build.gradle
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Scala library project to get you started.
* For more details take a look at the Scala plugin chapter in the Gradle
* user guide available at https://docs.gradle.org/4.6/userguide/scala_plugin.html
*/
plugins {
// Apply the scala plugin to add support for Scala
id 'scala'
id 'idea'
}
dependencies {
// Use Scala 2.11 in our library project
compile 'org.scala-lang:scala-library:2.11.8'
// Use Scalatest for testing our library
testCompile 'junit:junit:4.12'
testCompile 'org.scalatest:scalatest_2.11:3.0.4'
// Need scala-xml at test runtime
testRuntime 'org.scala-lang.modules:scala-xml_2.11:1.0.6'
}
// In this section you declare where to find the dependencies of your project
repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}