Hi everyone, I’m trying to define a custom `Config...
# community-support
e
Hi everyone, I’m trying to define a custom
Configuration
and collect some meta data from those dependencies that are added with it (must be Android AAR package). for example:
Copy code
val caliperDependenciesConfiguration = project.configurations.maybeCreate("caliper").apply {
    description = "..."
}

project.tasks.named("preBuild").configure {
            doLast {
                logger.lifecycle("preBuild doLast!")
                val attributesAction =
                    Action<AttributeContainer> {
                        attribute(AndroidArtifacts.ARTIFACT_TYPE, "android-java-res")
                    }
                val size = caliperDependenciesConfiguration.incoming
                    .artifactView {
                        this.lenient(true)
                        attributes(attributesAction)
                    }
                    .artifacts
                    .artifactFiles
                    .files
                    .size
                logger.lifecycle("preBuild $size")
            }
        }
However it does not work as expected, any ideas about what’s wrong with above code snippet? Or at least how does it work in Java projects to collect dependencies data? Much thanks!