https://kotlinlang.org logo
j

jdemeulenaere

07/04/2018, 6:55 PM
Hey guys! Quick question about working on the JetBrains/kotlin repo. I ran a child Android Studio with "bunch switch . as32 && ./gradlew runIde", but I feel that my android project is not using the kotlin compiler that I just compiled.. How can I check if it is using it or not ? Thanks a lot 🙂
d

dsavvinov

07/04/2018, 7:33 PM
If your build is delegated to gradle, it will use compiler set by
build.gradle
-file (and by default,
build.gradle
will be created with some latest stable version, like
1.2.51
) To use just-compiled compiler (we call them "SNAPSHOT"), you need to actually take that compiler from some repository -- e.g., local maven repository. Something like
./gradlew dist install publish
should build artifacts from sources and publish them in local maven repository under
1.2-SNAPSHOT
version, on which you can depend later.
j

jdemeulenaere

07/05/2018, 12:31 PM
Cool, I'll try that, thanks! Is there any way to configure something to use the just compiled compiler after running ./gradlew runIde ? I think this is what is done for the Kotlin IDEA plugin (which correctly shows @snapshot@ as version)
d

dsavvinov

07/05/2018, 12:37 PM
No, there's no such way. Probably the very best that can be done here is to somehow force debug-IDEA to generate
build.gradle
already with
1.2-SNAPSHOT
version of Kotlin in it. But nobody have been bothered enough yet to do it 🙂 (probably, because for debugging compiler in Gradle, you'll still have to go extra mile with attaching debugger to Gradle Compiler Daemon)
j

jdemeulenaere

07/05/2018, 1:06 PM
Unfortunately it still doesn't work. Everything in my gradle file is using the version 1.2-SNAPSHOT (that is in my local .m2 repository) : in the build script (kotlin gradle plugin) and in the dependencies (stdlib). However I don't know if there is a way of specifying the compiler used by gradle in the DSL ?
When I go to preferences > Kotlin Compiler it says that my project overrides the default. However in Project Structure > Module > app, I don't see anything about the compiler
And there is no checkbox "Delegate build to gradle" in Android Studio that I can uncheck (the one that we have in IDEA)
2 Views