forked from junit-team/junit5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjunit-jupiter-params.gradle
84 lines (71 loc) · 2.29 KB
/
junit-jupiter-params.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
apply plugin: 'org.junit.platform.gradle.plugin'
apply plugin: 'com.github.johnrengelman.shadow'
description = 'JUnit Jupiter Params'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath("com.github.jengelman.gradle.plugins:shadow:${shadowVersion}")
}
}
junitPlatform {
filters {
engines {
include 'junit-jupiter'
}
includeClassNamePattern '.*Tests?'
}
logManager 'org.apache.logging.log4j.jul.LogManager'
}
afterEvaluate {
// Use classes modified by shadow plugin for test execution so JaCoCo
// finds same class files when creating its report
junitPlatformTest.classpath -= sourceSets.main.output
junitPlatformTest.classpath += files(shadowJar.archivePath)
junitPlatformTest.dependsOn(shadowJar)
}
dependencies {
api(project(':junit-jupiter-api'))
shadowed('com.univocity:univocity-parsers:2.6.3')
testImplementation("org.assertj:assertj-core:${assertJVersion}")
testImplementation("org.mockito:mockito-core:${mockitoVersion}")
testImplementation(project(path: ':junit-platform-engine', configuration: 'testArtifacts'))
testImplementation(project(':junit-jupiter-engine'))
testImplementation(project(':junit-platform-launcher'))
testImplementation(project(':junit-platform-runner'))
// Include junit-platform-console so that the JUnit Gradle plugin
// uses the local version of the ConsoleLauncher.
testRuntimeOnly(project(':junit-platform-console'))
testRuntimeOnly("org.apache.logging.log4j:log4j-core:${log4jVersion}")
testRuntimeOnly("org.apache.logging.log4j:log4j-jul:${log4jVersion}")
compileOnly("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}")
}
jar.enabled = false
jar.dependsOn shadowJar
jar {
manifest {
attributes(
'Automatic-Module-Name': 'org.junit.jupiter.params'
)
}
}
shadowJar {
// Generate shadow jar only if the underlying manifest was regenerated.
// See https://github.com/junit-team/junit5/issues/631
onlyIf {
(project.generateManifest || !shadowJar.archivePath.exists())
}
classifier = null
configurations = [project.configurations.shadowed]
exclude 'META-INF/**'
relocate 'com.univocity', 'org.junit.jupiter.params.shadow.com.univocity'
from(projectDir) {
include 'LICENSE-univocity-parsers.md'
into 'META-INF'
}
}
artifacts {
archives shadowJar
}