user1105412
user1105412

Reputation: 77

How to add rscala dependency in build.gradle

I would like to embed R in a Scala application, so how should I specify the dependency in the build.gradle file.

I found the following for sbt project.

libraryDependencies += "org.ddahl" %% "rscala" % "2.2.2"

Could someone please help me to specify the same in Gradle? Thanks in advance.

Upvotes: 0

Views: 294

Answers (1)

stefanobaghino
stefanobaghino

Reputation: 12804

You can add the dependency to your build definition like follows:

compile group: 'org.ddahl', name: 'rscala_2.11', version: '2.2.2'

As you may notice, while in SBT by using the %% operator you can omit the Scala version for which the library has been compiled, in Gradle (just like Maven) you have to state it explicitly, thus the dependency definition can change according to the Scala version you are using:

compile group: 'org.ddahl', name: 'rscala_2.10', version: '2.2.2'
compile group: 'org.ddahl', name: 'rscala_2.11', version: '2.2.2'
compile group: 'org.ddahl', name: 'rscala_2.12', version: '2.2.2'

If you want to know more about the binary compatibility policy across Scala versions here.

Upvotes: 1

Related Questions