Skip to content

Commit 60b6186

Browse files
committed
update: clean up project
1 parent 27b087e commit 60b6186

71 files changed

Lines changed: 213 additions & 254 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 50 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
plugins {
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

88
group = 'com.github.server-utilities'
@@ -11,83 +11,70 @@ version = '1.0.0'
1111
repositories {
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

4937
shadowJar {
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

7266
tasks.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-
9178
tasks.named('deploy').configure {
9279
dependsOn 'shadowJar', 'sourcesJar', 'javadocJar', 'jar'
9380
}
@@ -108,6 +95,4 @@ java {
10895
wrapper {
10996
gradleVersion = '8.9'
11097
distributionType = Wrapper.DistributionType.BIN
111-
}
112-
113-
// comment for testing
98+
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ org.gradle.parallel = true
66
org.gradle.caching = true
77
org.gradle.vfs.watch = false
88

9+
crate.version = 4.0.0-RC.2
10+
911
# Other properties
1012
#name = TheBase
1113
#group = com.github.server-utilities

gradlew

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/tv/quaint/TheBase.java renamed to src/main/java/gg/drak/thebase/TheBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tv.quaint;
1+
package gg.drak.thebase;
22

33
import lombok.Getter;
44

src/main/java/tv/quaint/async/AsyncTask.java renamed to src/main/java/gg/drak/thebase/async/AsyncTask.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
package tv.quaint.async;
1+
package gg.drak.thebase.async;
22

33
import lombok.Getter;
44
import lombok.Setter;
5-
import org.jetbrains.annotations.NotNull;
65

76
import javax.swing.*;
87
import java.util.concurrent.CompletableFuture;

src/main/java/tv/quaint/async/AsyncUtils.java renamed to src/main/java/gg/drak/thebase/async/AsyncUtils.java

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
package tv.quaint.async;
1+
package gg.drak.thebase.async;
22

33
import lombok.Getter;
44
import lombok.Setter;
55

6-
import javax.swing.*;
76
import java.util.Optional;
87
import java.util.concurrent.CompletableFuture;
98
import java.util.concurrent.ConcurrentSkipListSet;
@@ -15,33 +14,7 @@ public class AsyncUtils {
1514
@Getter @Setter
1615
private static AtomicLong currentTaskId = new AtomicLong(0);
1716

18-
// @Getter @Setter
19-
// private static Timer taskThread;
20-
//
21-
//
22-
// public static void restartTicker() {
23-
// if (taskThread != null) {
24-
// taskThread.stop();
25-
// }
26-
//
27-
// taskThread = createNewTimer();
28-
// taskThread.start();
29-
// }
30-
//
31-
// public static Timer createNewTimer() {
32-
// return new Timer(50, e -> {
33-
// try {
34-
// tickTasks();
35-
// } catch (Exception ex) {
36-
// ex.printStackTrace();
37-
// }
38-
// });
39-
// }
40-
4117
public static void init() {
42-
// restartTicker();
43-
//
44-
// getCurrentTaskId().set(0);
4518
}
4619

4720
@Getter @Setter

src/main/java/tv/quaint/async/SyncInstance.java renamed to src/main/java/gg/drak/thebase/async/SyncInstance.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
package tv.quaint.async;
1+
package gg.drak.thebase.async;
22

33
import lombok.Getter;
44
import lombok.Setter;
55
import org.jetbrains.annotations.NotNull;
6-
import tv.quaint.objects.handling.IEventable;
6+
import gg.drak.thebase.objects.handling.IEventable;
77

88
import java.util.concurrent.CompletableFuture;
99

src/main/java/tv/quaint/async/SyncTask.java renamed to src/main/java/gg/drak/thebase/async/SyncTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tv.quaint.async;
1+
package gg.drak.thebase.async;
22

33
import lombok.Getter;
44
import lombok.Setter;

src/main/java/tv/quaint/async/TaskLike.java renamed to src/main/java/gg/drak/thebase/async/TaskLike.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tv.quaint.async;
1+
package gg.drak.thebase.async;
22

33
import org.jetbrains.annotations.NotNull;
44

src/main/java/tv/quaint/async/TaskThread.java renamed to src/main/java/gg/drak/thebase/async/TaskThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package tv.quaint.async;
1+
package gg.drak.thebase.async;
22

33
import lombok.Getter;
44
import lombok.Setter;

0 commit comments

Comments
 (0)