In the end of December I was struggling to integrate the Nexus IQ scan with my Android project and could not find much info on that. After 3-4 days of going through documentation of Gradle, looking at the topic here How to scan Android for Vulnerabilities? and intense Groovy regexp session I have managed to correct the implementation of copyDependencies method that was described in the old topic.
This experience was quite brutal and I would like to share back to the community the results of my work so that the next people who come around don’t struggle so much and have a better position.