Check transitivity of DefaultIvyDependency

(dinio.dinev) #1

I have spock test

import org.gradle.api.publish.ivy.internal.dependency.DefaultIvyDependency
PublishingExtension publishing
publishing = project.extensions.getByType(PublishingExtension)
IvyPublication publication = publishing.publications.ivy
publication.dependencies.all {DefaultIvyDependency dep->
            ModuleDependency mdlDependency = dep.getModuleDependency()
            assert !mdlDependency.transitive
            assert "${}:${}:${mdlDependency.version}"==DEPENDENCY_NAME

In the new version 1.7 of Gradle the the implementation of DefaultIvyDependency class is changed and I can’t get getModuleDependency() and to check if the dependency is transitive. I want to ask how can I check that?