Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
51d3daad
Unverified
Commit
51d3daad
authored
Jul 30, 2018
by
Stanislav Baranov
Committed by
GitHub
Jul 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change 'flutter ide-config' to optionally create root Intellij module (#19920)
parent
4509ad59
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletion
+26
-1
modules.xml.tmpl
...utter_tools/ide_templates/intellij/.idea/modules.xml.tmpl
+3
-0
flutter_root.iml.copy.tmpl
...r_tools/ide_templates/intellij/flutter_root.iml.copy.tmpl
+8
-0
ide_config.dart
packages/flutter_tools/lib/src/commands/ide_config.dart
+11
-1
template.dart
packages/flutter_tools/lib/src/template.dart
+4
-0
No files found.
packages/flutter_tools/ide_templates/intellij/.idea/modules.xml.
copy.
tmpl
→
packages/flutter_tools/ide_templates/intellij/.idea/modules.xml.tmpl
View file @
51d3daad
...
@@ -2,6 +2,9 @@
...
@@ -2,6 +2,9 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ProjectModuleManager"
>
<component
name=
"ProjectModuleManager"
>
<modules>
<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$/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$/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"
/>
<module
fileurl=
"file://$PROJECT_DIR$/examples/catalog/catalog.iml"
filepath=
"$PROJECT_DIR$/examples/catalog/catalog.iml"
/>
...
...
packages/flutter_tools/ide_templates/intellij/flutter_root.iml.copy.tmpl
0 → 100644
View file @
51d3daad
<?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>
\ No newline at end of file
packages/flutter_tools/lib/src/commands/ide_config.dart
View file @
51d3daad
...
@@ -29,6 +29,14 @@ class IdeConfigCommand extends FlutterCommand {
...
@@ -29,6 +29,14 @@ class IdeConfigCommand extends FlutterCommand {
'update any out-of-date files, and remove any deleted files from the '
'update any out-of-date files, and remove any deleted files from the '
'template directory.'
,
'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
@override
...
@@ -238,7 +246,9 @@ class IdeConfigCommand extends FlutterCommand {
...
@@ -238,7 +246,9 @@ class IdeConfigCommand extends FlutterCommand {
printStatus
(
'Updating IDE configuration for Flutter tree at
$dirPath
...'
);
printStatus
(
'Updating IDE configuration for Flutter tree at
$dirPath
...'
);
int
generatedCount
=
0
;
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
(
'Wrote
$generatedCount
files.'
);
printStatus
(
''
);
printStatus
(
''
);
...
...
packages/flutter_tools/lib/src/template.dart
View file @
51d3daad
...
@@ -107,6 +107,10 @@ class Template {
...
@@ -107,6 +107,10 @@ class Template {
}
}
_templateFilePaths
.
forEach
((
String
relativeDestinationPath
,
String
absoluteSourcePath
)
{
_templateFilePaths
.
forEach
((
String
relativeDestinationPath
,
String
absoluteSourcePath
)
{
final
bool
withRootModule
=
context
[
'withRootModule'
]
??
false
;
if
(!
withRootModule
&&
absoluteSourcePath
.
contains
(
'flutter_root'
))
return
;
final
String
finalDestinationPath
=
renderPath
(
relativeDestinationPath
);
final
String
finalDestinationPath
=
renderPath
(
relativeDestinationPath
);
if
(
finalDestinationPath
==
null
)
if
(
finalDestinationPath
==
null
)
return
;
return
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment