Skip to content
This repository was archived by the owner on Aug 19, 2020. It is now read-only.
This repository was archived by the owner on Aug 19, 2020. It is now read-only.

Support excluding transitive dependencies in the dependencies DSL #107

@bamboo

Description

@bamboo

And configuring additional dependency properties in a statically-typed/IDE friendly way:

        dependencies {

            default(group = "org.gradle", name = "foo", version = "1.0") {
                isForce = true
            }

            compile(group = "org.gradle", name = "bar") {
                exclude(module = "foo")
            }

            runtime("org.gradle:baz:1.0-SNAPSHOT") {
                isChanging = true
                isTransitive = false
            }

            testCompile(group = "junit", name = "junit")

            testRuntime(project(path = ":core")) {
                exclude(group = "org.gradle")
            }
        }

The current workaround is to cast the returned dependency to ModuleDependency and call exclude(Map<String, String>) which is not very convenient:

(compile("module-with-transitive-dependencies") as ModuleDependency).apply {
    exclude(mapOf("module" to "excluded-module"))
}

See the relevant section in the user guide.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions