Skip to content

Commit 30b628c

Browse files
authored
Remove the old logic (2017) to migrate Flutter projects from one module type to another (#7805)
Original work: da5eea7
1 parent 3f7abbb commit 30b628c

File tree

4 files changed

+0
-42
lines changed

4 files changed

+0
-42
lines changed

flutter-idea/src/io/flutter/FlutterBundle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ flutter.analytics.notification.content=The Flutter plugin reports feature usage
8282
<a href="url">www.google.com/policies/privacy</a>.<br><br>Send usage statistics?
8383
flutter.analytics.privacyUrl=https://www.google.com/policies/privacy/
8484

85-
flutter.initializer.module.converted.title=Flutter module type updated
86-
8785
flutter.reload.firstRun.title=Flutter supports hot reload!
8886
flutter.reload.firstRun.content=Apply changes to your app in place, instantly.
8987
flutter.reload.firstRun.url=https://flutter.dev/to/hot-reload

flutter-idea/src/io/flutter/FlutterInitializer.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@ public class FlutterInitializer implements StartupActivity {
8181

8282
@Override
8383
public void runActivity(@NotNull Project project) {
84-
// Convert all modules of deprecated type FlutterModuleType.
85-
if (FlutterModuleUtils.convertFromDeprecatedModuleType(project)) {
86-
// If any modules were converted over, create a notification
87-
FlutterMessages.showInfo(
88-
FlutterBundle.message("flutter.initializer.module.converted.title"),
89-
"Converted from '" + FlutterModuleUtils.DEPRECATED_FLUTTER_MODULE_TYPE_ID +
90-
"' to '" + FlutterModuleUtils.getModuleTypeIDForFlutter() + "'.",
91-
project);
92-
}
93-
9484
// Disable the 'Migrate Project to Gradle' notification.
9585
FlutterUtils.disableGradleProjectMigrationNotification(project);
9686

flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -349,22 +349,6 @@ public static List<Module> findModulesWithFlutterContents(@NotNull Project proje
349349
return CollectionUtils.filter(getModules(project), module -> isFlutterModule(module) || declaresFlutter(module));
350350
}
351351

352-
public static boolean convertFromDeprecatedModuleType(@NotNull Project project) {
353-
boolean modulesConverted = false;
354-
355-
// Only automatically convert from older module types to JAVA_MODULE types if we're running in Android Studio.
356-
if (FlutterUtils.isAndroidStudio()) {
357-
for (Module module : getModules(project)) {
358-
if (isDeprecatedFlutterModuleType(module)) {
359-
setFlutterModuleType(module);
360-
modulesConverted = true;
361-
}
362-
}
363-
}
364-
365-
return modulesConverted;
366-
}
367-
368352
// Return true if there is a module with the same name as the project plus the Android suffix.
369353
public static boolean hasAndroidModule(@NotNull Project project) {
370354
for (PubRoot root : PubRoots.forProject(project)) {
@@ -380,15 +364,6 @@ public static boolean hasAndroidModule(@NotNull Project project) {
380364
return false;
381365
}
382366

383-
public static boolean isDeprecatedFlutterModuleType(@NotNull Module module) {
384-
if (!DEPRECATED_FLUTTER_MODULE_TYPE_ID.equals(module.getOptionValue("type"))) {
385-
return false;
386-
}
387-
388-
// Validate that the pubspec references flutter.
389-
return declaresFlutter(module);
390-
}
391-
392367
public static boolean isInFlutterAndroidModule(@NotNull Project project, @NotNull VirtualFile file) {
393368
final Module module = FlutterBuildActionGroup.findFlutterModule(project, file);
394369
if (module != null) {

flutter-idea/testSrc/unit/io/flutter/utils/FlutterModuleUtilsTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ public class FlutterModuleUtilsTest {
2121
@Rule
2222
public final ProjectFixture<IdeaProjectTestFixture> fixture = Testing.makeEmptyModule();
2323

24-
@Test
25-
public void isDeprecatedFlutterModuleType_false_empty_module() {
26-
assertFalse(FlutterModuleUtils.isDeprecatedFlutterModuleType(fixture.getModule()));
27-
}
28-
2924
@Test
3025
public void isFlutterModule_null() {
3126
assertFalse(FlutterModuleUtils.isFlutterModule(null));

0 commit comments

Comments
 (0)