plugins {
    id 'java'
}

description = 'Host-neutral semantic layer for code: symbol coordinates, edits, and the compiler as an oracle'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(25)
    }
}

repositories {
    mavenCentral()
}

dependencies {
    // Deliberately no dependencies. The semantic model comes from the JDK itself
    // (javax.lang.model, com.sun.source, javax.tools), so this layer works for any host -
    // CLI, web, Eclipse, IntelliJ - and is testable without launching anything.
    //
    // A host that has a richer engine (JDT, PSI) implements the same named actions behind
    // WorkspaceBridge; nothing here needs to know about it.
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.12.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.12.0'
    testRuntimeOnly 'org.junit.platform:junit-platform-launcher:1.12.0'
}

tasks.withType(JavaCompile).configureEach {
    options.encoding = 'UTF-8'
    // com.sun.source.* lives in jdk.compiler; it is the supported API for compiler tooling
    // (annotation processors, Error Prone, Checkstyle all use it).
    options.compilerArgs << '--add-modules' << 'jdk.compiler'
}

tasks.named('test') {
    useJUnitPlatform()
    testLogging {
        events "passed", "skipped", "failed"
        showStandardStreams = true
    }
    jvmArgs '--add-modules', 'jdk.compiler'
}
