-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.gradle
106 lines (91 loc) · 2.33 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
buildscript {
repositories {
mavenCentral()
}
dependencies {
}
}
plugins {
id 'java'
id 'checkstyle'
id 'application'
id 'idea'
id 'jacoco'
id 'com.github.kt3k.coveralls' version '2.8.2'
id "org.sonarqube" version "2.7"
}
group = 'cn.hjmao.leetcode'
version = '0.0.1-SNAPSHOT'
description = """"""
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile(
['com.squareup.okhttp3:okhttp:3.14.1'],
['org.jsoup:jsoup:1.11.3'],
['org.json:json:20180813'],
['org.slf4j:slf4j-api:1.7.26'],
['org.apache.logging.log4j:log4j-slf4j-impl:2.11.2']
)
testCompile(
['org.testng:testng:6.14.3'],
['org.mockito:mockito-core:2.27.0']
)
}
sourceSets {
main {
runtimeClasspath = files(output.resourcesDir) + runtimeClasspath
}
test {
runtimeClasspath = files(output.resourcesDir) + runtimeClasspath
}
}
compileJava {
options.compilerArgs << '-Xlint:unchecked'
}
checkstyle {
toolVersion = '6.19'
configDir = file("$rootProject.projectDir/config/checkstyle")
}
test {
useTestNG() {
useDefaultListeners = true
}
testLogging {
events "failed" //, "passed", "skipped", "standardOut", "standardError"
afterSuite { desc, result ->
if (!desc.parent) {
println "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)"
}
}
}
}
jacocoTestReport {
reports {
xml.enabled = true
}
afterEvaluate {
// getClassDirectories().setFrom(
classDirectories = files(classDirectories.files.collect {
fileTree(dir: it, excludes: ['**/com/leetcode/**', 'src/main/java/cn/hjmao/ProblemFetcher*'])
})
// )
}
}
coveralls {
jacocoReportPath 'build/reports/jacoco/test/jacocoTestReport.xml'
}
sonarqube {
properties {
property 'sonar.projectKey', 'huajianmao_leetcode'
property 'sonar.organization', 'huajianmao-github'
property 'sonar.host.url', 'https://sonarcloud.io'
property 'sonar.login', '811822b24c24fed7a4ed2cab65db600c7844b1cb'
property 'sonar.exclusions', 'src/main/java/com/leetcode/**/*, src/main/java/cn/hjmao/ProblemFetcher*'
property 'sonar.jacoco.reportPaths', 'build/reports/jacoco/test/jacocoTestReport.xml'
}
}
mainClassName = group + ".Main"