-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
99 lines (80 loc) · 1.95 KB
/
build.gradle
File metadata and controls
99 lines (80 loc) · 1.95 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
import java.nio.charset.StandardCharsets
plugins {
id 'java'
id 'java-library'
id 'idea'
id 'eclipse'
// Publishing
id 'com.vanniktech.maven.publish' version '0.36.0'
// Utility
id 'jacoco'
id 'org.sonarqube' version '7.2.3.7755'
id 'com.diffplug.spotless' version '7.0.4'
}
// 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()
}
}
repositories {
mavenCentral()
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.14.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
tasks.register('sourceJar', Jar) {
dependsOn classes
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
tasks.register('javadocJar', 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"
}
}