forked from ngraves95/attacktimer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
117 lines (102 loc) · 3.22 KB
/
Copy pathbuild.gradle
File metadata and controls
117 lines (102 loc) · 3.22 KB
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
107
108
109
110
111
112
113
114
115
116
117
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
id 'java'
id 'checkstyle'
}
checkstyle {
toolVersion = "10.26.1"
}
repositories {
// mavenLocal() seems to always break on my PC
// (looking for linux binaries even though I'm on windows):
// Execution failed for task ':test'.
// > Could not resolve all files for configuration ':testRuntimeClasspath'.
// > Could not find lwjgl-opengl-3.3.2-natives-linux-arm64.jar
// (org.lwjgl:lwjgl-opengl:3.3.2).
// Searched in the following locations:
// file:/C:/Users/Lexer/.../lwjgl-opengl-3.3.2-natives-linux-arm64.jar
maven {
url = 'https://repo.runelite.net'
}
mavenCentral()
}
def runeLiteVersion = 'latest.release'
dependencies {
compileOnly group: 'net.runelite', name:'client', version: runeLiteVersion
compileOnly 'org.projectlombok:lombok:1.18.30'
annotationProcessor 'org.projectlombok:lombok:1.18.30'
testImplementation 'junit:junit:4.12'
testImplementation group: 'net.runelite', name:'client', version: runeLiteVersion
testImplementation group: 'net.runelite', name:'jshell', version: runeLiteVersion
testImplementation 'org.mockito:mockito-core:3.1.0'
testImplementation 'com.google.inject.extensions:guice-testlib:4.1.0'
}
java {
targetCompatibility = "1.11"
}
def props = new Properties()
file('runelite-plugin.properties').withInputStream { props.load(it) }
group = 'com.attacktimer'
version = props.getProperty('version')
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
options.release.set(11)
options.compilerArgs += ['-Xlint:deprecation']
}
// Code based on
// https://gist.github.com/lwasyl/6ae0b8a66903729033e18ffc7a503597#file-fancy_logging_original-gradle
tasks.withType(Test) {
// if no `-Pupdate=all` is passed to gradle then we assume none
def update=project.properties['update'] ?: "none"
// allow specific system properties to be forwarded
systemProperty "update", update
outputs.upToDateWhen { false } // always force tests to be re-run
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true
// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
afterSuite { desc, result ->
if (!desc.parent)
{ // will match the outermost suite
def output = "Results: ${result.resultType}"+
" (${result.testCount} tests"+
", ${result.successfulTestCount} successes"+
", ${result.failedTestCount} failures"+
", ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() +
output.length() +
endItem.length()
println(
'\n' +
('-' * repeatLength) +
'\n' +
startItem +
output +
endItem +
'\n' +
('-' * repeatLength)
)
}
}
}
}