Blame · Line-by-line history
build.gradle.kts
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| 1ab8ace | 1 | /* |
| 2 | * Gradle build for the Gluecron JetBrains plugin. | |
| 3 | * | |
| 4 | * Uses the IntelliJ Platform Gradle Plugin v1.17+ (the still-stable line | |
| 5 | * that targets IC-2024.1 across IDEA, WebStorm, GoLand, PyCharm, RustRover | |
| 6 | * and Rider). The plugin builds a single .zip via `./gradlew buildPlugin`. | |
| 7 | * | |
| 8 | * NOTE: gradle itself is intentionally NOT installed in the dev container — | |
| 9 | * this file just declares everything. CI / contributors invoke gradle via | |
| 10 | * the wrapper (`./gradlew`) which downloads its own JDK + gradle dist. | |
| 11 | */ | |
| 12 | ||
| 13 | plugins { | |
| 14 | id("java") | |
| 15 | id("org.jetbrains.kotlin.jvm") version "1.9.24" | |
| 16 | id("org.jetbrains.kotlin.plugin.serialization") version "1.9.24" | |
| 17 | id("org.jetbrains.intellij") version "1.17.4" | |
| 18 | } | |
| 19 | ||
| 20 | group = "com.gluecron" | |
| 21 | version = "0.1.0" | |
| 22 | ||
| 23 | repositories { | |
| 24 | mavenCentral() | |
| 25 | } | |
| 26 | ||
| 27 | // ----------------------------------------------------------------------- | |
| 28 | // IntelliJ Platform target. | |
| 29 | // | |
| 30 | // IC-2024.1 is the floor: it is the earliest 2024.x platform release and | |
| 31 | // is binary-compatible with every JetBrains IDE 2024.1+. We list all the | |
| 32 | // IDEs we want to load into via `plugins`/`type` overrides during | |
| 33 | // `runIde` — for buildPlugin, the IC base is enough. | |
| 34 | // ----------------------------------------------------------------------- | |
| 35 | ||
| 36 | intellij { | |
| 37 | version.set("2024.1") | |
| 38 | type.set("IC") | |
| 39 | plugins.set(listOf("Git4Idea")) // VCS APIs (CheckinHandlerFactory etc.) | |
| 40 | } | |
| 41 | ||
| 42 | // ----------------------------------------------------------------------- | |
| 43 | // Compile + run targets. | |
| 44 | // ----------------------------------------------------------------------- | |
| 45 | ||
| 46 | java { | |
| 47 | sourceCompatibility = JavaVersion.VERSION_17 | |
| 48 | targetCompatibility = JavaVersion.VERSION_17 | |
| 49 | } | |
| 50 | ||
| 51 | kotlin { | |
| 52 | jvmToolchain(17) | |
| 53 | } | |
| 54 | ||
| 55 | dependencies { | |
| 56 | // Kotlin stdlib is bundled with the platform, but pin it for IDE happiness. | |
| 57 | implementation("org.jetbrains.kotlin:kotlin-stdlib") | |
| 58 | ||
| 59 | // JSON for /api/v2 payloads. | |
| 60 | implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3") | |
| 61 | ||
| 62 | // ktor-client for HTTP. CIO engine has no native deps so it works | |
| 63 | // identically on macOS/Linux/Windows. | |
| 64 | implementation("io.ktor:ktor-client-core:2.3.12") | |
| 65 | implementation("io.ktor:ktor-client-cio:2.3.12") | |
| 66 | implementation("io.ktor:ktor-client-content-negotiation:2.3.12") | |
| 67 | implementation("io.ktor:ktor-serialization-kotlinx-json:2.3.12") | |
| 68 | } | |
| 69 | ||
| 70 | tasks { | |
| 71 | patchPluginXml { | |
| 72 | sinceBuild.set("241") // 2024.1 | |
| 73 | untilBuild.set("251.*") // 2025.1 — bump as we test newer platforms | |
| 74 | } | |
| 75 | ||
| 76 | // Tighten the build artifact name so the install/jetbrains route can | |
| 77 | // reference a stable zip name. | |
| 78 | buildPlugin { | |
| 79 | archiveBaseName.set("gluecron-jetbrains") | |
| 80 | } | |
| 81 | ||
| 82 | // Marketplace publishing is opt-in. Tokens come from env so we don't | |
| 83 | // accidentally commit them; CI populates them when we choose to ship. | |
| 84 | publishPlugin { | |
| 85 | token.set(providers.environmentVariable("JETBRAINS_MARKETPLACE_TOKEN").orElse("")) | |
| 86 | channels.set(listOf(providers.environmentVariable("JETBRAINS_PUBLISH_CHANNEL").getOrElse("default"))) | |
| 87 | } | |
| 88 | } |