Commit f1d70fcd authored by Devon Carew's avatar Devon Carew Committed by GitHub

create intellij metadata from flutter create (#6429)

parent e72e1744
......@@ -168,8 +168,11 @@ Your main program file is lib/main.dart in the $relativePath directory.
templateContext['withDriverTest'] = renderDriverTest;
Template createTemplate = new Template.fromName('create');
fileCount += createTemplate.render(new Directory(dirPath), templateContext,
overwriteExisting: false);
fileCount += createTemplate.render(
new Directory(dirPath),
templateContext, overwriteExisting: false,
projectName: projectName
);
if (renderDriverTest) {
Template driverTemplate = new Template.fromName('driver');
......
......@@ -60,8 +60,12 @@ class Template {
Map<String /* relative */, String /* absolute source */> _templateFilePaths;
int render(Directory destination, Map<String, dynamic> context,
{ bool overwriteExisting: true }) {
int render(
Directory destination,
Map<String, dynamic> context, {
bool overwriteExisting: true,
String projectName
}) {
destination.createSync(recursive: true);
int fileCount = 0;
......@@ -72,6 +76,8 @@ class Template {
.join(destinationDirPath, relativeDestPath)
.replaceAll(_kCopyTemplateExtension, '')
.replaceAll(_kTemplateExtension, '');
if (projectName != null)
finalDestinationPath = finalDestinationPath.replaceAll('projectName', projectName);
File finalDestinationFile = new File(finalDestinationPath);
String relativePathForLogging = path.relative(finalDestinationFile.path);
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/{{projectName}}.iml" filepath="$PROJECT_DIR$/{{projectName}}.iml" />
</modules>
</component>
</project>
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="main.dart" type="FlutterRunConfigurationType" factoryName="Flutter">
<option name="filePath" value="$PROJECT_DIR$/lib/main.dart" />
<method />
</configuration>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="FLUTTER_MODULE_TYPE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/packages" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Dart SDK" level="application" />
<orderEntry type="library" name="Dart Packages" level="project" />
</component>
</module>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment