Anyone have a better way of doing these tasks? Rules maybe?


(Phil Swenson) #1

To split tasks out for Jenkins jobs we have many tasks segmented by name. Here is partial list. Any suggestions on a better technique?

Thanks!

task itestMonitor(type: Test){
    include "**/monitor/*IntegrationTest.*"
}
task itestProcess1(type: Test){
    include "**/process/A*IntegrationTest.*"
    include "**/process/B*IntegrationTest.*"
}
task itestProcess2(type: Test){
    include "**/process/C*IntegrationTest.*"
    include "**/process/D*IntegrationTest.*"
}
task itestProcess3(type: Test){
    include "**/process/E*IntegrationTest.*"
    include "**/process/F*IntegrationTest.*"
    include "**/process/G*IntegrationTest.*"
    include "**/process/H*IntegrationTest.*"
    include "**/process/I*IntegrationTest.*"
    include "**/process/J*IntegrationTest.*"
    include "**/process/K*IntegrationTest.*"
    include "**/process/L*IntegrationTest.*"
    include "**/process/M*IntegrationTest.*"
}

(Peter Niederwieser) #2

It’s hard to say without knowing what exactly you are after. One solution might be to store the information in a map, loop over it, and create the tasks and include statements dynamically. A task rule would be similar in that you’d have to somewhere store the mapping between tasks and includes.