-
Notifications
You must be signed in to change notification settings - Fork 0
/
level_metadata.gradle
40 lines (35 loc) · 980 Bytes
/
level_metadata.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
39
40
final groupName = 'Testability Koans'
task hint() {
group = groupName
description = 'Gives a hint about the solution.'
} << {
println 'This is an example of a working test.'
}
task levels() {
group = groupName
description = 'List all available levels.'
} << {
Process process = 'git branch'.execute()
println process.in.text
}
task level () {
group = groupName
description = 'Start a new level. Usage: ./gradlew level -PlevelName=newCollaborator'
} << {
String levels = 'git branch'.execute().in.text
String command
if (levels.contains("solving_${levelName}")) {
command = "git checkout solving_${levelName}"
} else {
command = "git checkout -b solving_${levelName} ${levelName}^"
}
println command
Process process = command.execute()
println process.in.text
}
task solve(dependsOn: 'test') {
group = groupName
description = 'Solve the current level.'
} << {
println 'Solved!'
}