plugins {
    id 'application'
    id 'com.gradleup.shadow' version '9.2.0'
}

repositories {
    mavenCentral()
}

dependencies {
    implementation 'org.slf4j:slf4j-api:2.0.5'
    implementation 'org.slf4j:slf4j-simple:2.0.7'
    testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.1'
    implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j:0.21.0'
    implementation 'org.eclipse.lsp4j:org.eclipse.lsp4j.jsonrpc:0.21.0'
    implementation "com.google.guava:guava:$guavaVersion-jre"
}

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
}

tasks.withType(Jar) {
    manifest {
        attributes 'Main-Class': 'org.eclipse.buildship.gradleprop.ls.GradlePropertiesLanguageServerLauncher'
    }
}

application {
    mainClass = 'org.eclipse.buildship.gradleprop.ls.GradlePropertiesLanguageServerLauncher'
}

tasks.named('test') {
    useJUnitPlatform()
}

tasks.named('shadowJar') {
    archiveFileName = 'language-server.jar'
}