Commit 70da7a0
authored
[infra] add parameterized
Adds support for running the plugin against custom target IDEs using the
new
[`intellijPlatformTesting`](https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-testing-extension.html)
Gradle extension, introducing a new parameterized `runTarget`.
## Why not update `runIde` directly?
In the new IntelliJ Platform Gradle Plugin (v2.x), the default `runIde`
task is strictly bound to the main project dependency used for
compilation (which is Android Studio in our project). To run against a
different IDE *without* changing the compilation target (which would
break compilation due to our project's hard dependencies on Android
Studio APIs), the plugin requires using the `intellijPlatformTesting`
extension to register a custom task. We can't easily re-target the
default `runIde` task without also changing what we compile against.
(And if we don't change what we compile against we're in the reflection
business so we can compile in the absence of AS deps OR code splitting
which is a headache; see relevant conversation in
flutter#8865.)
## Details
- Registers a custom `runIde` task named `runTarget` in
`build.gradle.kts`.
- Added support for `-Pide` (values: `AndroidStudio`, `IntelliJ`,
`Ultimate`) and `-PideV` (version string or build number) properties.
- Adds a self-documenting help output to `runTarget` that lists
available options and examples when run without parameters, and then
exits without launching the IDE.
- Updates the existing `printProductsReleases` task to include
instructions on how to map its output to the new `-Pide` and `-PideV`
parameters.
---
## Sample Outputs
### 1. Running `runTarget` without parameters
Running the task without parameters prints a help report and stops
execution.
```bash
./gradlew runTarget
============================================================
runTarget - Available Options
============================================================
Valid values for -Pide:
- AndroidStudio (default)
- IntelliJ (IntelliJ IDEA Community)
- Ultimate (IntelliJ IDEA Ultimate)
Valid values for -PideV:
- Any valid version string for the selected IDE.
- Examples for IntelliJ/Ultimate: 2024.1, 2024.2, 2024.3, 2025.1
- Run './gradlew printProductsReleases' to see the full list.
Examples:
./gradlew runTarget -Pide=IntelliJ -PideV=2025.1
./gradlew runTarget -Pide=Ultimate -PideV=2025.1
============================================================
Stopping execution. Please run with parameters to launch a specific IDE.
```
### 2. Running printProductsReleases
The task now prints mapping instructions after listing the available
releases.
```
./gradlew printProductsReleases
IU-261.23567.71
IU-253.31033.53
IC-252.27397.28
Mapping printProductsReleases output to ideV:
- The prefix (e.g., IU-, IC-) maps to -Pide (Ultimate, IntelliJ).
- The number part (e.g., 261.23567.71) maps to -PideV.
- Example: IU-261.23567.71 -> -Pide=Ultimate -PideV=261.23567.71
```
Fixes: flutter#8909
---
Review the contribution guidelines below:
- [x] I’ve reviewed the contributor guide and applied the relevant
portions to this PR.
- [x] I've included the required information in the description above.
- [x] My up-to-date information is in the `AUTHORS` file.
- [x] I've updated `CHANGELOG.md` if appropriate.
<details>
<summary>Contribution guidelines:</summary><br>
- See
our [contributor guide](../CONTRIBUTING.md) and
the [Flutter organization contributor
guide]([https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md)
for general expectations for PRs.
- Larger or significant changes should be discussed in an issue before
creating a PR.
- Dart contributions to our repos should follow the [Dart style
guide](https://dart.dev/guides/language/effective-dart) and use
`dart format`.
- Java and Kotlin contributions should strive to follow Java and Kotlin
best
practices
([discussion](flutter#8098)).
</details>runTarget to allow running against custom IDE targets (flutter#8910)1 parent c471478 commit 70da7a0
2 files changed
Lines changed: 72 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
235 | 252 | | |
236 | 253 | | |
237 | 254 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
389 | 389 | | |
390 | 390 | | |
391 | 391 | | |
392 | | - | |
393 | | - | |
| 392 | + | |
| 393 | + | |
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
398 | 404 | | |
399 | 405 | | |
400 | 406 | | |
| |||
415 | 421 | | |
416 | 422 | | |
417 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
418 | 471 | | |
419 | 472 | | |
420 | 473 | | |
| |||
0 commit comments