mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Change 'flutter ide-config' to optionally create root Intellij module (#19920)
This commit is contained in:
parent
4509ad5978
commit
51d3daadfb
@ -2,6 +2,9 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
{{#withRootModule}}
|
||||
<module fileurl="file://$PROJECT_DIR$/flutter_root.iml" filepath="$PROJECT_DIR$/flutter_root.iml" />
|
||||
{{/withRootModule}}
|
||||
<module fileurl="file://$PROJECT_DIR$/examples/platform_view/android.iml" filepath="$PROJECT_DIR$/examples/platform_view/android.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/dev/bots/bots.iml" filepath="$PROJECT_DIR$/dev/bots/bots.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/examples/catalog/catalog.iml" filepath="$PROJECT_DIR$/examples/catalog/catalog.iml" />
|
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
@ -29,6 +29,14 @@ class IdeConfigCommand extends FlutterCommand {
|
||||
'update any out-of-date files, and remove any deleted files from the '
|
||||
'template directory.',
|
||||
);
|
||||
argParser.addFlag(
|
||||
'with-root-module',
|
||||
negatable: true,
|
||||
defaultsTo: true,
|
||||
help: 'Also create module that corresponds to the root of Flutter tree. '
|
||||
'This makes the entire Flutter tree browsable and searchable in IDE. '
|
||||
'Without this flag, only the child modules will be visible in IDE.',
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -238,7 +246,9 @@ class IdeConfigCommand extends FlutterCommand {
|
||||
|
||||
printStatus('Updating IDE configuration for Flutter tree at $dirPath...');
|
||||
int generatedCount = 0;
|
||||
generatedCount += _renderTemplate(_ideName, dirPath, <String, dynamic>{});
|
||||
generatedCount += _renderTemplate(_ideName, dirPath, <String, dynamic>{
|
||||
'withRootModule': argResults['with-root-module'],
|
||||
});
|
||||
|
||||
printStatus('Wrote $generatedCount files.');
|
||||
printStatus('');
|
||||
|
@ -107,6 +107,10 @@ class Template {
|
||||
}
|
||||
|
||||
_templateFilePaths.forEach((String relativeDestinationPath, String absoluteSourcePath) {
|
||||
final bool withRootModule = context['withRootModule'] ?? false;
|
||||
if (!withRootModule && absoluteSourcePath.contains('flutter_root'))
|
||||
return;
|
||||
|
||||
final String finalDestinationPath = renderPath(relativeDestinationPath);
|
||||
if (finalDestinationPath == null)
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user