-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
177 lines (142 loc) · 4.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
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 '2.2.3'
repositories {
mavenCentral()
maven { url "https://m2.chew.pro/snapshots" }
maven { url "https://s01.oss.sonatype.org/content/repositories/releases" }
flatDir {
dirs 'libs'
}
}
dependencies {
// JDA
implementation 'net.dv8tion:JDA:5.1.2'
// JDA Chewutils
implementation 'pw.chew:jda-chewtils:2.0-SNAPSHOT'
// Personal libraries
implementation 'dev.mayuna:mayus-jda-utilities:3.4.2'
implementation 'dev.mayuna:mayus-library:3.1'
implementation 'dev.mayuna:mayus-json-utilities:2.1'
implementation 'dev.mayuna:pumpk1n:2.2.1'
implementation 'dev.mayuna:console-parallax:1.0.1'
// SLF4J
implementation 'org.apache.logging.log4j:log4j-slf4j2-impl:2.23.1'
implementation 'org.apache.logging.log4j:log4j-api:2.23.1'
implementation 'org.apache.logging.log4j:log4j-core:2.23.1'
// GSON
implementation 'com.google.code.gson:gson:2.11.0'
// SQLite
implementation 'org.xerial:sqlite-jdbc:3.46.0.0'
// HikariCP
implementation 'com.zaxxer:HikariCP:5.1.0'
// MySQL
implementation 'com.mysql:mysql-connector-j:8.4.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.+'
// JUnit
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
// == Quick tasks == //
task publishCloseAndRelease() {
dependsOn 'publishToSonatype'
dependsOn 'closeAndReleaseSonatypeStagingRepository'
}
shadowJar {
archiveFileName = "modular-discord-bot.jar"
manifest {
attributes 'Main-Class': 'dev.mayuna.modularbot.Main'
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
// UTF-8
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
// == Maven publishing == //
publishing {
publications {
shadow(MavenPublication) {
groupId = 'dev.mayuna'
artifactId = 'modular-discord-bot'
version = getVersion()
from components.java
pom {
name = 'ModularDiscordBot'
description = 'Modular Discord Bot'
url = 'https://github.com/lilmayu/ModularDiscordBot'
scm {
connection = 'scm:https://github.com/lilmayu/ModularDiscordBot'
developerConnection = 'scm:git:https://github.com/lilmayu/ModularDiscordBot.git'
url = 'https://github.com/lilmayu/ModularDiscordBot'
}
licenses {
license {
name = 'GNU General Public License v3.0'
url = 'https://www.gnu.org/licenses/gpl-3.0.html'
}
}
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()
}