-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
61 lines (52 loc) · 1.53 KB
/
build.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import java.nio.file.Paths
plugins {
id 'java'
}
group 'kzaikin'
version '1.0-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
ext.smellRoot = new File('src/test/java')
task('assembleReadme') {
new File("smells.md").withWriter { w ->
readSmells(smellRoot, { s ->
w.writeLine(s)
})
}
}
/**
* Output as this
* ## structure
* - [many_tests_in_one](src/test/java/structure/many_tests_in_one): Много тестов в одном тестовом методе
*/
private void readSmells(File dir, action) {
dir.listFiles().each { file ->
if (file.isDirectory()) {
if (!(smellRoot.toPath() <=> Paths.get(file.parent))) {
action("### $file.name")
}
readSmells(file, action)
} else {
if (file.name == 'README.md') {
file.withReader {
def matcher = it.readLine() =~ /[ #]*(.*)/
if (matcher.find()) {
def title = matcher.group(1)
action("- [$dir.name]($dir): $title")
}
}
}
}
}
}
dependencies {
testCompile 'com.google.dagger:dagger:2.16'
testCompile 'com.google.guava:guava:25.1-jre'
testCompile 'junit:junit:4.12'
compile 'org.hamcrest:hamcrest-all:1.3'
testCompile 'org.mockito:mockito-inline:2.18.3'
testCompile 'org.robolectric:robolectric:3.7.1'
testCompile 'org.robolectric:android-all:8.0.0_r4-robolectric-0'
}