From 2099d3789c95757b007ce4fbe3f5764ef844ebde Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Mon, 13 Jun 2016 12:30:08 -0700 Subject: [PATCH] Pull iOS build templates from flutter tools vs engine artifacts (#4526) --- .../lib/src/base/file_system.dart | 23 + packages/flutter_tools/lib/src/ios/mac.dart | 31 +- .../lib/src/ios/setup_xcodeproj.dart | 84 +--- packages/flutter_tools/templates/.gitignore | 1 + .../build-ios/Flutter/Flutter.xcconfig | 1 + .../project.pbxproj | 396 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcschemes/Application.xcscheme | 101 +++++ .../xcshareddata/xcschemes/Framework.xcscheme | 80 ++++ .../xcschemes/xcschememanagement.plist | 14 + .../templates/build-ios/Runner/main.m | 12 + 11 files changed, 653 insertions(+), 97 deletions(-) create mode 100644 packages/flutter_tools/templates/.gitignore create mode 100644 packages/flutter_tools/templates/build-ios/Flutter/Flutter.xcconfig create mode 100644 packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.pbxproj create mode 100644 packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Application.xcscheme create mode 100644 packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Framework.xcscheme create mode 100644 packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcuserdata/tvolkert.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 packages/flutter_tools/templates/build-ios/Runner/main.m diff --git a/packages/flutter_tools/lib/src/base/file_system.dart b/packages/flutter_tools/lib/src/base/file_system.dart index 0ba8af0479..1c33ea0c60 100644 --- a/packages/flutter_tools/lib/src/base/file_system.dart +++ b/packages/flutter_tools/lib/src/base/file_system.dart @@ -64,3 +64,26 @@ void ensureDirectoryExists(String filePath) { return; syncFs.directory(dirPath).create(recursive: true); } + +/// Recursively copies a folder from `srcPath` to `destPath` +void copyFolderSync(String srcPath, String destPath) { + dart_io.Directory srcDir = new dart_io.Directory(srcPath); + if (!srcDir.existsSync()) + throw new Exception('Source directory "${srcDir.path}" does not exist, nothing to copy'); + + dart_io.Directory destDir = new dart_io.Directory(destPath); + if (!destDir.existsSync()) + destDir.createSync(recursive: true); + + srcDir.listSync().forEach((dart_io.FileSystemEntity entity) { + String newPath = path.join(destDir.path, path.basename(entity.path)); + if (entity is dart_io.File) { + dart_io.File newFile = new dart_io.File(newPath); + newFile.writeAsBytesSync(entity.readAsBytesSync()); + } else if (entity is dart_io.Directory) { + copyFolderSync(entity.path, newPath); + } else { + throw new Exception('${entity.path} is neither File nor Directory'); + } + }); +} diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index 78540978f7..fd2a452c4e 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -12,7 +12,6 @@ import '../application_package.dart'; import '../base/context.dart'; import '../base/process.dart'; import '../build_info.dart'; -import '../cache.dart'; import '../flx.dart' as flx; import '../globals.dart'; import '../services.dart'; @@ -114,12 +113,9 @@ Future buildXcodeProject({ return new XcodeBuildResult(false); } } else { - updateXcodeGeneratedProperties(flutterProjectPath, mode, target); + updateXcodeGeneratedProperties(flutterProjectPath, mode, target); } - if (!_validateEngineRevision(app)) - return new XcodeBuildResult(false); - if (!_checkXcodeVersion()) return new XcodeBuildResult(false); @@ -200,31 +196,6 @@ bool _checkXcodeVersion() { return true; } -bool _validateEngineRevision(ApplicationPackage app) { - String skyRevision = Cache.engineRevision; - String iosRevision = _getIOSEngineRevision(app); - - if (iosRevision != skyRevision) { - printError("Error: incompatible sky_engine revision."); - printStatus('sky_engine revision: $skyRevision, iOS engine revision: $iosRevision'); - return false; - } else { - printTrace('sky_engine revision: $skyRevision, iOS engine revision: $iosRevision'); - return true; - } -} - -String _getIOSEngineRevision(ApplicationPackage app) { - File revisionFile = new File(path.join(app.rootPath, 'REVISION')); - if (revisionFile.existsSync()) { - // The format is 'REVISION-mode'. We only need the revision. - String revisionStamp = revisionFile.readAsStringSync().trim(); - return revisionStamp.split('-')[0]; - } else { - return null; - } -} - Future _addServicesToBundle(Directory bundle) async { List> services = >[]; printTrace("Trying to resolve native pub services."); diff --git a/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart b/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart index 1145f7941b..aeb2f6ae2b 100644 --- a/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart +++ b/packages/flutter_tools/lib/src/ios/setup_xcodeproj.dart @@ -7,52 +7,11 @@ import 'dart:io'; import 'package:path/path.dart' as path; -import '../base/process.dart'; +import '../base/file_system.dart' show copyFolderSync; import '../build_info.dart'; import '../cache.dart'; import '../globals.dart'; - -bool _inflateXcodeArchive(String directory, List archiveBytes) { - printStatus('Unzipping Xcode project to local directory...'); - - // We cannot use ArchiveFile because this archive contains files that are exectuable - // and there is currently no provision to modify file permissions during - // or after creation. See https://github.com/dart-lang/sdk/issues/15078. - // So we depend on the platform to unzip the archive for us. - - Directory tempDir = Directory.systemTemp.createTempSync('flutter_xcode'); - File tempFile = new File(path.join(tempDir.path, 'FlutterXcode.zip'))..createSync(); - tempFile.writeAsBytesSync(archiveBytes); - - try { - Directory dir = new Directory(directory); - - // Remove the old generated project if one is present - if (dir.existsSync()) - dir.deleteSync(recursive: true); - - // Create the directory so unzip can write to it - dir.createSync(recursive: true); - - // Unzip the Xcode project into the new empty directory - runCheckedSync(['/usr/bin/unzip', tempFile.path, '-d', dir.path]); - } catch (error) { - printTrace('$error'); - return false; - } - - // Cleanup the temp directory after unzipping - tempDir.deleteSync(recursive: true); - - // Verify that we have an Xcode project - Directory flutterProj = new Directory(path.join(directory, 'FlutterApplication.xcodeproj')); - if (!flutterProj.existsSync()) { - printError("${flutterProj.path} does not exist"); - return false; - } - - return true; -} +import '../version.dart'; void updateXcodeGeneratedProperties(String projectPath, BuildMode mode, String target) { StringBuffer localsBuffer = new StringBuffer(); @@ -93,7 +52,7 @@ bool xcodeProjectRequiresUpdate(BuildMode mode) { return true; } - if (revisionFile.readAsStringSync() != '${Cache.engineRevision}-${getModeName(mode)}') { + if (revisionFile.readAsStringSync() != _getCurrentXcodeRevisionString(mode)) { printTrace("The revision stamp and the Flutter engine revision differ or the build mode has changed."); printTrace("Project needs to be updated."); return true; @@ -104,36 +63,27 @@ bool xcodeProjectRequiresUpdate(BuildMode mode) { } Future setupXcodeProjectHarness(String flutterProjectPath, BuildMode mode, String target) async { - // Step 1: Fetch the archive from the cloud + // Step 1: Copy templates into user project directory String iosFilesPath = path.join(flutterProjectPath, 'ios'); - String xcodeprojPath = path.join(iosFilesPath, '.generated'); + String xcodeProjectPath = path.join(iosFilesPath, '.generated'); + String templatesPath = path.join(Cache.flutterRoot, 'packages', 'flutter_tools', 'templates', 'build-ios'); + copyFolderSync(templatesPath, xcodeProjectPath); - Directory toolDir = tools.getEngineArtifactsDirectory(TargetPlatform.ios, mode); - File archiveFile = new File(path.join(toolDir.path, 'FlutterXcode.zip')); - List archiveBytes = archiveFile.readAsBytesSync(); - - if (archiveBytes.isEmpty) { - printError('Error: No archive bytes received.'); - return 1; - } - - // Step 2: Inflate the archive into the user project directory - bool result = _inflateXcodeArchive(xcodeprojPath, archiveBytes); - if (!result) { - printError('Could not inflate the Xcode project archive.'); - return 1; - } - - // Step 3: Populate the Generated.xcconfig with project specific paths + // Step 2: Populate the Generated.xcconfig with project specific paths updateXcodeGeneratedProperties(flutterProjectPath, mode, target); - // Step 4: Write the REVISION file - File revisionFile = new File(path.join(xcodeprojPath, 'REVISION')); + // Step 3: Write the REVISION file + File revisionFile = new File(path.join(xcodeProjectPath, 'REVISION')); revisionFile.createSync(); - revisionFile.writeAsStringSync('${Cache.engineRevision}-${getModeName(mode)}'); + revisionFile.writeAsStringSync(_getCurrentXcodeRevisionString(mode)); - // Step 5: Tell the user the location of the generated project. + // Step 4: Tell the user the location of the generated project. printStatus('Xcode project created in $iosFilesPath/.'); return 0; } + +String _getCurrentXcodeRevisionString(BuildMode mode) => (new StringBuffer() + ..write('${FlutterVersion.getVersion().frameworkRevision}') + ..write('-${tools.isLocalEngine ? tools.engineBuildPath : getModeName(mode)}') + ).toString(); diff --git a/packages/flutter_tools/templates/.gitignore b/packages/flutter_tools/templates/.gitignore new file mode 100644 index 0000000000..9bce6af399 --- /dev/null +++ b/packages/flutter_tools/templates/.gitignore @@ -0,0 +1 @@ +xcuserdata diff --git a/packages/flutter_tools/templates/build-ios/Flutter/Flutter.xcconfig b/packages/flutter_tools/templates/build-ios/Flutter/Flutter.xcconfig new file mode 100644 index 0000000000..592ceee85b --- /dev/null +++ b/packages/flutter_tools/templates/build-ios/Flutter/Flutter.xcconfig @@ -0,0 +1 @@ +#include "Generated.xcconfig" diff --git a/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.pbxproj b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.pbxproj new file mode 100644 index 0000000000..0579cd5cc8 --- /dev/null +++ b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.pbxproj @@ -0,0 +1,396 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 976042271CFB91C5006EFB43 /* Flutter.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 976042261CFB91C5006EFB43 /* Flutter.xcconfig */; }; + 9760422B1CFB925B006EFB43 /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 976042281CFB925B006EFB43 /* app.flx */; }; + 9760422D1CFB925B006EFB43 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9760422A1CFB925B006EFB43 /* Flutter.framework */; }; + 9760422E1CFB92B0006EFB43 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9760422A1CFB925B006EFB43 /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 9766DC6F1CFB93D50041C027 /* app.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9766DC6D1CFB93C80041C027 /* app.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 9E07CFA91BE8280A00BCD8DE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9E07CFA81BE8280A00BCD8DE /* Assets.xcassets */; }; + 9E07CFBA1BE82DFF00BCD8DE /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E07CF9D1BE8280A00BCD8DE /* main.m */; }; + 9EA2FB801C6D2D6B00670B03 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9EA2FB7F1C6D2D6B00670B03 /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9E07CFB91BE82D2600BCD8DE /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 9766DC6F1CFB93D50041C027 /* app.dylib in Embed Frameworks */, + 9760422E1CFB92B0006EFB43 /* Flutter.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 976042261CFB91C5006EFB43 /* Flutter.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Flutter.xcconfig; path = Flutter/Flutter.xcconfig; sourceTree = ""; }; + 976042281CFB925B006EFB43 /* app.flx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = app.flx; path = Flutter/app.flx; sourceTree = ""; }; + 9760422A1CFB925B006EFB43 /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; + 9766DC6D1CFB93C80041C027 /* app.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = app.dylib; path = Flutter/app.dylib; sourceTree = ""; }; + 9E07CF9A1BE8280A00BCD8DE /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 9E07CF9D1BE8280A00BCD8DE /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 9E07CFA81BE8280A00BCD8DE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = ../Assets.xcassets; sourceTree = SOURCE_ROOT; }; + 9E07CFAD1BE8280A00BCD8DE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../Info.plist; sourceTree = SOURCE_ROOT; }; + 9EA2FB7F1C6D2D6B00670B03 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = ../LaunchScreen.storyboard; sourceTree = SOURCE_ROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 9E07CF971BE8280A00BCD8DE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 9760422D1CFB925B006EFB43 /* Flutter.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 976042251CFB918B006EFB43 /* Flutter */ = { + isa = PBXGroup; + children = ( + 9766DC6D1CFB93C80041C027 /* app.dylib */, + 976042281CFB925B006EFB43 /* app.flx */, + 9760422A1CFB925B006EFB43 /* Flutter.framework */, + 976042261CFB91C5006EFB43 /* Flutter.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 9E07CF7C1BE7F4D200BCD8DE = { + isa = PBXGroup; + children = ( + 976042251CFB918B006EFB43 /* Flutter */, + 9E07CF9B1BE8280A00BCD8DE /* Runner */, + 9E07CF871BE7F4D200BCD8DE /* Products */, + ); + sourceTree = ""; + }; + 9E07CF871BE7F4D200BCD8DE /* Products */ = { + isa = PBXGroup; + children = ( + 9E07CF9A1BE8280A00BCD8DE /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 9E07CF9B1BE8280A00BCD8DE /* Runner */ = { + isa = PBXGroup; + children = ( + 9E07CFA81BE8280A00BCD8DE /* Assets.xcassets */, + 9EA2FB7F1C6D2D6B00670B03 /* LaunchScreen.storyboard */, + 9E07CFAD1BE8280A00BCD8DE /* Info.plist */, + 9E07CF9C1BE8280A00BCD8DE /* Supporting Files */, + ); + path = Runner; + sourceTree = ""; + }; + 9E07CF9C1BE8280A00BCD8DE /* Supporting Files */ = { + isa = PBXGroup; + children = ( + 9E07CF9D1BE8280A00BCD8DE /* main.m */, + ); + name = "Supporting Files"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 9E07CF991BE8280A00BCD8DE /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 9E07CFB01BE8280A00BCD8DE /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 977A86B01CF4C31F00432945 /* ShellScript */, + 9E07CF961BE8280A00BCD8DE /* Sources */, + 9E07CF971BE8280A00BCD8DE /* Frameworks */, + 9E07CF981BE8280A00BCD8DE /* Resources */, + 9E07CFB91BE82D2600BCD8DE /* Embed Frameworks */, + 9EA2FB831C6E940F00670B03 /* Copy Native Service Assets */, + 9E046CD71C9CA1AC00A1E391 /* Copy Extra Assets */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 9E07CF9A1BE8280A00BCD8DE /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 9E07CF7D1BE7F4D200BCD8DE /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0710; + ORGANIZATIONNAME = Flutter; + TargetAttributes = { + 9E07CF991BE8280A00BCD8DE = { + CreatedOnToolsVersion = 7.1; + }; + }; + }; + buildConfigurationList = 9E07CF801BE7F4D200BCD8DE /* Build configuration list for PBXProject "FlutterApplication" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 9E07CF7C1BE7F4D200BCD8DE; + productRefGroup = 9E07CF871BE7F4D200BCD8DE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 9E07CF991BE8280A00BCD8DE /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 9E07CF981BE8280A00BCD8DE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9760422B1CFB925B006EFB43 /* app.flx in Resources */, + 976042271CFB91C5006EFB43 /* Flutter.xcconfig in Resources */, + 9EA2FB801C6D2D6B00670B03 /* LaunchScreen.storyboard in Resources */, + 9E07CFA91BE8280A00BCD8DE /* Assets.xcassets in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 977A86B01CF4C31F00432945 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh $FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh"; + }; + 9E046CD71C9CA1AC00A1E391 /* Copy Extra Assets */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Extra Assets"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "RESOURCES_DIR=${SOURCE_ROOT}/../Resources\nAPPLICATION_BUNDLE=${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\n\nshopt -s dotglob\n\nif [ -d \"${RESOURCES_DIR}\" ]; then\n ditto ${RESOURCES_DIR}/ ${APPLICATION_BUNDLE}\nfi\n"; + showEnvVarsInLog = 0; + }; + 9EA2FB831C6E940F00670B03 /* Copy Native Service Assets */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Copy Native Service Assets"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "SERVICE_FRAMEWORKS_DIR=${SOURCE_ROOT}/Frameworks\nSERVICE_DEFINITIONS=${SOURCE_ROOT}/ServiceDefinitions.json\nAPPLICATION_BUNDLE=${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}\n\n# Copy Service Dylibs\nif [ -d \"${SERVICE_FRAMEWORKS_DIR}\" ]; then\nditto ${SERVICE_FRAMEWORKS_DIR} ${APPLICATION_BUNDLE}/Frameworks\nfi\n\nif [[ -n \"${EXPANDED_CODE_SIGN_IDENTITY}\" ]]; then\n\n# Codesign Service Dylibs if an identity is provided.\nDYLIBS=\"${APPLICATION_BUNDLE}/Frameworks/*.dylib\"\nfor dylib in $DYLIBS; do\nxcrun codesign \\\n --force \\\n --sign ${EXPANDED_CODE_SIGN_IDENTITY} \\\n --preserve-metadata=identifier,entitlements \\\n --timestamp=none \\\n \"${dylib}\" \\\n\ndone\n\nfi\n\n# Copy Service Definitions\nif [ -f \"${SERVICE_DEFINITIONS}\" ]; then\ncp ${SERVICE_DEFINITIONS} ${APPLICATION_BUNDLE}/\nfi\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 9E07CF961BE8280A00BCD8DE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 9E07CFBA1BE82DFF00BCD8DE /* main.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 9E07CF8C1BE7F4D200BCD8DE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 976042261CFB91C5006EFB43 /* Flutter.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_BITCODE = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 9E07CF8D1BE7F4D200BCD8DE /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 976042261CFB91C5006EFB43 /* Flutter.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_BITCODE = NO; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_PREPROCESSOR_DEFINITIONS = ""; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + MTL_ENABLE_DEBUG_INFO = NO; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 9E07CFAE1BE8280A00BCD8DE /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 976042261CFB91C5006EFB43 /* Flutter.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Tools/common", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = ../Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/FlutterApplication/Generated", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + 9E07CFAF1BE8280A00BCD8DE /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 976042261CFB91C5006EFB43 /* Flutter.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Tools/common", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = ../Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/FlutterApplication/Generated", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 9E07CF801BE7F4D200BCD8DE /* Build configuration list for PBXProject "FlutterApplication" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9E07CF8C1BE7F4D200BCD8DE /* Debug */, + 9E07CF8D1BE7F4D200BCD8DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 9E07CFB01BE8280A00BCD8DE /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 9E07CFAE1BE8280A00BCD8DE /* Debug */, + 9E07CFAF1BE8280A00BCD8DE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 9E07CF7D1BE7F4D200BCD8DE /* Project object */; +} diff --git a/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000..560d61a2a5 --- /dev/null +++ b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Application.xcscheme b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Application.xcscheme new file mode 100644 index 0000000000..935ff09c82 --- /dev/null +++ b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Application.xcscheme @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Framework.xcscheme b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Framework.xcscheme new file mode 100644 index 0000000000..a8458122cb --- /dev/null +++ b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcshareddata/xcschemes/Framework.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcuserdata/tvolkert.xcuserdatad/xcschemes/xcschememanagement.plist b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcuserdata/tvolkert.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000000..34a2a09b0d --- /dev/null +++ b/packages/flutter_tools/templates/build-ios/FlutterApplication.xcodeproj/xcuserdata/tvolkert.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SuppressBuildableAutocreation + + 9E07CF991BE8280A00BCD8DE + + primary + + + + + diff --git a/packages/flutter_tools/templates/build-ios/Runner/main.m b/packages/flutter_tools/templates/build-ios/Runner/main.m new file mode 100644 index 0000000000..1ddb5c2a7f --- /dev/null +++ b/packages/flutter_tools/templates/build-ios/Runner/main.m @@ -0,0 +1,12 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import +#import + +int main(int argc, const char* argv[]) { + FlutterInit(argc, argv); + return UIApplicationMain(argc, (char**)argv, nil, + NSStringFromClass([FlutterAppDelegate class])); +}