plugins {
    id "org.jetbrains.intellij.platform" version "2.7.2"
    id "org.jetbrains.kotlin.jvm" version "2.1.20"
    id "java"
}

repositories {
    mavenCentral()
    intellijPlatform {
        defaultRepositories()
    }
}

// To find available IDE versions see https://www.jetbrains.com/intellij-repository/releases
// and https://www.jetbrains.com/intellij-repository/snapshots
ext.ideVersion = "2025.2"

sourceSets {
    main {
        kotlin { srcDir "src" }
        resources { srcDir "resources" }
    }
    test {
        kotlin { srcDir "test" }
    }
}

kotlin {
    jvmToolchain(17)
}

dependencies {
    testImplementation 'org.mockito:mockito-inline:5.2.0'

    intellijPlatform {
        intellijIdeaCommunity(ideVersion, false)
        bundledPlugin "Git4Idea"
    }
}

intellijPlatform {
    projectName = "LimitedWIP"
    buildSearchableOptions = false // Disable because it takes a long time and the plugin doesn't need it
    pluginConfiguration {
        ideaVersion {
            untilBuild = provider { null } // Disable patching plugin.xml because "until" version is too restrictive (it's better to keep it open-ended)
        }
    }
}

tasks {
    publishPlugin {
        token.set(System.getenv("PUBLISH_TOKEN"))
        hidden.set(true)
    }
}
