/
build.gradle
38 lines (34 loc) · 1.01 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
plugins {
id 'myproject.java-library-conventions'
}
// tag::dependencies[]
dependencies {
implementation project(':lib')
}
// end::dependencies[]
// tag::substitution_rule[]
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(platform(module('com.google.guava:guava:28.2-jre'))).
using module('com.google.guava:guava:28.2-jre')
}
}
// end::substitution_rule[]
// tag::substitution_rule_alternative[]
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute variant(module('com.google.guava:guava:28.2-jre')) {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.REGULAR_PLATFORM))
}
} using module('com.google.guava:guava:28.2-jre')
}
}
// end::substitution_rule_alternative[]
tasks.register('resolve') {
FileCollection classpath = configurations.runtimeClasspath
inputs.files(classpath)
doLast {
println classpath.files.name
}
}