From dd4361bcb3973404d1eedec5c2f93fad28c39504 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 16 Feb 2016 17:26:05 -0800 Subject: [PATCH] iOS: Treat the initial Info.plist string as a mustache template and use the project name to initialize the bundle name and identifier --- .../lib/src/ios/setup_xcodeproj.dart | 26 ++++--------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart b/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart index 7698f635b0..462ce97ea9 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 @@ Future _inflateXcodeArchive(String directory, List archiveBytes) asyn 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 @@ Future setupXcodeProjectHarness() async { 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 @@ final String _infoPlistInitialContents = ''' CFBundleExecutable Runner CFBundleIdentifier - io.flutter.runner.Runner + com.example.{{projectName}} CFBundleInfoDictionaryVersion 6.0 CFBundleName - Flutter + {{projectName}} CFBundlePackageType APPL CFBundleShortVersionString