From 0a8006fd56ed3627b4c05100c3eb81c5b16a29bf Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Tue, 4 Mar 2025 19:30:42 +0100 Subject: [PATCH] no more tasks --- ChatApp/app/build.gradle | 45 ++++++++++------------------------------ 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/ChatApp/app/build.gradle b/ChatApp/app/build.gradle index 5c8657b..2f2fe33 100644 --- a/ChatApp/app/build.gradle +++ b/ChatApp/app/build.gradle @@ -39,47 +39,24 @@ javafx { application { // Define the main class for the application. - mainClass = 'client.ClientGui' + if (project.hasProperty('admin')) { + mainClass = 'ChatApp' + } else if (project.hasProperty('server')) { + mainClass = 'ChatAppServer' + }else if (project.hasProperty('client')) { + mainClass = 'ChatAppClient' + }else if (project.hasProperty('serverGui')) { + mainClass = 'server.ServerGUI' + } else { + mainClass = 'client.ClientGui' + } } run { standardInput = System.in } - - tasks.named('test') { // Use JUnit Platform for unit tests. useJUnitPlatform() } - -tasks.register("admin", JavaExec){ - group = "ChatAppConsole" - description = "Runs the server + the admin client" - mainClass.set("ChatApp") - classpath = sourceSets.main.runtimeClasspath - standardInput = System.in -} - -tasks.register("server", JavaExec){ - group = "ChatAppConsole" - description = "Runs the headless server" - mainClass.set("ChatAppServer") - classpath = sourceSets.main.runtimeClasspath - standardInput = System.in -} - -tasks.register("client", JavaExec) { - group = "ChatAppConsole" - description = "Runs the client" - mainClass.set("ChatAppClient") - classpath = sourceSets.main.runtimeClasspath - standardInput = System.in -} - -tasks.register("serverGUI", JavaExec) { - group = "ChatAppGUI" - description = "Runs a GUI for the server" - mainClass.set('server.ServerGUI') - classpath = sourceSets.main.runtimeClasspath -} \ No newline at end of file