Fix deploy task #20

Merged
quentinlegot merged 3 commits from dev into master 2023-07-20 19:31:04 +02:00
4 changed files with 29 additions and 13 deletions
Showing only changes of commit 362de5e40d - 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

@ -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