-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
145 lines (119 loc) · 3.69 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
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
137
138
139
140
141
142
143
144
145
plugins {
id 'java'
id 'java-library'
id 'signing'
id 'maven-publish'
id "com.github.johnrengelman.shadow" version "8.1.1"
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
id 'jacoco'
id 'jacoco-report-aggregation'
}
group = 'dev.mayuna'
version = '1.0.1'
repositories {
mavenCentral()
}
dependencies {
// Jetbrains Annotations
implementation 'org.jetbrains:annotations:24.0.0'
// Lombok
compileOnly 'org.projectlombok:lombok:1.18.+'
annotationProcessor 'org.projectlombok:lombok:1.18.+'
testCompileOnly 'org.projectlombok:lombok:1.18.+'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.+'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
// Java 8
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
tasks.jacocoTestReport {
reports {
csv.required = true
}
}
// == Quick tasks == //
task publishCloseAndRelease() {
dependsOn 'publishToSonatype'
dependsOn 'closeAndReleaseSonatypeStagingRepository'
}
shadowJar {
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
// == Maven publishing == //
publishing {
publications {
shadow(MavenPublication) {
groupId = 'dev.mayuna'
artifactId = 'console-parallax'
version = getVersion()
from components.java
pom {
name = 'console-parallax'
description = 'A simple Java library handling console input and treating it as a CLI'
url = 'https://github.com/lilmayu/console-parallax'
scm {
connection = 'scm:https://github.com/lilmayu/console-parallax'
developerConnection = 'scm:git:https://github.com/lilmayu/console-parallax.git'
url = 'https://github.com/lilmayu/console-parallax'
}
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/license/MIT'
}
}
developers {
developer {
id = 'mayuna'
name = 'Marek Lof'
email = '[email protected]'
}
}
}
}
}
publishing {
repositories {
maven {
credentials {
username = project.properties['ossrhUsername'] ?: System.getenv('ossrhUsername')
password = project.properties['ossrhPassword'] ?: System.getenv('ossrhPassword')
}
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
}
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.shadow
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = project.properties['ossrhUsername'] ?: System.getenv('ossrhUsername')
password = project.properties['ossrhPassword'] ?: System.getenv('ossrhPassword')
}
}
}
java {
withJavadocJar()
withSourcesJar()
}
shadowJar.dependsOn javadocJar
shadowJar.dependsOn sourcesJar
shadowJar.dependsOn jar
components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElements) {
skip()
}