Commit 77103c01 authored by Chinmay Garde's avatar Chinmay Garde

Merge pull request #1941 from chinmaygarde/master

iOS: Treat the initial Info.plist string as a mustache template and use the project name to initialize the bundle name and identifier
parents db729420 dd4361bc
...@@ -91,18 +91,6 @@ Future<bool> _inflateXcodeArchive(String directory, List<int> archiveBytes) asyn ...@@ -91,18 +91,6 @@ Future<bool> _inflateXcodeArchive(String directory, List<int> archiveBytes) asyn
return true; 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) { void _setupXcodeProjXcconfig(String filePath) {
StringBuffer localsBuffer = new StringBuffer(); StringBuffer localsBuffer = new StringBuffer();
...@@ -141,19 +129,15 @@ Future<int> setupXcodeProjectHarness() async { ...@@ -141,19 +129,15 @@ Future<int> setupXcodeProjectHarness() async {
return 1; return 1;
} }
// Step 3: Setup default user editable files if this is the first run of // Step 3: Populate the Local.xcconfig with project specific paths
// the init command.
_writeUserEditableFilesIfNecessary(iosFilesPath);
// Step 4: Populate the Local.xcconfig with project specific paths
_setupXcodeProjXcconfig(path.join(xcodeprojPath, 'Local.xcconfig')); _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')); File revisionFile = new File(path.join(xcodeprojPath, 'REVISION'));
revisionFile.createSync(); revisionFile.createSync();
revisionFile.writeAsStringSync(ArtifactStore.engineRevision); 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('Xcode project created at $xcodeprojPath/.');
printStatus('User editable settings are in $iosFilesPath/.'); printStatus('User editable settings are in $iosFilesPath/.');
...@@ -170,11 +154,11 @@ final String _infoPlistInitialContents = ''' ...@@ -170,11 +154,11 @@ final String _infoPlistInitialContents = '''
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>Runner</string> <string>Runner</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
<string>io.flutter.runner.Runner</string> <string>com.example.{{projectName}}</string>
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Flutter</string> <string>{{projectName}}</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
......
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