diff --git a/build.gradle.kts b/build.gradle.kts index 41f04046b..894099f43 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -91,26 +91,27 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile::class).configure destinationDirectory.set(File(destinationDirectory.get().asFile.path.replace("kotlin", "java"))) } -tasks.getByName("run") { - this as JavaExec +tasks.create("runDevelopment") { dependsOn(tasks.getByName("test")) - + enableAssertions = true classpath = sourceSets.main.get().runtimeClasspath mainClass.set("com.projectswg.holocore.ProjectSWG") + + if (holocoreLogLevel != null) + args = listOf("--log-level", holocoreLogLevel!!) +} + +tasks.create("runProduction") { + classpath = sourceSets.main.get().runtimeClasspath + mainClass.set("com.projectswg.holocore.ProjectSWG") if (holocoreLogLevel != null) args = listOf("--log-level", holocoreLogLevel!!) } -tasks.create("runProduction") { - this as JavaExec - - classpath = sourceSets.main.get().runtimeClasspath - mainClass.set("com.projectswg.holocore.ProjectSWG") - - if (holocoreLogLevel != null) - args = listOf("--log-level", holocoreLogLevel!!) +tasks.replace("run", JavaExec::class).apply { + dependsOn(tasks.getByName("runDevelopment")) } tasks.create("runClientdataConversion") {