I am trying to create a copy of configuration that extends another copied configuration, and I have noticed that getFiles() returns only non-inherited artifacts:
def conf = configurations.runtime.copy()
conf.extendsFrom configurations.compile.copy()
// conf.files returns only artifacts defined in runtime configuration
// conf.allDependencies but shows dependencies defined in compile and runtime configuration
however, configurations.runtime.copyRecursive() works, but this is not an option for me, because in my case compile configuration extends from some other configurations, and I would not like to have artifacts defined there, i.e. I would like to create a configuration that contains artifacts defined in runtime + compile configurations only, respecting all configuration exclude rules.
The method does exactly what the documentation says: Creates a copy of this configuration that only contains the dependencies directly in this configuration (without contributions from superconfigurations).
Yes, but after creating the configuration, I have said that it extends from another configuration. Thus, if I understand well, I should get with getFiles() all files, contained in the configuration and the inherited one. Exactly like in runtime configuration - I get all files.