Trying to fix report discord task #23

Merged
quentinlegot merged 10 commits from patch-report1 into dev 2023-07-26 23:46:29 +02:00
4 changed files with 30 additions and 14 deletions
Showing only changes of commit 75217ffe30 - Show all commits

View File

@ -1,22 +1,26 @@
package fr.altarik.toolbox.task; package fr.altarik.toolbox.task.server;
import fr.altarik.toolbox.task.PeriodicTaskI;
import fr.altarik.toolbox.task.TaskI;
import fr.altarik.toolbox.task.async.AsyncPeriodicTasks; import fr.altarik.toolbox.task.async.AsyncPeriodicTasks;
import fr.altarik.toolbox.task.async.AsyncTaskI; import fr.altarik.toolbox.task.async.AsyncTaskI;
import fr.altarik.toolbox.task.async.AsyncTasks; import fr.altarik.toolbox.task.async.AsyncTasks;
import fr.altarik.toolbox.task.sync.PeriodicSyncTask; import fr.altarik.toolbox.task.sync.PeriodicSyncTask;
import net.fabricmc.api.ModInitializer; import net.fabricmc.api.DedicatedServerModInitializer;
public class Task implements ModInitializer { public class DedicatedServerTask implements DedicatedServerModInitializer {
@SuppressWarnings("unused")
public final TaskI asyncWorkers = AsyncTasks.initialize(); public final TaskI asyncWorkers = AsyncTasks.initialize();
@SuppressWarnings("unused")
public final PeriodicTaskI periodicSyncTask = PeriodicSyncTask.initialize(); public final PeriodicTaskI periodicSyncTask = PeriodicSyncTask.initialize();
@SuppressWarnings("unused")
public final AsyncTaskI asyncTasks = AsyncTasks.initialize(); public final AsyncTaskI asyncTasks = AsyncTasks.initialize();
@SuppressWarnings("unused")
public final PeriodicTaskI periodicAsyncTask = AsyncPeriodicTasks.initialize(); public final PeriodicTaskI periodicAsyncTask = AsyncPeriodicTasks.initialize();
@Override @Override
public void onInitialize() { public void onInitializeServer() {
/* try { /* try {
asyncWorkers.addTask(new AltarikRunnable() { asyncWorkers.addTask(new AltarikRunnable() {
@Override @Override
@ -47,6 +51,7 @@ public class Task implements ModInitializer {
} */ } */
} }
@SuppressWarnings("unused")
public TaskI getAsyncWorkers() { public TaskI getAsyncWorkers() {
return asyncWorkers; return asyncWorkers;
} }

View File

@ -17,8 +17,8 @@
"icon": "assets/tasks/icon.png", "icon": "assets/tasks/icon.png",
"environment": "*", "environment": "*",
"entrypoints": { "entrypoints": {
"main": [ "server": [
"fr.altarik.toolbox.task.Task" "fr.altarik.toolbox.task.server.DedicatedServerTask"
] ]
}, },
"mixins": [ "mixins": [

View File

@ -3,7 +3,10 @@ plugins {
} }
Properties local = new Properties() Properties local = new Properties()
try {
local.load(new FileInputStream(rootProject.file("local.properties"))) local.load(new FileInputStream(rootProject.file("local.properties")))
} catch (IOException ignored) {}
allprojects { allprojects {
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
@ -42,8 +45,8 @@ allprojects {
name 'altarik' name 'altarik'
url 'https://repo.altarik.fr/'.concat(project.version.endsWith('SNAPSHOT') ? 'snapshots/' : 'releases/') url 'https://repo.altarik.fr/'.concat(project.version.endsWith('SNAPSHOT') ? 'snapshots/' : 'releases/')
credentials { credentials {
username = System.getProperty("REPO_USERNAME", local.getProperty("repo_username")) username = getEnv("REPO_USERNAME", local.getProperty("repo_username"))
password = System.getProperty("REPO_PASSWORD", local.getProperty("repo_password")) password = getEnv("REPO_PASSWORD", local.getProperty("repo_password"))
} }
} }
} }
@ -98,6 +101,15 @@ dependencies {
implementation subprojects.collect { project -> project } implementation subprojects.collect { project -> project }
} }
static def getEnv(String envName, String defaultValue) {
String r = System.getenv(envName)
if(r != null) {
return r
} else {
return defaultValue
}
}
/*jar { /*jar {
dependsOn subprojects.jar dependsOn subprojects.jar
subprojects.each { project -> subprojects.each { project ->

View File

@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xmx3G org.gradle.jvmargs=-Xmx3G
fabric.loom.multiProjectOptimisation=true
junit_version=5.9.0 junit_version=5.9.0
minecraft_version=1.19.3 minecraft_version=1.19.3
@ -8,5 +8,4 @@ loader_version=0.14.14
fabric_version=0.75.1+1.19.3 fabric_version=0.75.1+1.19.3
maven_group=fr.altarik.toolbox maven_group=fr.altarik.toolbox
maven_version=4.3.0-SNAPSHOT maven_version=4.3.1-SNAPSHOT
repo_username=Altarik