Skip to content

Commit

Permalink
Remove the old logic (2017) to migrate Flutter projects from one modu…
Browse files Browse the repository at this point in the history
…le type to another (#7805)

Original work:
da5eea7
  • Loading branch information
jwren authored Nov 20, 2024
1 parent 3f7abbb commit 30b628c
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 42 deletions.
2 changes: 0 additions & 2 deletions flutter-idea/src/io/flutter/FlutterBundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ flutter.analytics.notification.content=The Flutter plugin reports feature usage
<a href="url">www.google.com/policies/privacy</a>.<br><br>Send usage statistics?
flutter.analytics.privacyUrl=https://www.google.com/policies/privacy/

flutter.initializer.module.converted.title=Flutter module type updated

flutter.reload.firstRun.title=Flutter supports hot reload!
flutter.reload.firstRun.content=Apply changes to your app in place, instantly.
flutter.reload.firstRun.url=https://flutter.dev/to/hot-reload
Expand Down
10 changes: 0 additions & 10 deletions flutter-idea/src/io/flutter/FlutterInitializer.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,6 @@ public class FlutterInitializer implements StartupActivity {

@Override
public void runActivity(@NotNull Project project) {
// Convert all modules of deprecated type FlutterModuleType.
if (FlutterModuleUtils.convertFromDeprecatedModuleType(project)) {
// If any modules were converted over, create a notification
FlutterMessages.showInfo(
FlutterBundle.message("flutter.initializer.module.converted.title"),
"Converted from '" + FlutterModuleUtils.DEPRECATED_FLUTTER_MODULE_TYPE_ID +
"' to '" + FlutterModuleUtils.getModuleTypeIDForFlutter() + "'.",
project);
}

// Disable the 'Migrate Project to Gradle' notification.
FlutterUtils.disableGradleProjectMigrationNotification(project);

Expand Down
25 changes: 0 additions & 25 deletions flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -349,22 +349,6 @@ public static List<Module> findModulesWithFlutterContents(@NotNull Project proje
return CollectionUtils.filter(getModules(project), module -> isFlutterModule(module) || declaresFlutter(module));
}

public static boolean convertFromDeprecatedModuleType(@NotNull Project project) {
boolean modulesConverted = false;

// Only automatically convert from older module types to JAVA_MODULE types if we're running in Android Studio.
if (FlutterUtils.isAndroidStudio()) {
for (Module module : getModules(project)) {
if (isDeprecatedFlutterModuleType(module)) {
setFlutterModuleType(module);
modulesConverted = true;
}
}
}

return modulesConverted;
}

// Return true if there is a module with the same name as the project plus the Android suffix.
public static boolean hasAndroidModule(@NotNull Project project) {
for (PubRoot root : PubRoots.forProject(project)) {
Expand All @@ -380,15 +364,6 @@ public static boolean hasAndroidModule(@NotNull Project project) {
return false;
}

public static boolean isDeprecatedFlutterModuleType(@NotNull Module module) {
if (!DEPRECATED_FLUTTER_MODULE_TYPE_ID.equals(module.getOptionValue("type"))) {
return false;
}

// Validate that the pubspec references flutter.
return declaresFlutter(module);
}

public static boolean isInFlutterAndroidModule(@NotNull Project project, @NotNull VirtualFile file) {
final Module module = FlutterBuildActionGroup.findFlutterModule(project, file);
if (module != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public class FlutterModuleUtilsTest {
@Rule
public final ProjectFixture<IdeaProjectTestFixture> fixture = Testing.makeEmptyModule();

@Test
public void isDeprecatedFlutterModuleType_false_empty_module() {
assertFalse(FlutterModuleUtils.isDeprecatedFlutterModuleType(fixture.getModule()));
}

@Test
public void isFlutterModule_null() {
assertFalse(FlutterModuleUtils.isFlutterModule(null));
Expand Down

0 comments on commit 30b628c

Please sign in to comment.