Skip to content

Commit deb20c8

Browse files
authored
update the set of supported IntelliJ versions (flutter#5520)
update the set of supported IntelliJ versions
1 parent f6b51b8 commit deb20c8

File tree

6 files changed

+19
-81
lines changed

6 files changed

+19
-81
lines changed

.github/workflows/presubmit.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
version: [4.1, 4.2, AF.3.1, 2020.4, 2021.1]
21+
version: [4.2, AF.3.1, 2020.4, 2021.1]
2222
steps:
2323
- name: checkout
2424
uses: actions/checkout@v2

CONTRIBUTING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ file.
2929
- Change the name to `IntelliJ IDEA Community Edition`
3030
- Change the "Internal Java Platform" to `IntelliJ IDEA jbr 11`
3131
- Extend it with additional plugin libraries by adding to `Classpath`:
32-
- plugins/android/lib/android.jar
3332
- plugins/git4idea/lib/git4idea.jar
3433
* In the "Java Compiler" preference page, make sure that the "Project bytecode version" is set to `11` or `Same as language level`
3534
* In the "Kotlin Compiler" preference page, make sure that the "Target JVM Version" is set to `11` or `Same as language level`

product-matrix.json

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,5 @@
11
{
22
"list": [
3-
{
4-
"channel": "stable",
5-
"comments": "IntelliJ 2020.1.1, Android Studio 4.1",
6-
"name": "Android Studio 4.1",
7-
"version": "4.1",
8-
"ideaProduct": "android-studio",
9-
"ideaVersion": "201.6565218",
10-
"dartPluginVersion": "201.7223.99",
11-
"sinceBuild": "201.7223",
12-
"untilBuild": "201.*",
13-
"filesToSkip": [
14-
"src/io/flutter/utils/AndroidLocationProvider.java",
15-
"flutter-studio/src/io/flutter/actions/FlutterNewProjectAction.java"
16-
]
17-
},
183
{
194
"channel": "stable",
205
"comments": "IntelliJ 2020.2.3, Android Studio 4.2 RC 1",

resources/META-INF/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<category>Custom Languages</category>
2323
<version>SNAPSHOT</version>
24-
<idea-version since-build="201.7223" until-build="203.*"/>
24+
<idea-version since-build="202.7660.26" until-build="203.*"/>
2525

2626
<depends>com.intellij.modules.platform</depends>
2727
<depends>com.intellij.modules.lang</depends>

tool/plugin/lib/edit.dart

Lines changed: 17 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -39,52 +39,11 @@ List<EditCommand> editCommands = [
3939
replacement: 'type = "IC"\n version = "211.6693.111"',
4040
version: '2021.1',
4141
),
42-
Subst(
43-
path: 'src/io/flutter/FlutterUtils.java',
44-
initial: 'ProjectUtil.isSameProject(Paths.get(path), project)',
45-
replacement: 'ProjectUtil.isSameProject(path, project)',
46-
versions: ['4.1'],
47-
),
48-
Subst(
49-
path: 'src/io/flutter/perf/EditorPerfDecorations.java',
50-
initial: 'highlighter.getTextAttributes(null)',
51-
replacement: 'highlighter.getTextAttributes()',
52-
versions: ['4.1'],
53-
),
54-
MultiSubst(
55-
path: 'src/io/flutter/sdk/FlutterSdk.java',
56-
initials: [
57-
'branch = git4idea.light.LightGitUtilKt.getLocation(dir, GitExecutableManager.getInstance().getExecutable((Project)null));',
58-
'catch (VcsException e)'
59-
],
60-
replacements: [
61-
// This means we don't show platforms in IJ 2020.1, until stable channel supports them.
62-
'return FlutterSdkChannel.fromText("stable");',
63-
'catch (RuntimeException e)'
64-
],
65-
versions: ['4.1'],
66-
),
67-
MultiSubst(
68-
path: 'src/io/flutter/editor/FlutterIconLineMarkerProvider.java',
69-
initials: [
70-
'import com.intellij.codeInsight.daemon.GutterName;',
71-
'@GutterName'
72-
],
73-
replacements: ['', ''],
74-
versions: ['4.1'],
75-
),
76-
Subst(
77-
path: 'src/io/flutter/preview/PreviewView.java',
78-
initial:
79-
'Arrays.asList(expandAllAction, collapseAllAction, showOnlyWidgetsAction)',
80-
replacement: 'expandAllAction, collapseAllAction, showOnlyWidgetsAction',
81-
versions: ['4.1'],
82-
),
8342
Subst(
8443
path: 'src/io/flutter/FlutterErrorReportSubmitter.java',
8544
initial: 'Consumer<? super SubmittedReportInfo> consumer',
8645
replacement: 'Consumer<SubmittedReportInfo> consumer',
87-
versions: ['4.1', '4.2'],
46+
versions: ['4.2'],
8847
),
8948
Subst(
9049
path: 'src/io/flutter/utils/CollectionUtils.java',
@@ -110,13 +69,13 @@ List<EditCommand> editCommands = [
11069
'Object',
11170
'null',
11271
],
113-
versions: ['4.1', '4.2'],
72+
versions: ['4.2'],
11473
),
11574
Subst(
11675
path: 'flutter-studio/src/io/flutter/project/FlutterProjectCreator.java',
11776
initial: 'cannotWriteToFiles(List<Path> files)',
11877
replacement: 'cannotWriteToFiles(List<? extends File> files)',
119-
versions: ['4.1', '4.2'],
78+
versions: ['4.2'],
12079
),
12180
Subst(
12281
path: 'src/io/flutter/sdk/FlutterSdkUtil.java',
@@ -138,7 +97,8 @@ List<EditCommand> editCommands = [
13897
),
13998
Subst(
14099
path: 'src/io/flutter/utils/JxBrowserUtils.java',
141-
initial: 'return false; // return SystemInfo.isMac && com.intellij.util.system.CpuArch.isArm64();',
100+
initial:
101+
'return false; // return SystemInfo.isMac && com.intellij.util.system.CpuArch.isArm64();',
142102
replacement: 'return SystemInfo.isMac && CpuArch.isArm64();',
143103
versions: ['2021.1'],
144104
),
@@ -164,7 +124,7 @@ class EditAndroidModuleLibraryManager extends EditCommand {
164124
String convert(BuildSpec spec) {
165125
// Starting with 3.6 we need to call a simplified init().
166126
// This is where the $PROJECT_FILE$ macro is defined, #registerComponents.
167-
if (spec.version.startsWith("4.1") || spec.version.startsWith('4.2')) {
127+
if (spec.version.startsWith('4.2')) {
168128
var processedFile, source;
169129
processedFile = File(
170130
'flutter-studio/src/io/flutter/android/AndroidModuleLibraryManager.java');
@@ -175,19 +135,9 @@ class EditAndroidModuleLibraryManager extends EditCommand {
175135
"super.init(false, indicator);", "super.init(indicator);");
176136
source = source.replaceAll(
177137
"import com.intellij.openapi.project.impl.ProjectExImpl;", "");
178-
if (spec.version.startsWith("4.1")) {
179-
source = source.replaceAll(
180-
"import com.intellij.openapi.components.impl.stores.IProjectStore;",
181-
"");
182-
source = source.replaceAll("IProjectStore", "Object");
183-
source = source.replaceAll(
184-
"androidProject.init42", "androidProject.initPre41");
185-
source = source.replaceAll("PluginManagerCore.getLoadedPlugins(), null",
186-
"PluginManagerCore.getLoadedPlugins(), false");
187-
}
188138
if (spec.version.startsWith('4.2')) {
189-
source = source.replaceAll(
190-
"androidProject.init42", "androidProject.init41");
139+
source =
140+
source.replaceAll("androidProject.init42", "androidProject.init41");
191141
source = source.replaceAll("PluginManagerCore.getLoadedPlugins(), null",
192142
"PluginManagerCore.getLoadedPlugins()");
193143
source = source.replaceAll("getStateStore1", "getStateStore");
@@ -275,9 +225,16 @@ class Subst extends EditCommand {
275225
String path;
276226
String initial;
277227
String replacement;
228+
229+
/// The list of platform versions to perform the substitution for.
278230
List<String> versions;
279231

280-
Subst({this.versions, this.initial, this.replacement, this.path, version})
232+
Subst(
233+
{this.versions,
234+
this.initial,
235+
this.replacement,
236+
this.path,
237+
String version})
281238
: assert(initial != null),
282239
assert(replacement != null),
283240
assert(path != null) {
@@ -296,7 +253,7 @@ class Subst extends EditCommand {
296253
var original = source;
297254
source = source.replaceAll(initial, replacement);
298255
processedFile.writeAsStringSync(source);
299-
log ('edited $path');
256+
log('edited $path');
300257
return original;
301258
} else {
302259
return null;

tool/plugin/test/plugin_test.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ void main() {
4343
expect(
4444
specs.map((spec) => spec.ideaProduct).toList(),
4545
orderedEquals([
46-
'android-studio',
4746
'android-studio',
4847
'android-studio',
4948
'ideaIC',
@@ -61,7 +60,6 @@ void main() {
6160
expect(
6261
specs.map((spec) => spec.ideaProduct).toList(),
6362
orderedEquals([
64-
'android-studio',
6563
'android-studio',
6664
'android-studio',
6765
'ideaIC',
@@ -79,7 +77,6 @@ void main() {
7977
expect(
8078
specs.map((spec) => spec.ideaProduct).toList(),
8179
orderedEquals([
82-
'android-studio',
8380
'android-studio',
8481
'android-studio',
8582
'ideaIC',

0 commit comments

Comments
 (0)