This message was deleted.
# community-support
s
This message was deleted.
j
i have used this pattern before and it has worked
e
you should not use that pattern
but the general cause is that classes loaded in separate classloaders are different even if they have the same name
j
ok that make sense...
ok. i am open to a different pattern. my use case is i have a task that aggregates data from files generated in one or more subprojects. so in my plugin, when it is applied to the subproject, it needs to make sure this aggregate task exists on the root project and add its files to the input file collection of that task
do you know of a good pattern for this?
oh actually in this case, its not data in files
it is data set on an Extension in each subproject
e
you'll have to put the data into files to do that…
you could potentially push the information into a build service instead, but you'd still have to deal with classpath
j
ok thanks. im going the intermediate file route
whats the best way to set the lazy file pattern on the root task? do i need a project.fileTree for that?
v
when it is applied to the subproject, it needs to make sure this aggregate task exists on the root project and add its files to the input file collection of that task
do you know of a good pattern for this?
There is none. That is cross-project configuration which is highly discouraged.
You can maybe use
taskGraph.whenReady
to validate whether the plugin is also applied to the root project and error out if it is not, to inform the user he should apply it there if that is really your hard requirement
j
Ok ill think about that. In the meantime i set it up with intermediate files, and as long as i only create it in root, not try to access it, it works
Thank you both