Skip to content

Commit 660afe5

Browse files
authored
Merge branch 'flutter:master' into feat/optional-android-dep
2 parents f2bc11c + db6615c commit 660afe5

File tree

391 files changed

+3502
-6348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

391 files changed

+3502
-6348
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- Thanks for your contribution! Please replace this text with a description of what this PR is changing or adding and why, list any relevant issues, and review the contribution guidelines below.
2+
3+
---
4+
5+
- [ ] I’ve reviewed the contributor guide and applied the relevant portions to this PR.
6+
7+
<details>
8+
<summary>Contribution guidelines:</summary><br>
9+
10+
- See our [contributor guide]([https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md](https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview) for general expectations for PRs.
11+
- Larger or significant changes should be discussed in an issue before creating a PR.
12+
- Dart contributions to our repos should follow the [Dart style guide](https://dart.dev/guides/language/effective-dart) and use `dart format`.
13+
- Java and Kotlin contributions should strive to follow Java and Kotlin best practices ([discussion](https://github.com/flutter/flutter-intellij/issues/8098)).
14+
</details>

.github/workflows/presubmit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
version: [2024.1, 2024.2, 2024.3, 2025.1]
24+
version: [2024.3, 2025.1]
2525
steps:
2626
- name: checkout
2727
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ flutter-gui-tests/.gradle/
1313
flutter-gui-tests/guitest.log
1414
flutter-intellij.jar
1515
flutter-intellij.zip
16-
third_party/lib/*.jar
1716
third_party/lib/jxbrowser/*
18-
!third_party/lib/jxbrowser/jxbrowser-7.41.2.jar
19-
!third_party/lib/jxbrowser/jxbrowser-swing-7.41.2.jar
17+
!third_party/lib/jxbrowser/jxbrowser-8.6.0.jar
18+
!third_party/lib/jxbrowser/jxbrowser-swing-8.6.0.jar
2019
!third_party/lib/java-string-similarity-2.0.0.jar
2120
material-design-icons/
2221
out/

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ Wagner Silvestre <[email protected]>
2424
Eli Albert <[email protected]>
2525
Mohamed El Sayed <[email protected]>
2626
Edwin Ludik <[email protected]>
27+
Japnit Singh <[email protected]>

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1+
# 86
2+
- New message in DevTools windows for "Dock unpinned" IntelliJ feature (#8181)
3+
- Fixes for Slow Operation notifications in the IDEA platform (#7792)
4+
- Fix in Flutter project creation flow (#8259)
5+
- Many code health improvements and code cleanups (#8025, #8027, #8021)
6+
- Migration of deprecated API usages (#7718)
7+
- Fix for empty menu item in the device selector (#8264)
8+
9+
# 85.3
10+
- Add Property Editor side panel (#7957)
11+
- Support removed for IDEA 2024.1 (Koala) and 2024.2 (Ladybug) (#8073)
12+
- Various cleanups including migrating slow operations to non-blocking calls (#8089)
13+
14+
# 85.2
15+
- Fix broken devtools inspector source navigation (#8041)
16+
17+
# 85.1
18+
- Fix the disappearance of the New Flutter Project menu item (#8040)
19+
- Add back the device name with the running tab (#7948)
20+
- Update the `org.jetbrains.intellij.platform` version to `2.5.0` (#8038)
21+
- Replace deprecated ComboBoxWithBrowserButton (#7931)
22+
- Fix Flutter Outline View event over-subscriptions (#7980)
23+
124
# 85
225
- Restored Test with coverage run configuration feature (#7810)
326
- Upgrade `org.jetbrains.intellij.platform` to 2.2.1 from 2.1.0 (#7936)

CONTRIBUTING.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,21 @@ Contributing to Flutter Plugin for IntelliJ
55
* [Contributing to Flutter Plugin for IntelliJ](#contributing-to-flutter-plugin-for-intellij)
66
* [Contributing code](#contributing-code)
77
* [Getting started](#getting-started)
8-
* [Setting environments](#setting-environments)
8+
* [Environment set-up](#environment-set-up)
9+
* [IntelliJ set-up](#intellij-set-up)
10+
* [Configure "Project Structure" settings](#configure-project-structure-settings)
11+
* [Configure the Gradle settings](#configure-the-gradle-settings)
12+
* [Build and run the plugin](#build-and-run-the-plugin)
913
* [Handle symlinks](#handle-symlinks)
1014
* [Provision Tool](#provision-tool)
1115
* [Running plugin tests](#running-plugin-tests)
1216
* [Using test run configurations in IntelliJ](#using-test-run-configurations-in-intellij)
1317
* [Using the plugin tool on the command line](#using-the-plugin-tool-on-the-command-line)
1418
* [Adding platform sources](#adding-platform-sources)
1519
* [Working with Android Studio](#working-with-android-studio)
16-
* [Working with Embedded DevTools (JxBrowser)](#working-with-embedded-devtools-jxbrowser)
20+
* [Flutter DevTools Integration](#flutter-devtools-integration)
21+
* [Working with Embedded DevTools (JxBrowser)](#working-with-embedded-devtools-jxbrowser)
22+
* [Developing with local DevTools](#developing-with-local-devtools)
1723
<!-- TOC -->
1824

1925
## Contributing code
@@ -71,7 +77,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
7177
```
7278
In your shell configuration file (e.g. `.bashrc` or `.zshrc`), set your `JAVA_HOME` env variable to match that version.
7379
```shell
74-
export JAVA_HOME=`/usr/libexec/java_home -v 23.0.2
80+
export JAVA_HOME=`/usr/libexec/java_home -v 23.0.2`
7581
```
7682

7783
3. Set your `FLUTTER_SDK` path in the configuration file for your shell environment.
@@ -92,13 +98,13 @@ name and contact info to the [AUTHORS](AUTHORS) file.
9298
4. Set your `DARK_SDK` path in the configuration file for your shell environment.
9399
- In your shell configuration file (e.g. `.bashrc` or `.zshrc`), set your `DART_SDK` env variable to match the Dart SDK in your Flutter SDK. This should look like the `FLUTTER_SDK` path (added above) with `/bin/cache/dart-sdk` appened to the end.
94100
```shell
95-
export DART_SDK="$HOME/path/to/flutter/bin/cache/dart-sdk`"
101+
export DART_SDK="$HOME/path/to/flutter/bin/cache/dart-sdk"
96102
```
97103

98104
5. Add `DART_SDK`, `FLUTTER_SDK` and `JAVA_HOME` to your `PATH`.
99105
- In your shell configuration file (e.g. `.bashrc` or `.zshrc`), below where your `JAVA_HOME`, `FLUTTER_SDK`, `DART_SDK` env variables were set, add the following line:
100106
```shell
101-
export PATH=$DART_SDK/bin:$FLUTTER_SDK/bin:$JAVA_HOME/bin:$PATH"
107+
export PATH=$DART_SDK/bin:$FLUTTER_SDK/bin:$JAVA_HOME/bin:$PATH
102108
```
103109

104110
6. Update your current `PATH`.
@@ -144,6 +150,7 @@ name and contact info to the [AUTHORS](AUTHORS) file.
144150
- `dart pub get`
145151
- `(cd tool/plugin; dart pub get)`
146152
- `bin/plugin test`
153+
- Note: If there are Dart errors during build originating in the `tool/plugin` directory, try deleting the contents of the `pubspec.lock` file and re-running the pub get steps. This will allow you to get a fresh set of pub packages.
147154

148155
### Configure "Project Structure" settings
149156

@@ -176,21 +183,21 @@ name and contact info to the [AUTHORS](AUTHORS) file.
176183
Internal Java Platform: IDEA JBR 21
177184
```
178185
179-
3. Set the SDK for the Project
186+
4. Set the SDK for the Project
180187
- Select "Project Settings > Project"
181188
- Change the "SDK" selection to the **IntelliJ Platform Plugin SDK** you added in step 3.
182189
- When you are done, your settings should look something like:
183190
```
184191
SDK: IntelliJ IDEA Community Edition IC-243.23654.189
185192
```
186193
187-
4. Configure the modules for the Project
194+
5. Configure the modules for the Project
188195
- Select "Project Settings > Modules"
189196
- Select the `flutter-intellij > flutter-idea` module
190197
- Switch to the "Paths" window
191198
- Select the **Inherit project compile output path** option then apply.
192199
193-
5. Change the modules SDK to the Project SDK
200+
6. Change the modules SDK to the Project SDK
194201
- Select "Project Settings > Modules"
195202
- Select all the sub-directories under the `flutter-intellij > flutter-idea` module
196203
- Switch to the "Dependencies" window
@@ -257,7 +264,7 @@ A problem occurred configuring project ':flutter-idea'.
257264
> Source directory 'X:\path\to\your\flutter-intellij\flutter-idea\resources' is not a directory.
258265
```
259266
260-
Check out if the directory is a symlink by open the link in IDEA, and it'll display as:
267+
Check if the directory is a symlink by opening the link in IDEA, and it'll display as:
261268
262269
```symlink
263270
../resources
@@ -269,8 +276,8 @@ Delete the file, then re-clone the repo using the below command:
269276
git clone -c core.symlinks=true https://github.com/<your_name_here>/flutter-intellij
270277
```
271278
272-
**NOTE**: Avoid symlinks addition during development as possible as you can,
273-
since they can lead to various of file-based issues during the development.
279+
**NOTE**: Avoid adding symlinks during development if you can,
280+
since they can lead to various file-based issues during development.
274281
275282
## Provision Tool
276283

build.gradle.kts

Lines changed: 90 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ plugins {
3333
// https://github.com/JetBrains/intellij-platform-gradle-plugin/releases
3434
// https://plugins.gradle.org/plugin/org.jetbrains.kotlin.jvm
3535
id("org.jetbrains.intellij.platform") version "2.5.0"
36-
id("org.jetbrains.kotlin.jvm") version "2.1.20"
36+
id("org.jetbrains.kotlin.jvm") version "2.1.21-RC2"
3737
}
3838

3939
// TODO(mossmana) These properties are duplicated in flutter-idea/build.gradle.kts and flutter-studio/build.gradle.kts. Should be consolidated.
@@ -60,12 +60,18 @@ println("javaVersion: $javaVersion")
6060
println("group: $group")
6161

6262
var jvmVersion: JvmTarget
63-
if (javaVersion == "17") {
64-
jvmVersion = JvmTarget.JVM_17
65-
} else if (javaVersion == "21") {
66-
jvmVersion = JvmTarget.JVM_21
67-
} else {
68-
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
63+
jvmVersion = when (javaVersion) {
64+
"17" -> {
65+
JvmTarget.JVM_17
66+
}
67+
68+
"21" -> {
69+
JvmTarget.JVM_21
70+
}
71+
72+
else -> {
73+
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
74+
}
6975
}
7076
kotlin {
7177
compilerOptions {
@@ -75,12 +81,18 @@ kotlin {
7581
}
7682

7783
var javaCompatibilityVersion: JavaVersion
78-
if (javaVersion == "17") {
79-
javaCompatibilityVersion = JavaVersion.VERSION_17
80-
} else if (javaVersion == "21") {
81-
javaCompatibilityVersion = JavaVersion.VERSION_21
82-
} else {
83-
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
84+
javaCompatibilityVersion = when (javaVersion) {
85+
"17" -> {
86+
JavaVersion.VERSION_17
87+
}
88+
89+
"21" -> {
90+
JavaVersion.VERSION_21
91+
}
92+
93+
else -> {
94+
throw IllegalArgumentException("javaVersion must be defined in the product matrix as either \"17\" or \"21\", but is not for $ideaVersion")
95+
}
8496
}
8597
java {
8698
sourceCompatibility = javaCompatibilityVersion
@@ -93,27 +105,33 @@ dependencies {
93105
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#default-target-platforms
94106
if (ideaProduct == "android-studio") {
95107
androidStudio(ideaVersion)
96-
} else { // if (ideaProduct == "IC") {
97-
intellijIdeaCommunity(ideaVersion)
108+
} else {
109+
when (ideaProduct) {
110+
"IU" -> intellijIdeaUltimate(ideaVersion)
111+
"IC" -> intellijIdeaCommunity(ideaVersion)
112+
else -> throw IllegalArgumentException("ideaProduct must be defined in the product matrix as either \"IU\" or \"IC\", but is not for $ideaVersion")
113+
}
98114
}
99115
testFramework(TestFrameworkType.Platform)
100116

101117
// Plugin dependency documentation:
102118
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html#plugins
103119
val bundledPluginList = mutableListOf(
120+
"com.google.tools.ij.aiplugin",
104121
"com.intellij.java",
105122
"com.intellij.properties",
106123
"JUnit",
107124
"Git4Idea",
108125
"org.jetbrains.kotlin",
109126
"org.jetbrains.plugins.gradle",
110-
"org.intellij.intelliLang")
127+
"org.jetbrains.plugins.yaml",
128+
"org.intellij.intelliLang"
129+
)
130+
val pluginList = mutableListOf("Dart:$dartPluginVersion")
111131
if (ideaProduct == "android-studio") {
112132
bundledPluginList.add("org.jetbrains.android")
113133
bundledPluginList.add("com.android.tools.idea.smali")
114-
}
115-
val pluginList = mutableListOf("Dart:$dartPluginVersion")
116-
if (ideaProduct == "IC") {
134+
} else {
117135
pluginList.add("org.jetbrains.android:$androidPluginVersion")
118136
}
119137

@@ -130,6 +148,7 @@ dependencies {
130148
}
131149
}
132150

151+
133152
intellijPlatform {
134153
pluginConfiguration {
135154
version = flutterPluginVersion
@@ -138,8 +157,46 @@ intellijPlatform {
138157
untilBuild = untilBuildInput
139158
}
140159
}
141-
}
142160

161+
// Verifier documentation
162+
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html#intellijPlatform-pluginVerification
163+
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html#intellijPlatform-pluginVerification-ides
164+
pluginVerification {
165+
// https://github.com/JetBrains/intellij-plugin-verifier/?tab=readme-ov-file#specific-options
166+
// https://github.com/JetBrains/intellij-plugin-verifier
167+
cliPath = file("./third_party/lib/verifier-cli-1.384-all.jar")
168+
failureLevel = listOf(
169+
// TODO(team) Ideally all of the following FailureLevels should be enabled:
170+
// TODO(team) Create a tracking issue for each of the following validations
171+
// VerifyPluginTask.FailureLevel.COMPATIBILITY_WARNINGS,
172+
// VerifyPluginTask.FailureLevel.COMPATIBILITY_PROBLEMS,
173+
// VerifyPluginTask.FailureLevel.DEPRECATED_API_USAGES, // https://github.com/flutter/flutter-intellij/issues/7718
174+
// VerifyPluginTask.FailureLevel.SCHEDULED_FOR_REMOVAL_API_USAGES,
175+
VerifyPluginTask.FailureLevel.EXPERIMENTAL_API_USAGES,
176+
// VerifyPluginTask.FailureLevel.INTERNAL_API_USAGES,
177+
// VerifyPluginTask.FailureLevel.OVERRIDE_ONLY_API_USAGES,
178+
VerifyPluginTask.FailureLevel.NON_EXTENDABLE_API_USAGES,
179+
VerifyPluginTask.FailureLevel.PLUGIN_STRUCTURE_WARNINGS,
180+
// VerifyPluginTask.FailureLevel.MISSING_DEPENDENCIES,
181+
VerifyPluginTask.FailureLevel.INVALID_PLUGIN,
182+
// VerifyPluginTask.FailureLevel.NOT_DYNAMIC,
183+
)
184+
verificationReportsFormats = VerifyPluginTask.VerificationReportsFormats.ALL
185+
subsystemsToCheck = VerifyPluginTask.Subsystems.ALL
186+
// Mute and freeArgs documentation
187+
// https://github.com/JetBrains/intellij-plugin-verifier/?tab=readme-ov-file#specific-options
188+
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#mutePluginVerifierProblems
189+
freeArgs = listOf(
190+
"-mute",
191+
"TemplateWordInPluginId,ForbiddenPluginIdPrefix,TemplateWordInPluginName"
192+
)
193+
ides {
194+
ide(IntelliJPlatformType.AndroidStudio, ideaVersion)
195+
// Note, ideally we would have additional targets identified here, however we have been unsuccessful in adding
196+
// "recomended()" or select {} support with current versions of gradle & the verifier tool.
197+
}
198+
}
199+
}
143200
// Documentation for printProductsReleases:
144201
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-faq.html#how-to-check-the-latest-available-eap-release
145202
tasks {
@@ -174,4 +231,16 @@ tasks {
174231
dependsOn(":flutter-studio:prepareSandbox")
175232
}
176233
}
177-
}
234+
}
235+
236+
// A task to print the classpath used for compiling an IntelliJ plugin
237+
// Run with `./third_party/gradlew printCompileClasspath --no-configuration-cache `
238+
tasks.register("printCompileClasspath") {
239+
doLast {
240+
println("--- Begin Compile Classpath ---")
241+
configurations.getByName("compileClasspath").forEach { file ->
242+
println(file.absolutePath)
243+
}
244+
println("--- End Compile Classpath ---")
245+
}
246+
}

docs/Development.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
### Simulating a fresh install
44

5-
To simulate a fresh install, you need to delete any accrued application state. To do this, you'll want to delete select folders in your plugin sandbox (location found in the `Sandbox Home` field in `Project structure | SDKs | [your IntelliJ IDEA plugin SDK]`.
5+
To simulate a fresh install, you need to delete any accrued application state. To do this, you'll want to delete select folders in your plugin sandbox.
6+
(To find your sandbox, launch the `runIde` run/debug configuration and in this newly launched IDE instance, open `Help > Show Log in Finder` (macOS) or
7+
`Help > Show Log in Explorer` (Windows), or `Help > Show Log in Files` (Linux). The log directory is usually inside a system folder, which itself is
8+
inside your sandbox.)
69

710
* **config** folder contains IDE app-level configuration, including app-level libraries, SDKs, recent projects, etc.
811
* **system** folder contains indexes and caches, deleting it is similar to File | Invalidate Caches action.
912
* **plugins** folder contains plugins that you additionally manually installed to the started IDE. (Likely don't want to delete `Dart`.)
1013
* **test** folder will also appear as soon as you run some tests. (Deleting it when tests fail with no visible reason can sometimes help.)
1114

12-
(_**NOTE:**_ after removing configuration info, you may need to re-prepare the `flutter-intellij` plugin for deployment in order for it to show up in your fresh runtime workbench: `Build > Prepare Plugin Module 'flutter-intellij' For Deployment`.)
15+
(_**NOTE:**_ after removing configuration info, you may need to re-prepare the `flutter-intellij` plugin for deployment in order for it to show up in your fresh runtime workbench: `Build > Prepare Plugin Module 'flutter-intellij' For Deployment`.)

docs/HotUI-Getting-Started-instructions.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)