iOS: Treat the initial Info.plist string as a mustache template and use the project name to initialize the bundle name and identifier
diff --git a/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart b/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
index 7698f63..462ce97 100644
--- a/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
+++ b/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart
@@ -91,18 +91,6 @@
return true;
}
-void _writeUserEditableFilesIfNecessary(String directory) {
- iosTemplateFiles.forEach((String filePath, String contents) {
- File file = new File(filePath);
-
- if (!file.existsSync()) {
- file.parent.createSync(recursive: true);
- file.writeAsStringSync(contents);
- printStatus('Created $filePath.');
- }
- });
-}
-
void _setupXcodeProjXcconfig(String filePath) {
StringBuffer localsBuffer = new StringBuffer();
@@ -142,19 +130,15 @@
return 1;
}
- // Step 3: Setup default user editable files if this is the first run of
- // the init command.
- _writeUserEditableFilesIfNecessary(iosFilesPath);
-
- // Step 4: Populate the Local.xcconfig with project specific paths
+ // Step 3: Populate the Local.xcconfig with project specific paths
_setupXcodeProjXcconfig(path.join(xcodeprojPath, 'Local.xcconfig'));
- // Step 5: Write the REVISION file
+ // Step 4: Write the REVISION file
File revisionFile = new File(path.join(xcodeprojPath, 'REVISION'));
revisionFile.createSync();
revisionFile.writeAsStringSync(ArtifactStore.engineRevision);
- // Step 6: Tell the user the location of the generated project.
+ // Step 5: Tell the user the location of the generated project.
printStatus('Xcode project created at $xcodeprojPath/.');
printStatus('User editable settings are in $iosFilesPath/.');
@@ -171,11 +155,11 @@
<key>CFBundleExecutable</key>
<string>Runner</string>
<key>CFBundleIdentifier</key>
- <string>io.flutter.runner.Runner</string>
+ <string>com.example.{{projectName}}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
- <string>Flutter</string>
+ <string>{{projectName}}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>