Skip to content

Look for a single module by name #6098

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions flutter-idea/src/io/flutter/utils/FlutterModuleUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,21 +341,19 @@ public static boolean convertFromDeprecatedModuleType(@NotNull Project project)
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) {
boolean isAllMatch = true;
for (PubRoot root : PubRoots.forProject(project)) {
assert root != null;
String name = PubspecYamlUtil.getDartProjectName(root.getPubspec());
String moduleName = name + "_android";
boolean isMatch = false;
for (Module module : FlutterModuleUtils.getModules(project)) {
if (moduleName.equals(module.getName())) {
isMatch = true;
return true;
}
}
isAllMatch = isAllMatch && isMatch;
}
return isAllMatch;
return false;
}

public static boolean isDeprecatedFlutterModuleType(@NotNull Module module) {
Expand Down