[infra] add parameterized runTarget to allow running against custom IDE targets #8910
[infra] add parameterized runTarget to allow running against custom IDE targets #8910pq merged 3 commits intoflutter:mainfrom
runTarget to allow running against custom IDE targets #8910Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a runTarget Gradle task to facilitate testing the plugin against various IDE targets and versions via command-line properties. It also updates CONTRIBUTING.md with usage instructions and enhances the printProductsReleases task with mapping guidance. Review feedback suggests improving consistency in the help message examples and refactoring the runTarget task definition into a single configuration block to enhance maintainability and prevent variable shadowing.
|
@cj-radcliff, @helin24: after a bunch of noodling around I found https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-testing-extension.html which explains some of the headaches we were having w/ It's pretty straightforward to use but since I know I'll forget, I inlined some help docs (see examples above). If anything looks unclear or unobvious, let me know! |
This is super helpful. |
|
Very cool! So this installs the result of buildPlugin into the specified IDE? |
Yep. One of the biggest pluses (that I forgot to highlight above) is that what we're testing is basically the same as what we're releasing. (This would be different if the compilation and execution targets were coupled.) |


Adds support for running the plugin against custom target IDEs using the new
intellijPlatformTestingGradle extension, introducing a new parameterizedrunTarget.Why not update
runIdedirectly?In the new IntelliJ Platform Gradle Plugin (v2.x), the default
runIdetask 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 theintellijPlatformTestingextension to register a custom task. We can't easily re-target the defaultrunIdetask 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 #8865.)Details
runIdetask namedrunTargetinbuild.gradle.kts.-Pide(values:AndroidStudio,IntelliJ,Ultimate) and-PideV(version string or build number) properties.runTargetthat lists available options and examples when run without parameters, and then exits without launching the IDE.printProductsReleasestask to include instructions on how to map its output to the new-Pideand-PideVparameters.Sample Outputs
1. Running
runTargetwithout parametersRunning the task without parameters prints a help report and stops execution.
2. Running printProductsReleases
The task now prints mapping instructions after listing the available releases.
Fixes: #8909
Review the contribution guidelines below:
AUTHORSfile.CHANGELOG.mdif appropriate.Contribution guidelines:
our contributor guide and
the Flutter organization contributor guide
for general expectations for PRs.
dart format.practices (discussion).