Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 73 additions & 4 deletions third_party/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ plugins {
id("org.jetbrains.kotlinx.kover") version "0.9.4" // Kover Code Coverage Plugin
}

// Read ideaVersion from gradle.properties
val ideaVersion = providers.gradleProperty("ideaVersion").get()

// Configure project's dependencies
repositories {
mavenCentral()
Expand Down Expand Up @@ -111,7 +114,7 @@ dependencies {
intellijPlatform {
// intellijIdea can be found here:
// https://www.jetbrains.com/idea/download/other.html
intellijIdea("2025.3.1.1")
intellijIdea(ideaVersion)

testFramework(TestFrameworkType.Platform)

Expand All @@ -133,6 +136,67 @@ dependencies {
testImplementation("junit:junit:4.13.2")
}

intellijPlatformTesting {
runIde {
register("runTarget") {
val ideTarget = project.findProperty("ide") as? String
val ideV = project.findProperty("ideV") as? String
val idePath = project.findProperty("idePath") as? String

if (idePath != null) {
localPath = file(idePath)
} else {
val actualTarget = ideTarget ?: "IntelliJ"
type = when (actualTarget) {
"IntelliJ" -> IntelliJPlatformType.IntellijIdeaCommunity
"Ultimate" -> IntelliJPlatformType.IntellijIdeaUltimate
"AndroidStudio" -> IntelliJPlatformType.AndroidStudio
else -> IntelliJPlatformType.IntellijIdeaCommunity
}
// Fallback to 2024.2 for IntelliJ Community because 2025.3+ has publication changes that cause resolution errors.
val fallbackVersion = if (actualTarget == "IntelliJ") "2024.2" else ideaVersion
Comment thread
pq marked this conversation as resolved.
this.version = ideV ?: fallbackVersion
}
}
}
}

tasks.named("runTarget") {
val ideTarget = project.findProperty("ide") as? String
val ideV = project.findProperty("ideV") as? String
val idePath = project.findProperty("idePath") as? String
Comment thread
pq marked this conversation as resolved.

doFirst {
if (ideTarget == null && ideV == null && idePath == null) {
println("============================================================")
println("runTarget - Available Options")
println("============================================================")
println("Valid values for -Pide:")
println(" - IntelliJ (default, IntelliJ IDEA Community)")
println(" - Ultimate (IntelliJ IDEA Ultimate)")
println(" - AndroidStudio")
println()
println("Valid values for -PideV:")
println(" - Any valid version string for the selected IDE.")
println(" - Examples for IntelliJ/Ultimate: 2024.1, 2024.2, 2024.3, 2025.1")
println(" - Run './gradlew printProductsReleases' to see the full list.")
println()
println("Valid values for -PidePath:")
println(" - Path to a local installation of the IDE (e.g., Android Studio).")
println(" - Use this if Gradle resolution fails for Android Studio.")
println()
println("Examples:")
println(" ./gradlew runTarget -Pide=IntelliJ -PideV=2025.1")
println(" ./gradlew runTarget -Pide=Ultimate -PideV=2025.1")
println(" ./gradlew runTarget -PidePath=/Applications/Android\\ Studio.app")
println("============================================================")
println("Stopping execution. Please run with parameters to launch a specific IDE.")
Comment thread
pq marked this conversation as resolved.

throw org.gradle.api.tasks.StopExecutionException()
}
}
}

tasks {
wrapper {
gradleVersion = providers.gradleProperty("gradleVersion").get()
Expand Down Expand Up @@ -165,11 +229,16 @@ tasks {
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#how-to-check-the-latest-available-eap-release
tasks {
printProductsReleases {
channels = listOf(ProductRelease.Channel.EAP)
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity)
channels = listOf(ProductRelease.Channel.RELEASE, ProductRelease.Channel.EAP)
types = listOf(IntelliJPlatformType.IntellijIdeaCommunity, IntelliJPlatformType.IntellijIdeaUltimate, IntelliJPlatformType.AndroidStudio)
untilBuild = provider { null }
doLast {
productsReleases.get().max()
println()
println("Mapping printProductsReleases output to ideV:")
println(" - The prefix (e.g., IU-, IC-, AI-) maps to -Pide (Ultimate, IntelliJ, AndroidStudio).")
println(" - The number part (e.g., 261.23567.71) maps to -PideV.")
println(" - Example: AI-2025.3.3.6 -> -Pide=AndroidStudio -PideV=2025.3.3.6")
println()
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions third_party/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ pluginVersion = 504.0.0
pluginSinceBuild = 251
pluginUntilBuild = 261.*

ideaVersion = 2025.3.1.1

# Gradle Releases -> https://github.com/gradle/gradle/releases
gradleVersion = 9.3.0

Expand Down
Loading