-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathbuild.gradle
More file actions
110 lines (88 loc) · 2.81 KB
/
build.gradle
File metadata and controls
110 lines (88 loc) · 2.81 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
buildscript {
dependencies {
classpath 'org.fusesource.jansi:jansi:2.4.0'
classpath localGroovy()
}
}
plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'maven-publish'
id 'idea'
id 'jacoco'
id 'com.gradle.plugin-publish' version '1.2.1'
}
def thisPlugin =
new GroovyScriptEngine(file('src/main/groovy').absolutePath, this.class.classLoader)
.loadScriptByName('com/adarshr/gradle/testlogger/TestLoggerPlugin.groovy')
apply from: 'gradle/publishing.gradle'
apply from: 'gradle/coverage.gradle'
apply plugin: thisPlugin
sourceSets {
functionalTest {
groovy {
srcDir 'src/test-functional/groovy'
compileClasspath += sourceSets.main.output
runtimeClasspath += sourceSets.main.output
}
}
}
dependencies {
compileOnly gradleApi()
compileOnly localGroovy()
implementation 'org.fusesource.jansi:jansi:2.4.0'
testImplementation gradleTestKit()
testImplementation 'org.spockframework:spock-core:2.4-M6-groovy-4.0'
testImplementation 'net.bytebuddy:byte-buddy:1.14.9'
testImplementation 'org.objenesis:objenesis:3.3'
testImplementation 'commons-io:commons-io:2.14.0'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
functionalTestImplementation gradleTestKit()
functionalTestImplementation 'org.spockframework:spock-core:2.4-M6-groovy-4.0'
functionalTestImplementation 'commons-io:commons-io:2.14.0'
functionalTestRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
java {
toolchain.languageVersion = JavaLanguageVersion.of(17)
}
gradlePlugin {
plugins {
testLoggerPlugin {
id = 'com.adarshr.test-logger'
implementationClass = 'com.adarshr.gradle.testlogger.TestLoggerPlugin'
}
}
}
idea {
module {
testSources.from(file('src/test-functional/groovy'))
}
}
tasks.named("test", Test) {
useJUnitPlatform()
testClassesDirs += sourceSets.functionalTest.output.classesDirs
classpath += sourceSets.functionalTest.runtimeClasspath
systemProperty 'file.encoding', 'UTF-8'
testlogger {
theme 'mocha'
}
exclude 'com/adarshr/gradle/testlogger/functional/**'
}
tasks.register("functionalTest", Test) {
dependsOn 'pluginUnderTestMetadata', 'testClasses'
useJUnitPlatform()
inputs.dir "$projectDir/src/test-functional/resources"
maxParallelForks = 2
testClassesDirs = sourceSets.functionalTest.output.classesDirs
classpath = sourceSets.test.runtimeClasspath + sourceSets.functionalTest.runtimeClasspath
systemProperty 'file.encoding', 'UTF-8'
minHeapSize '128m'
maxHeapSize '512m'
testlogger {
theme 'mocha-parallel'
}
include 'com/adarshr/gradle/testlogger/functional/**'
}
tasks.named("check") {
dependsOn("functionalTest")
}