2024-07-03 20:52:11 +00:00
|
|
|
plugins {
|
|
|
|
kotlin("jvm")
|
|
|
|
id("application")
|
|
|
|
}
|
|
|
|
|
|
|
|
val serverMainClassName = "prog8lsp.MainKt"
|
2024-10-29 19:51:49 +00:00
|
|
|
val applicationName = "prog8-beanshell"
|
2024-07-03 20:52:11 +00:00
|
|
|
|
|
|
|
application {
|
|
|
|
mainClass.set(serverMainClassName)
|
|
|
|
description = "Code completions, diagnostics and more for Prog8"
|
|
|
|
// applicationDefaultJvmArgs = listOf("-DkotlinLanguageServer.version=$version")
|
|
|
|
applicationDistribution.into("bin") {
|
|
|
|
filePermissions {
|
|
|
|
user {
|
|
|
|
read=true
|
|
|
|
execute=true
|
|
|
|
write=true
|
|
|
|
}
|
|
|
|
other.execute = true
|
|
|
|
group.execute = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2024-10-29 19:51:49 +00:00
|
|
|
implementation(files("lib/bsh-3.0.0-SNAPSHOT.jar"))
|
2024-07-03 20:52:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
configurations.forEach { config ->
|
|
|
|
config.resolutionStrategy {
|
|
|
|
preferProjectModules()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.main {
|
|
|
|
java.srcDir("src")
|
|
|
|
resources.srcDir("resources")
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets.test {
|
|
|
|
java.srcDir("src")
|
|
|
|
resources.srcDir("resources")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.startScripts {
|
2024-10-29 19:51:49 +00:00
|
|
|
applicationName = "prog8-beanshell"
|
2024-07-03 20:52:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register<Exec>("fixFilePermissions") {
|
|
|
|
// When running on macOS or Linux the start script
|
|
|
|
// needs executable permissions to run.
|
|
|
|
|
|
|
|
onlyIf { !System.getProperty("os.name").lowercase().contains("windows") }
|
2024-10-29 19:51:49 +00:00
|
|
|
commandLine("chmod", "+x", "${tasks.installDist.get().destinationDir}/bin/prog8-beanshell")
|
2024-07-03 20:52:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType<Test>() {
|
|
|
|
testLogging {
|
|
|
|
events("failed")
|
|
|
|
exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.installDist {
|
|
|
|
finalizedBy("fixFilePermissions")
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.build {
|
|
|
|
finalizedBy("installDist")
|
|
|
|
}
|
2024-10-29 19:51:49 +00:00
|
|
|
|
|
|
|
val javaVersion: String by project
|
|
|
|
|
|
|
|
kotlin {
|
|
|
|
jvmToolchain {
|
|
|
|
languageVersion = JavaLanguageVersion.of(javaVersion.toInt())
|
|
|
|
}
|
|
|
|
}
|