11plugins {
22 id ' java'
3- id ' com.github.johnrengelman. shadow' version ' 7.1.2 '
3+ id ' com.gradleup. shadow' version ' 8.3.6 '
44 id ' io.freefair.lombok' version ' 8.10.2'
5- id ' maven-publish' // for jitpack.io
5+ id ' maven-publish'
66}
77
88group = ' com.github.server-utilities'
@@ -11,83 +11,70 @@ version = '1.0.0'
1111repositories {
1212 mavenCentral()
1313 mavenLocal()
14-
15- // JitPack
1614 maven { url ' https://jitpack.io' }
1715}
1816
19- dependencies {
20- implementation(' com.github.simplix-softworks:simplixstorage:3.2.7' )
21- shadow(' com.github.simplix-softworks:simplixstorage:3.2.7' )
22-
23- implementation(' mysql:mysql-connector-java:8.0.33' )
24- shadow(' mysql:mysql-connector-java:8.0.33' )
25-
26- implementation(' org.xerial:sqlite-jdbc:3.46.1.0' )
27- .exclude(group : ' org.slf4j' , module : ' slf4j-api' )
28- shadow(' org.xerial:sqlite-jdbc:3.46.1.0' )
29- .exclude(group : ' org.slf4j' , module : ' slf4j-api' )
30-
31- implementation(' com.zaxxer:HikariCP:5.1.0' )
32- .exclude(group : ' org.slf4j' , module : ' slf4j-api' )
33- .exclude(group : ' org.apache.logging.log4j' , module : ' log4j-api' )
34- .exclude(group : ' org.apache.logging.log4j' , module : ' log4j-core' )
35- .exclude(group : ' org.apache.logging.log4j' , module : ' log4j-slf4j-impl' )
36- shadow(' com.zaxxer:HikariCP:5.1.0' )
37- .exclude(group : ' org.slf4j' , module : ' slf4j-api' )
38- .exclude(group : ' org.apache.logging.log4j' , module : ' log4j-api' )
39- .exclude(group : ' org.apache.logging.log4j' , module : ' log4j-core' )
40- .exclude(group : ' org.apache.logging.log4j' , module : ' log4j-slf4j-impl' )
41-
42- implementation(' net.objecthunter:exp4j:0.4.8' )
43- shadow(' net.objecthunter:exp4j:0.4.8' )
17+ configurations {
18+ implementation {
19+ exclude group : ' org.slf4j' , module : ' slf4j-api'
20+ exclude group : ' org.apache.logging.log4j'
21+ }
22+ shadow {
23+ exclude group : ' org.slf4j' , module : ' slf4j-api'
24+ exclude group : ' org.apache.logging.log4j'
25+ }
26+ }
4427
45- implementation(' com.google.re2j:re2j:1.7' )
46- shadow(' com.google.re2j:re2j:1.7' )
28+ dependencies {
29+ implementation " me.nobeld:SimplixStorage:3.3.0-beta.3"
30+ implementation ' mysql:mysql-connector-java:8.0.33'
31+ implementation ' org.xerial:sqlite-jdbc:3.46.1.0'
32+ implementation ' com.zaxxer:HikariCP:5.1.0'
33+ implementation ' net.objecthunter:exp4j:0.4.8'
34+ implementation ' com.google.re2j:re2j:1.7'
4735}
4836
4937shadowJar {
50- relocate(' de.leonhard' , ' tv.quaint.thebase.lib.leonhard' )
51- relocate(' com.mysql' , ' tv.quaint.thebase.lib.mysql' )
52- relocate(' com.zaxxer.hikari' , ' tv.quaint.thebase.lib.hikari' )
53- relocate(' net.objecthunter.exp4j' , ' tv.quaint.thebase.lib.exp4j' )
54- relocate(' com.google.re2j' , ' tv.quaint.thebase.lib.re2j' )
55- relocate(' com.google.gson' , ' tv.quaint.thebase.lib.google.gson' )
56- relocate(' com.google.guava' , ' tv.quaint.thebase.lib.google.guava' )
57- relocate(' org.sqlite' , ' tv.quaint.thebase.lib.sqlite' )
58- relocate(' org.xerial' , ' tv.quaint.thebase.lib.xerial' )
59- relocate(' org.apache.commons' , ' tv.quaint.thebase.lib.apache.commons' )
60- relocate(' org.yaml' , ' tv.quaint.thebase.lib.yaml' )
61- relocate(' org.jetbrains' , ' tv.quaint.thebase.lib.jetbrains' )
62- relocate(' org.bstats' , ' tv.quaint.thebase.lib.bstats' )
63- relocate(' lombok' , ' tv.quaint.thebase.lib.lombok' )
64-
65- exclude(' com.google.common.*' )
66- exclude(' org.apache.logging.log4j.*' )
67- exclude(' org.slf4j.*' )
68-
69- archiveFileName = project. name + ' -' + project. version + ' .jar'
38+ configurations = [project. configurations. implementation, project. configurations. shadow]
39+ Map<String , String > relocations = [
40+ ' de.leonhard' : ' gg.drak.thebase.lib.leonhard' ,
41+ ' com.mysql' : ' gg.drak.thebase.lib.mysql' ,
42+ ' com.zaxxer.hikari' : ' gg.drak.thebase.lib.hikari' ,
43+ ' net.objecthunter.exp4j' : ' gg.drak.thebase.lib.exp4j' ,
44+ ' com.google.re2j' : ' gg.drak.thebase.lib.re2j' ,
45+ ' com.google.gson' : ' gg.drak.thebase.lib.google.gson' ,
46+ ' com.google.guava' : ' gg.drak.thebase.lib.google.guava' ,
47+ ' org.sqlite' : ' gg.drak.thebase.lib.sqlite' ,
48+ ' org.xerial' : ' gg.drak.thebase.lib.xerial' ,
49+ ' org.apache.commons' : ' gg.drak.thebase.lib.apache.commons' ,
50+ ' org.yaml' : ' gg.drak.thebase.lib.yaml' ,
51+ ' org.bstats' : ' gg.drak.thebase.lib.bstats'
52+ ]
53+ relocations. each { src , dest -> relocate src, dest }
54+
55+ exclude ' com/google/common/**'
56+ exclude ' org/apache/logging/log4j/**'
57+ exclude ' org/slf4j/**'
58+ exclude ' META-INF/**'
59+ exclude ' **/LICENSE'
60+ exclude ' **/README.md'
61+ exclude ' **/docs/**'
62+
63+ archiveFileName = " ${ project.name} -${ project.version} .jar"
7064}
7165
7266tasks. register(' deploy' , Copy ) {
73- // Define the deployment directory
74- def deployDir = file(System . getenv(" DEPLOY_DIR" ) ?: " $rootDir /deploy" )
67+ def deployDir = file(System . getenv(' DEPLOY_DIR' ) ?: " $rootDir /deploy" )
68+ from shadowJar. archiveFile
69+ into deployDir
7570
76- // Ensure the deployment directory exists
7771 doFirst {
7872 println " Deploying to: $deployDir "
7973 deployDir. mkdirs()
80- println " Generated JAR file: ${ shadowJar.archiveFile} "
74+ println " Generated JAR file: ${ shadowJar.archiveFile.get() } "
8175 }
82-
83- // Copy the shadowJar output
84- from shadowJar. archiveFile
85- into deployDir
8676}
8777
88- // Ensure that the deploy task runs after the shadowJar task
89- shadowJar. finalizedBy(deploy)
90-
9178tasks. named(' deploy' ). configure {
9279 dependsOn ' shadowJar' , ' sourcesJar' , ' javadocJar' , ' jar'
9380}
@@ -108,6 +95,4 @@ java {
10895wrapper {
10996 gradleVersion = ' 8.9'
11097 distributionType = Wrapper.DistributionType . BIN
111- }
112-
113- // comment for testing
98+ }
0 commit comments