Scala Language Working With Gradle Basic Setup

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

  1. Create a file named SCALA_PROJECT/build.gradle with these contents:

    group 'scala_gradle'
    version '1.0-SNAPSHOT'
    
    apply plugin: 'scala'
    
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url "https://repo.typesafe.com/typesafe/maven-releases"
        }
    }
    
    dependencies {
        compile group: 'org.scala-lang', name: 'scala-library', version: '2.10.6'
    }
    
    
    task  "create-dirs" << {
        sourceSets*.scala.srcDirs*.each { it.mkdirs() }
        sourceSets*.resources.srcDirs*.each { it.mkdirs() }
    }
    
    
  2. Run gradle tasks to see available tasks.

  3. Run gradle create-dirs to create a src/scala, src/resources directory.

  4. Run gradle build to build the project and download dependencies.



Got any Scala Language Question?