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

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

sourceSets {
    main {
        java.srcDir "src"
        kotlin.srcDir "src"
        resources.srcDir "resources"
    }
}

// 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"
//ext.ideVersion = "LATEST-EAP-SNAPSHOT"

dependencies {
    intellijPlatform {
        intellijIdeaCommunity(ideVersion, false)
    }
}

intellijPlatform {
    projectName = "tab-shifter"
    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)
    }
}
