This message was deleted.
# plugin-development
s
This message was deleted.
šŸ‘€ 3
v
I think
using
.gradle
instead of
.gradle.kts
for the scripts involved might also make a difference
indeed is your main or sole problem if I got it right. Editing Gradle DSL build scripts in IntelliJ is still the only case where using the
-all
distribution instead of
-bin
is helpful, but only while editing the build scripts. There the source is included and you can navigate and complete better. This is just a work-around for a still unsolved IntelliJ shortcoming actually for which a ticket in YouTrack exists. With Kotlin DSL build scripts it is different as there the source is automatically downloaded if necessary on first IDE sync.
j
Thank you. That was helpful. I added one
.gradle.kts
script to the project (that is usually only based on Groovy scripts). That triggered the
-src
download on next sync 🤯 and afterwards the navigation worked. Also from the Java classes in all the subprojects. I wonder if I can configure that manually somehow without having to add the
.gradle.kts
script… ?
And… If I turn the ā€œwrongā€ file into a ā€œktsā€ I hit this one: https://github.com/gradle/gradle/issues/21492
This is just a little bit messed up… šŸ˜•
v
Oh, never seen that one yet actually. Regarding triggering the download manually, I doubt it. I thin this happens during getting the dependencies for the kts within Gradle or something like that. I forgot the gory details from when I had a look at it.
t
maybe you could write an intellij plugin that does it somehow šŸ˜„
v
You could also have some check whether you are in a Gradle sync and then download the sources or similar, but I don't think that makes much sense either.
j
I could probably download the sources manually, but I think I’ll still have trouble to link the correctly in IntelliJ. Because gradleApi() is this generated Jar and not the ā€œreal thingā€. I think I tried in the past and it did not work. But I should give it another try. Anyway, I have to research if there is an issue for this somewhere. Should work with Groovy DSL as smoothly as it works with Kotlin DSL.
āž• 2
v
d
If you use any of those Gradle API (https://mvnrepository.com/artifact/dev.gradleplugins/gradle-api) the source will always download properly because they are just normal artifacts. On the plus side, you can build against a different Gradle than the one used for building the project. With Gradle 7.x there are some minor issue when using some internal API, most notably
ProjectInternal#evaluate()
in a unit test but it works great. Note that you should use
compileOnly
or
compileOnlyApi
given the library should run in an environment where the Gradle runtime is provided.
ā¤ļø 1
šŸ‘ 1