Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider supporting assignment overload for ConfigurableFileCollection #23546

Closed
lptr opened this issue Jan 16, 2023 · 2 comments · Fixed by #23653
Closed

Consider supporting assignment overload for ConfigurableFileCollection #23546

lptr opened this issue Jan 16, 2023 · 2 comments · Fixed by #23653
Assignees
Milestone

Comments

@lptr
Copy link
Member

lptr commented Jan 16, 2023

Let's check out if it works already with Groovy. Even if we don't support FileCollection = [File], we could consider adding it.

Let's consider supporting += in Kotlin as well. Groovy already supports FileCollection += FileCollection.


cc: @gradle/bt-execution

@lptr lptr changed the title Consider supporting Kotlin assingment overload for ConfigurableFileCollection Consider supporting assignment overload for ConfigurableFileCollection Jan 16, 2023
@asodja
Copy link
Member

asodja commented Jan 16, 2023

Note that Groovy doesn't support ConfigurableFileCollection = FileCollection or ConfigurableFileCollection += FileCollection. It throws:

Caused by: groovy.lang.GroovyRuntimeException: Cannot set the value of read-only property 'col' for task ':app2:myTask' of type MyTask.
        at org.gradle.internal.metaobject.AbstractDynamicObject.setReadOnlyProperty(AbstractDynamicObject.java:134)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.setProperty(BeanDynamicObject.java:372)
        at org.gradle.internal.metaobject.BeanDynamicObject.trySetProperty(BeanDynamicObject.java:181)
        at org.gradle.internal.metaobject.CompositeDynamicObject.trySetProperty(CompositeDynamicObject.java:66)
        at org.gradle.internal.metaobject.AbstractDynamicObject.setProperty(AbstractDynamicObject.java:74)
        at MyTask_Decorated.setProperty(Unknown Source)

@asodja
Copy link
Member

asodja commented Jan 25, 2023

Note: for += there is a different issue now: #23637. This will be tackled later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants