Allow Matrix tests to select single artifact in a group
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2014-2018 the original author or authors.
|
* Copyright 2014-2019 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@@ -43,7 +43,7 @@ public class MatrixTestExtension {
|
|||||||
void configureTestTasks(Project project) {
|
void configureTestTasks(Project project) {
|
||||||
if (!entries.empty) {
|
if (!entries.empty) {
|
||||||
cartesianProduct(entries.collect { entry ->
|
cartesianProduct(entries.collect { entry ->
|
||||||
entry.versions.collect { ['group': entry.group, 'version': it] }
|
entry.versions.collect { ['group': entry.group, 'artifact': entry.artifact, 'version': it] }
|
||||||
}).forEach { configureTestTask(project, it) }
|
}).forEach { configureTestTask(project, it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,6 +64,7 @@ public class MatrixTestExtension {
|
|||||||
resolutionStrategy.eachDependency { dependency ->
|
resolutionStrategy.eachDependency { dependency ->
|
||||||
versionSelectors
|
versionSelectors
|
||||||
.findAll{ it.group == dependency.requested.group }
|
.findAll{ it.group == dependency.requested.group }
|
||||||
|
.findAll { !it.artifact || it.artifact == dependency.requested.name }
|
||||||
.each { dependency.useVersion it.version }
|
.each { dependency.useVersion it.version }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,6 +99,8 @@ public class MatrixTestExtension {
|
|||||||
|
|
||||||
String group
|
String group
|
||||||
|
|
||||||
|
String artifact
|
||||||
|
|
||||||
List<String> versions
|
List<String> versions
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user