How can I import libraries like Ktor with their so...
# gradle
e
How can I import libraries like Ktor with their sources and set breakpoints in them?
d
I don't know about Ktor specifically, but I do that all the time.
I usually do it with IntelliJ IDEA, so I add the idea plug-in and conffigure the modules to download sources. You don't need to do it that way though.
Copy code
plugins {
    idea
}

idea {
    module {
        isDownloadJavadoc = true
        isDownloadSources = true
    }
}
e
h
You don’t need the idea plugin. On JVM, just go to the position you want to debug, add a breakpoint and run the task with the debugger.
v
IntelliJ does no longer download sources on sync automatically to save sync time. You can configure IntelliJ to again download sources on sync, or if you open a file you do not have sources synced, there should be a button in the header of the file to download them. This is more an IDE question though, not a Gradle question.
e
How would I add the breakpoint if I don't even see the source?
v
Let it first download the source, then set the breakpoint
e
That was the question. How do I let it download the source?
d
Almost all actions can be found from the help menu “find action”. Go in there and search for “download sources”
🙏 1
v
And as I said, if you navigate to a file where no sources are available, you usually have a "download sources" button in its header for exactly that dependency.
Aaand again, it is not at all a Gradle topic, so off-topic here. 😉 It is an IDE topic.
e
I was hoping there was a setting in the version catalog like
classifier="sources"
to download sources
v
A version catalog is a catalog of coordinates and versions and nothing more. That something is in there does not even mean it is used anywhere. And classifiers are also never found in a version catalog as classifier or not or which one belongs to where the version catalog is used. Whether sources are downloaded to display them in the IDE or not is a pure IDE topic, even if it under the hood uses Gradle to retrieve the sources.