Add shadowJar instead of application, bump the project's version to 1.0.5

This commit is contained in:
pixtaded 2025-01-12 18:07:15 +03:00
parent e96b02357d
commit 7ba5bfbf9e
3 changed files with 24 additions and 9 deletions

View File

@ -1,19 +1,31 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id 'java'
id 'application'
id 'com.gradleup.shadow' version '9.0.0-beta4'
}
group = 'net.pixtaded'
version = '1.0.4'
version = projectVersion
repositories {
mavenCentral()
}
application {
mainClass = 'net.pixtaded.crab.Main'
}
dependencies {
implementation('org.xerial:sqlite-jdbc:3.47.1.0')
}
tasks.build.dependsOn tasks.shadowJar
tasks.named('jar', Jar) {
manifest {
attributes 'Main-Class': 'net.pixtaded.crab.Main'
}
}
tasks.named('shadowJar', ShadowJar) {
archiveBaseName = 'crab'
archiveClassifier = ''
archiveVersion = projectVersion
}

1
gradle.properties Normal file
View File

@ -0,0 +1 @@
projectVersion=1.0.5

View File

@ -43,11 +43,11 @@ public class ServerThread implements Runnable {
String msg = new String(input.readNBytes(4096), StandardCharsets.UTF_8).trim();
String address = socket.getInetAddress().getHostAddress();
new Thread(new LogDBThread(date, address, msg)).start();
String s = Sanitizer.sanitizeString(msg, true);
String newContent = server.cache.content() + Sanitizer.formatMessage(date.getTime(), address, s);
server.cache = new Logs(newContent.getBytes().length, newContent);
new Thread(new LogDBThread(date, address, msg)).start();
} case LOGS -> {
respond(server.cache.content());
} case LOGS_SIZE -> {
@ -75,15 +75,17 @@ public class ServerThread implements Runnable {
Date date;
String msg;
String address;
public LogDBThread(Date date, String address, String msg) {
this.date = date;
this.msg = msg;
this.address = address;
}
@Override
public void run() {
server.getDb().logMessage(date, socket.getInetAddress().getHostAddress(), msg);
server.getDb().logMessage(date, address, msg);
}
}
}