-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.gradle
133 lines (115 loc) · 4.19 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
plugins {
id 'fabric-loom' version '1.9.2'
id "xyz.jpenilla.run-velocity" version "2.3.1"
id "io.github.goooler.shadow" version "8.1.8"
id 'io.freefair.lombok' version '8.11'
}
def targetJavaVersion = 21
group = project.maven_group
sourceSets {
testMod {
compileClasspath += main.compileClasspath
runtimeClasspath += main.runtimeClasspath
}
}
loom {
runs {
testMod {
server()
ideConfigGenerated project.rootProject == project
name = "TestMod"
source sourceSets.testMod
}
}
}
loom.mods.register("testMod") {
sourceSet sourceSets.testMod
}
repositories {
maven { url "https://maven.quiltmc.org/repository/release" }
maven { url "https://api.modrinth.com/maven" }
maven { url "https://repo.papermc.io/repository/maven-public/" }
maven {
name = "sonatype-oss-snapshots1"
url = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
mavenContent { snapshotsOnly() }
}
}
dependencies {
testModImplementation sourceSets.main.output
// Fabric
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
// Quilt
modCompileOnly "org.quiltmc:quilt-loader:0.27.1"
//Velocity
compileOnly 'com.velocitypowered:velocity-api:3.4.0-SNAPSHOT'
annotationProcessor 'com.velocitypowered:velocity-api:3.4.0-SNAPSHOT'
// Adventure
modImplementation "net.kyori:adventure-platform-fabric:${project.adventure_version}"
// Config
shadow implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-toml:${project.jackson_version}")
// SQL
shadow implementation("com.zaxxer:HikariCP:${project.hikari_version}")
shadow implementation("org.jdbi:jdbi3-core:${project.jdbi_version}")
shadow implementation("org.xerial:sqlite-jdbc:${project.sqlite_version}")
shadow implementation("org.mariadb.jdbc:mariadb-java-client:${project.mariadb_version}")
shadow implementation("org.postgresql:postgresql:${project.postgres_version}")
// Extra
compileOnly "org.projectlombok:lombok:1.18.36"
annotationProcessor "org.projectlombok:lombok:1.18.36"
modImplementation "maven.modrinth:easy-eula:1.1.1-fabric"
}
shadowJar {
archiveBaseName.set('sqlib')
configurations = [project.configurations.shadow]
relocate 'com.fasterxml', 'me.mrnavastar.sqlib.libs.com.fasterxml'
relocate 'com.github', 'me.mrnavastar.sqlib.libs.com.github'
relocate 'com.google.errorprone', 'me.mrnavastar.sqlib.libs.com.google.errorprone'
relocate 'com.zaxxer', 'me.mrnavastar.sqlib.libs.com.zaxxer'
relocate 'io', 'me.mrnavastar.sqlib.libs.io'
relocate 'waffle', 'me.mrnavastar.sqlib.libs.waffle'
relocate 'org.checkerframework', 'me.mrnavastar.sqlib.libs.org.checkerframework'
relocate 'org.jdbi', 'me.mrnavastar.sqlib.libs.org.jdbi'
relocate 'me.mrnavastar.r', 'me.mrnavastar.sqlib.libs.me.mrnavastar.r'
//relocate 'org.sqlite', 'me.mrnavastar.sqlib.libs.org.sqlite'
//relocate 'org.mariadb', 'me.mrnavastar.sqlib.libs.org.mariadb'
//relocate 'org.postgresql', 'me.mrnavastar.sqlib.libs.org.postgresql'
dependencies {
mergeServiceFiles()
exclude(dependency('org.slf4j:.*:.*'))
exclude(dependency('net.java.dev.jna:.*:.*'))
}
}
jar.finalizedBy('shadowJar')
tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"
}
java {
def javaVersion = JavaVersion.toVersion(targetJavaVersion)
if (JavaVersion.current() < javaVersion) {
toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion)
}
archivesBaseName = project.archives_base_name
javadoc.options.addStringOption('Xdoclint:none', '-quiet')
withJavadocJar()
withSourcesJar()
}
sourcesJar {
exclude {
sourceSets.main.allSource.contains it.file
}
from delombok
}
jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}" }
}
}
tasks {
runVelocity {
velocityVersion(project.velocity_version)
}
}