Skip to content

Commit aee49b8

Browse files
committed
Allow Matrix tests to select single artifact in a group
1 parent 6da597b commit aee49b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

buildSrc/src/main/groovy/org/springframework/restdocs/build/matrix/MatrixTestExtension.groovy

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2014-2018 the original author or authors.
2+
* Copyright 2014-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -43,7 +43,7 @@ public class MatrixTestExtension {
4343
void configureTestTasks(Project project) {
4444
if (!entries.empty) {
4545
cartesianProduct(entries.collect { entry ->
46-
entry.versions.collect { ['group': entry.group, 'version': it] }
46+
entry.versions.collect { ['group': entry.group, 'artifact': entry.artifact, 'version': it] }
4747
}).forEach { configureTestTask(project, it) }
4848
}
4949
}
@@ -64,6 +64,7 @@ public class MatrixTestExtension {
6464
resolutionStrategy.eachDependency { dependency ->
6565
versionSelectors
6666
.findAll{ it.group == dependency.requested.group }
67+
.findAll { !it.artifact || it.artifact == dependency.requested.name }
6768
.each { dependency.useVersion it.version }
6869
}
6970
}
@@ -98,6 +99,8 @@ public class MatrixTestExtension {
9899

99100
String group
100101

102+
String artifact
103+
101104
List<String> versions
102105

103106
}

0 commit comments

Comments
 (0)