Closed gildor closed 5 years ago
Thanks for the report @gildor,
This sample has three builds:
samples/precompiled-script-plugin
which is just a bunch of GradleBuild
tasks that runs the other two buildssamples/precompiled-script-plugin/plugin
which builds the precompiled script pluginsamples/precompiled-script-plugin/consumer
which builds a consumer of the pluginWhen you open samples/precompiled-script-plugin
in IDEA, the IDE doesn't know about the other two builds. That's why plugin/src/main/kotlin
isn't exposed as a Kotlin source set to the IDE. You can open each build separately.
This setup could be changed to use composite builds in order to allow the IDE to have the context for all three builds.
As for your second observation that type-safe accessors should have syntax highlighting and navigation, yes, but support landed in Gradle 5.3, it can't work with Gradle 5.2.1. We missed to update the master
branch with Gradle 5.3 wrappers. See https://github.com/gradle/kotlin-dsl/pull/1377 that will update them to 5.4.
@eskatos Sorry, I tried with 5.4, in my report I accidentally wrote 5.0 insted of 5.4, I will try again
I see now, all 3 plugins are not related, each of them is own plugin, I just now realized this, it was just a bit confusing because looked as standard multi-module gradle project
So the issue should be closed, thanks!
Thanks @gildor! Closing
precompiled-script-plugin sample is not properly imported in IDEA. If you open this sample in IDEA 2019.1, you will see that
plugins
src/main
is not marked as source set in IDE, even worse, that also static accessors are not resolve by IDE, but work if you run plugin taskExpected Behavior
plugin/src/main/kotlin should be marked as source set. Typesafe accessors should have syntax highlighting and navigation
Current Behavior
src is not source set, no IDE support for any type-safe accessor
Steps to Reproduce (for bugs)
Checkout https://github.com/gradle/kotlin-dsl Open samples/precompiled-script-plugin in IDEA Add plugins block to my-plugin.gradle.kts apply plugin
java
try to use tasks.jar accessor orjava
extensionYour Environment
Gradle 5.2.1, same with Gradle 5.0 IDEA 2019.1.1