// tag::use-plugin[]
plugins {
    id 'idea'
}
// end::use-plugin[]

// tag::module-before-merged[]
idea.module.iml {
    beforeMerged { module ->
        module.dependencies.clear()
    }
}
// end::module-before-merged[]

// tag::project-before-merged[]
idea.project.ipr {
    beforeMerged { project ->
        project.modulePaths.clear()
    }
}
// end::project-before-merged[]


// tag::module-when-merged[]
idea.module.iml {
    whenMerged { module ->
        module.dependencies*.exported = true
    }
}
// end::module-when-merged[]

// tag::project-with-xml[]
idea.project.ipr {
    withXml { provider ->
        provider.node.component
                .find { it.@name == 'VcsDirectoryMappings' }
                .mapping.@vcs = 'Git'
    }
}
// end::project-with-xml[]
