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
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ name and contact info to the [AUTHORS](AUTHORS) file.
- Expand `Edit configuration templates...` and verify that Flutter is present.
- Click [+] and verify that Flutter is present.

### Running against custom target IDEs

To test or debug the plugin against a different IDE target (like IntelliJ IDEA Community or Ultimate) without changing the project's compilation target, you can use the custom `runTarget` Gradle task.

Run it from the command line specifying the target IDE and version:
```bash
./gradlew runTarget -Pide=IntelliJ -PideV=2025.1
```

* **`-Pide`**: Valid values are `AndroidStudio` (default), `IntelliJ` (Community), and `Ultimate`.
* **`-PideV`**: Any valid version string or build number for the selected IDE.

To see a full list of available options and usage examples, run the task without any parameters:
```bash
./gradlew runTarget
```

## Provision Tool

This is not currently required. However, for debugging unit tests, it may be handy; please ignore for now.
Expand Down
57 changes: 55 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -389,12 +389,18 @@ 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)
untilBuild = provider { null }

doLast {
productsReleases.get().max()
println()
println("Mapping printProductsReleases output to ideV:")
println(" - The prefix (e.g., IU-, IC-) maps to -Pide (Ultimate, IntelliJ).")
println(" - The number part (e.g., 261.23567.71) maps to -PideV.")
println(" - Example: IU-261.23567.71 -> -Pide=Ultimate -PideV=261.23567.71")
Comment thread
pq marked this conversation as resolved.
println()
}
}
prepareJarSearchableOptions {
Expand All @@ -415,6 +421,53 @@ tasks {
}
}

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

val actualTarget = target ?: "AndroidStudio"
type = when (actualTarget) {
"IntelliJ" -> IntelliJPlatformType.IntellijIdeaCommunity
"Ultimate" -> IntelliJPlatformType.IntellijIdeaUltimate
else -> IntelliJPlatformType.AndroidStudio
}
this.version = version ?: ideaVersion
}
}
}

tasks.named("runTarget") {
val target = project.findProperty("ide") as? String
val version = project.findProperty("ideV") as? String

doFirst {
if (target == null && version == null) {
println("============================================================")
println("runTarget - Available Options")
println("============================================================")
println("Valid values for -Pide:")
println(" - AndroidStudio (default)")
println(" - IntelliJ (IntelliJ IDEA Community)")
println(" - Ultimate (IntelliJ IDEA Ultimate)")
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("Examples:")
println(" ./gradlew runTarget -Pide=IntelliJ -PideV=2025.1")
println(" ./gradlew runTarget -Pide=Ultimate -PideV=2025.1")
println("============================================================")
println("Stopping execution. Please run with parameters to launch a specific IDE.")

throw org.gradle.api.tasks.StopExecutionException()
}
}
}
Comment thread
pq marked this conversation as resolved.

// A task to print the classpath used for compiling an IntelliJ plugin
// Run with `./gradlew printCompileClasspath --no-configuration-cache `
tasks.register<Task>("printCompileClasspath") {
Expand Down
Loading