You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 19, 2020. It is now read-only.
(The branch is called "crashing-example" because before I updated my IJ kotlin plugin, IJ was hanging requiring a restart because of this issue.)
This is the extension I have declared:
openclassJLinkExtension
@Inject
internalconstructor(
project:Project
) {
val configure:NamedDomainObjectContainer<JLinkOptions> = project.container(JLinkOptions::class.java) { name ->JLinkOptions(name = name)
}
}
This is the usage of said extension (found at samples/simple-jar/build.gradle.kts in the above repo)
jlink {
configure {
}
}
It seems that configure is resolving to the wrong overload in Gradle.
It's not using the NamedDomainObjectContainer.invoke method but is instead calling Project.configure.
Your Environment
------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------
Build time: 2018-09-19 18:10:15 UTC
Revision: b4d8d5d170bb4ba516e88d7fe5647e2323d791dd
Kotlin DSL: 1.0-rc-6
Kotlin: 1.2.61
Groovy: 2.4.15
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 10.0.1 ("Oracle Corporation" 10.0.1+10)
OS: Mac OS X 10.14 x86_64
The text was updated successfully, but these errors were encountered:
JLLeitschuh
changed the title
Invoke method is not called when NamedDomainObjectContainer is on field named configure
Invoke method is not called when NamedDomainObjectContainer is a field named configure
Oct 12, 2018
The type of your configure val should be NamedDomainObjectContainer instead of NamedDomainObjectCollection.
But, you're right, the kotlin compiler resolves configure {} to the closest available function which is Project.configure {} missing the invoke operator present on your val configure. This looks like a bug.
A workaround is to put parentheses around configure to explicitely resolve the val first:
eskatos
changed the title
Invoke method is not called when NamedDomainObjectContainer is a field named configure
KT-28013 - Invoke method is not called when NamedDomainObjectContainer is a field named configure
Nov 5, 2018
This example can be found here at the provided branch:
https://github.com/GradleWeaver/simple-jlink/tree/crashing-example
(The branch is called "crashing-example" because before I updated my IJ kotlin plugin, IJ was hanging requiring a restart because of this issue.)
This is the extension I have declared:
This is the usage of said extension (found at
samples/simple-jar/build.gradle.kts
in the above repo)It seems that
configure
is resolving to the wrong overload in Gradle.It's not using the
NamedDomainObjectContainer.invoke
method but is instead callingProject.configure
.Your Environment
The text was updated successfully, but these errors were encountered: