Does idea understand properties in build.gradle?

Hi,

I have these lines in my build.gradle:
apply from: "versions.gradle"
dependencies {
    compile "org.scala-lang:scala-library:${scalaVersion}"
}
and versions.gradle has
scalaVersion = "2.11.7"
Is it possible to see the value of scalaVersion from build.gradle (e.g. by hovering on it)?

By the way, I'm using 142.3728.3.

Thanks.

2 comments
Comment actions Permalink

Hi,

Do you mean gradle project extra properties (https://docs.gradle.org/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html)?
No, IDEA does not support it yet, however it understands local variables, see details at https://docs.gradle.org/current/userguide/writing_build_scripts.html#N10B07
e.g.

scalaVersion = "2.11.7"

dependencies {

    compile "org.scala-lang:scala-library:${scalaVersion}"

}

0
Comment actions Permalink

They are like local variables but are defined in a separate file and are imported to the build.gradle using apply from: "my-file-which-defines-variables.gradle". So I think idea hasn't understood apply from yet.

By the way, my company just bought me a commercial IDEA license. So congratulations to you :).

0

Please sign in to leave a comment.