forked from ben-manes/gradle-versions-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
71 lines (61 loc) · 1.76 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
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false
id 'org.jetbrains.dokka' version '1.8.10' apply false
id 'org.jlleitschuh.gradle.ktlint' version '12.1.0' apply false
id 'java-gradle-plugin'
id 'java-library'
id 'groovy'
}
subprojects {
repositories {
mavenCentral()
}
tasks.withType(Jar).configureEach {
manifest {
attributes(
'Implementation-Title': POM_NAME,
'Implementation-Version': VERSION_NAME,
'Built-By': System.getProperty('user.name'),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion)
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
}
tasks.withType(JavaCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
configure(options) {
compilerArgs << '-Xlint:all'
compilerArgs << '-Xlint:-options'
encoding = 'utf-8'
fork = true
}
}
tasks.withType(GroovyCompile).configureEach {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
configure(options) {
compilerArgs << '-Xlint:all'
compilerArgs << '-Xlint:-options'
encoding = 'utf-8'
fork = true
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
testLogging {
exceptionFormat 'full'
showCauses true
showExceptions true
showStackTraces true
showStandardStreams true
events 'passed', 'failed', 'skipped'
}
def maxWorkerCount = gradle.startParameter.maxWorkerCount
maxParallelForks = (maxWorkerCount < 2) ? 1 : maxWorkerCount / 2
}
}