https://kotlinlang.org logo
Title
s

spierce7

09/26/2018, 1:19 PM
It works if I put them in the
buildSrc
folder, but I still have red errors in the IDE. I have to sync the project, and then open the buildSrc file again for the IDE error to disappear. Is that a known issue?
g

gildor

09/26/2018, 4:49 PM
Yes, but it should work properly on the latest versions of Gradle + Idea (you should see button "apply dependencies" to reload script classpath
s

spierce7

09/27/2018, 4:47 AM
I have the latest stable IntelliJ. I don't see "apply dependencies", but I do see sync gradle. If I sync gradle, go to the buildSrc file, and then back to where I'm using the variables from the buildSrc, then it will work.
g

gildor

09/27/2018, 5:23 AM
Yes, this is how this work for now
See “IDE integration improvements” https://github.com/gradle/kotlin-dsl/releases/tag/v1.0-RC3 There is a gif with example of this behavior, but with enabled “auto import”
Also, see this task https://github.com/gradle/kotlin-dsl/issues/962 and this one, I created it and also pointed that would be good to have the same experience as with any other Kotlin module, instead reloading build class path manually or even with “auto import gradle changes” https://youtrack.jetbrains.com/issue/KT-25354#focus=streamItem-27-2947589-0-0