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