-
Notifications
You must be signed in to change notification settings - Fork 434
Fix missing parameter names in Gradle Kotlin DSL jars #1004
Conversation
Signed-off-by: Paul Merlin <[email protected]>
Signed-off-by: Paul Merlin <[email protected]>
Signed-off-by: Paul Merlin <[email protected]>
and use that to build `gradle/kotlin-dsl` artifacts Signed-off-by: Paul Merlin <[email protected]>
Signed-off-by: Paul Merlin <[email protected]>
Signed-off-by: Paul Merlin <[email protected]>
With the added artifact transform, the size of snapshoting caches went up, hitting the previous conservative limit of 256m. Signed-off-by: Paul Merlin <[email protected]>
by removing duplicated code and leveraging transform parameters to simplify locating the api metadata jar Signed-off-by: Paul Merlin <[email protected]>
- rename method for clarity - extract explaining methods - tighten members visibility Signed-off-by: Paul Merlin <[email protected]>
0 should be fine Signed-off-by: Paul Merlin <[email protected]>
@@ -46,6 +46,8 @@ annotation class KotlinScriptTemplate | |||
resolver = KotlinBuildScriptDependenciesResolver::class, | |||
scriptFilePattern = ".*\\.gradle\\.kts") | |||
@ScriptTemplateAdditionalCompilerArguments([ | |||
"-java-parameters", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❓ I don't understand why the new compiler options are also required in the script templates. I understood -Xuse-old-class-files-reading
was required to get the compiler to load parameter names from the transformed Gradle api jar and -java-parameters
was about preserving parameter names in the emitted class files, none of which seem to apply to the scripts, what am I missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I've been overzealous. We don't need those for script compilation. And we don't need -Xuse-old-class-files-reading
on the kotlin-dsl
plugin.
and from IDE script templates Signed-off-by: Paul Merlin <[email protected]>
…lation and from IDE script templates and from kotlin-dsl plugin Signed-off-by: Paul Merlin <[email protected]>
Functions on types using kotlin implementation by delegation for a Java interface miss parameter names metadata.
See #464
Reusing the
gradle-api-metadata
, anArtifactTransform
hydrates the Gradle API bytecode provided bygradleApi()
with Java 8 parameter names. The Gradle Kotlin DSL is compiled against the transformed Gradle API disabling the kotlin compiler fast class reader. This combination lets the parameter names show up properly in the IDE instead ofp0
,p1
...