|
@@ -0,0 +1,26 @@
|
|
1
|
+gradle.projectsEvaluated {
|
|
2
|
+ def projectMap = [:]
|
|
3
|
+ allprojects.each { p -> projectMap[p.name] = p }
|
|
4
|
+
|
|
5
|
+ allprojects.each { p ->
|
|
6
|
+ def replace = []
|
|
7
|
+
|
|
8
|
+ p.configurations.each { conf ->
|
|
9
|
+ conf.dependencies.each { dep ->
|
|
10
|
+ if (dep.group == 'com.dmdirc' && dep.version == '+' && projectMap[dep.name] != null) {
|
|
11
|
+ replace += [conf: conf.name, dep: dep]
|
|
12
|
+ }
|
|
13
|
+ }
|
|
14
|
+ }
|
|
15
|
+
|
|
16
|
+ replace.each { rep ->
|
|
17
|
+ logger.info("Replacing ${p.name}'s dependency on $rep.dep.name with project reference")
|
|
18
|
+ p.configurations.all*.exclude(group: 'com.dmdirc', module: rep.dep.name)
|
|
19
|
+ rep.dep.properties.excludeRules.each { ex ->
|
|
20
|
+ p.configurations.all*.exclude(group: ex.group, module: ex.module)
|
|
21
|
+ }
|
|
22
|
+ p.dependencies.add(rep.conf, projectMap[rep.dep.name])
|
|
23
|
+ }
|
|
24
|
+ }
|
|
25
|
+}
|
|
26
|
+
|