-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
98 lines (78 loc) · 1.9 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
import java.nio.charset.StandardCharsets
plugins {
id 'java'
id 'java-library'
id 'idea'
id 'eclipse'
// Publishing
id 'com.vanniktech.maven.publish' version '0.29.0'
// Utility
id 'jacoco'
id 'org.sonarqube' version '6.0.1.5171'
id 'com.diffplug.spotless' version '6.25.0'
}
// Project properties
group = "$GROUP"
version = "$VERSION_NAME"
description = "$POM_DESCRIPTION"
// Source code properties
java {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
compileJava.options.encoding = 'UTF-8'
}
// Enable Spotless code formatting rules
spotless {
java {
googleJavaFormat()
}
lineEndings = 'UNIX'
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
}
task sourceJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
artifacts {
archives jar
archives javadocJar
archives sourceJar
}
// Configure several tasks additionally for Gradle
tasks.withType(Copy).configureEach {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
tasks.withType(JavaCompile).configureEach {
options.encoding = StandardCharsets.UTF_8.name()
dependsOn(spotlessJavaCheck)
}
test {
useJUnitPlatform()
// Report is always generated after tests run
finalizedBy jacocoTestReport
}
jacocoTestReport {
// Tests are required to run before generating the report
dependsOn test
reports {
html.required = true
xml.required = true
csv.required = false
}
}
sonar {
properties {
property "sonar.projectKey", "SuppieRK_java-throwable-utils"
property "sonar.organization", "suppierk"
property "sonar.host.url", "https://sonarcloud.io"
}
}