-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
136 lines (118 loc) · 4.19 KB
/
Copy pathbuild.gradle
File metadata and controls
136 lines (118 loc) · 4.19 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
plugins {
id 'java'
id 'jacoco'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
}
group = 'io.github.andrei-punko'
version = '1.0.5-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
compileOnly "org.projectlombok:lombok:$lombokVersion"
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
testImplementation platform('org.junit:junit-bom:6.0.3')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testImplementation 'org.assertj:assertj-core:3.27.7'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed",
// "standardOut", // Uncomment to get all logs during tests execution
"standardError"
}
afterSuite { desc, result ->
if (!desc.parent)
println("${result.resultType} " +
"(${result.testCount} tests, " +
"${result.successfulTestCount} successes, " +
"${result.failedTestCount} failures, " +
"${result.skippedTestCount} skipped)")
}
finalizedBy jacocoTestReport // report is always generated after tests run
jacoco {
destinationFile = layout.buildDirectory.file('jacoco/jacocoTest.exec').get().asFile
classDumpDir = layout.buildDirectory.dir('jacoco/classpathdumps').get().asFile
}
}
jacocoTestReport {
reports {
csv.required = true
xml.required = true
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
// Enable JavaDoc and Sources JAR generation
withJavadocJar()
withSourcesJar()
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username.set(project.findProperty("ossrhUsername")?.toString())
password.set(project.findProperty("ossrhPassword")?.toString())
}
}
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/andrei-punko/pde-solvers")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("TOKEN")
}
}
}
publications {
mavenJava(MavenPublication) {
from(components.java)
groupId = project.group
artifactId = project.name
version = project.version
pom {
name = 'PDE Solvers'
description = 'A Java library for solving partial differential equations (PDE) using finite difference method and Thomas algorithm'
url = 'https://andrei-punko.github.io/pde-solvers'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'andrei-punko'
name = 'Andrei Punko'
email = 'andd3dfx@gmail.com'
}
}
scm {
connection = 'scm:git:git://github.com/andrei-punko/pde-solvers.git'
developerConnection = 'scm:git:ssh://git@github.com/andrei-punko/pde-solvers.git'
url = 'https://github.com/andrei-punko/pde-solvers'
}
}
}
gpr(MavenPublication) {
from(components.java)
}
}
}
signing {
sign publishing.publications.mavenJava
}
afterEvaluate {
tasks.named('publishGprPublicationToSonatypeRepository').configure { enabled = false }
}