diff --git a/dev/README.md b/dev/README.md new file mode 100644 index 000000000000..4690b1901905 --- /dev/null +++ b/dev/README.md @@ -0,0 +1,19 @@ +This directory contains resources that the Flutter team uses during +the development of packages. + +## Luci builder file +`try_builders.json` contains the supported luci try builders +for packages. It follows format: +```json +{ + "builders":[ + { + "name":"yyy", + "repo":"packages", + "enabled":true + } + ] +} +``` +This file will be mainly used in [`flutter/cocoon`](https://github.com/flutter/cocoon) +to trigger/update pre-submit luci tasks. diff --git a/dev/try_builders.json b/dev/try_builders.json new file mode 100644 index 000000000000..6986e9e23dae --- /dev/null +++ b/dev/try_builders.json @@ -0,0 +1,9 @@ +{ + "builders":[ + { + "name":"fuchsia_ctl", + "repo":"packages", + "enabled":true + } + ] +} diff --git a/packages/animations/CHANGELOG.md b/packages/animations/CHANGELOG.md index 3fe05ccf720a..5625d1a6b703 100644 --- a/packages/animations/CHANGELOG.md +++ b/packages/animations/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [1.1.2] - July 28, 2020 + +* Fixes for upcoming changes to the flutter framework. + ## [1.1.1] - June 19, 2020 * Hide implementation of `DualTransitionBuilder` as the widget has been implemented in the Flutter framework. diff --git a/packages/animations/example/lib/fade_through_transition.dart b/packages/animations/example/lib/fade_through_transition.dart index 941a8ada318f..28903f8eb5fb 100644 --- a/packages/animations/example/lib/fade_through_transition.dart +++ b/packages/animations/example/lib/fade_through_transition.dart @@ -49,14 +49,17 @@ class _FadeThroughTransitionDemoState extends State { items: const [ BottomNavigationBarItem( icon: Icon(Icons.photo_library), + // ignore: deprecated_member_use title: Text('Albums'), ), BottomNavigationBarItem( icon: Icon(Icons.photo), + // ignore: deprecated_member_use title: Text('Photos'), ), BottomNavigationBarItem( icon: Icon(Icons.search), + // ignore: deprecated_member_use title: Text('Search'), ), ], diff --git a/packages/animations/lib/src/fade_scale_transition.dart b/packages/animations/lib/src/fade_scale_transition.dart index 63d217c42f15..19d76597ebac 100644 --- a/packages/animations/lib/src/fade_scale_transition.dart +++ b/packages/animations/lib/src/fade_scale_transition.dart @@ -2,13 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart' + hide decelerateEasing; // ignore: undefined_hidden_name +// TODO(goderbauer): Remove implementation import when material properly exports the file. +import 'package:flutter/src/material/curves.dart'; // ignore: implementation_imports // TODO(shihaohong): Remove DualTransitionBuilder once flutter/flutter's `stable` // branch contains DualTransitionBuilder. import 'dual_transition_builder.dart' as dual_transition_builder; import 'modal.dart'; -import 'utils/curves.dart'; /// The modal transition configuration for a Material fade transition. /// diff --git a/packages/animations/lib/src/open_container.dart b/packages/animations/lib/src/open_container.dart index 52743229342d..48c7682e7e7d 100644 --- a/packages/animations/lib/src/open_container.dart +++ b/packages/animations/lib/src/open_container.dart @@ -96,6 +96,7 @@ class OpenContainer extends StatefulWidget { this.transitionDuration = const Duration(milliseconds: 300), this.transitionType = ContainerTransitionType.fade, this.useRootNavigator = false, + this.opaque = true, }) : assert(closedColor != null), assert(openColor != null), assert(closedElevation != null), @@ -107,6 +108,7 @@ class OpenContainer extends StatefulWidget { assert(tappable != null), assert(transitionType != null), assert(useRootNavigator != null), + assert(opaque != null), super(key: key); /// Background color of the container while it is closed. @@ -246,6 +248,11 @@ class OpenContainer extends StatefulWidget { /// to the nearest navigator. final bool useRootNavigator; + /// Whether the route obscures previous routes when the transition is complete. + /// When [opaque] is true, the route obscures previous routes. + /// By default, [opaque] is true. + final bool opaque; + @override _OpenContainerState createState() => _OpenContainerState(); } @@ -281,6 +288,7 @@ class _OpenContainerState extends State> { transitionDuration: widget.transitionDuration, transitionType: widget.transitionType, useRootNavigator: widget.useRootNavigator, + opaque: widget.opaque, )); if (widget.onClosed != null) { widget.onClosed(data); @@ -394,6 +402,7 @@ class _OpenContainerRoute extends ModalRoute { @required this.transitionDuration, @required this.transitionType, @required this.useRootNavigator, + this.opaque = true, }) : assert(closedColor != null), assert(openColor != null), assert(closedElevation != null), @@ -405,6 +414,7 @@ class _OpenContainerRoute extends ModalRoute { assert(closedBuilderKey != null), assert(transitionType != null), assert(useRootNavigator != null), + assert(opaque != null), _elevationTween = Tween( begin: closedElevation, end: openElevation, @@ -546,6 +556,8 @@ class _OpenContainerRoute extends ModalRoute { @override final Duration transitionDuration; + @override + final bool opaque; final ContainerTransitionType transitionType; final bool useRootNavigator; @@ -848,9 +860,6 @@ class _OpenContainerRoute extends ModalRoute { @override Color get barrierColor => null; - @override - bool get opaque => true; - @override bool get barrierDismissible => false; diff --git a/packages/animations/lib/src/shared_axis_transition.dart b/packages/animations/lib/src/shared_axis_transition.dart index 79404304c46c..503386c2179e 100644 --- a/packages/animations/lib/src/shared_axis_transition.dart +++ b/packages/animations/lib/src/shared_axis_transition.dart @@ -4,13 +4,18 @@ import 'package:flutter/animation.dart'; import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; +import 'package:flutter/material.dart' + hide + decelerateEasing, // ignore: undefined_hidden_name + standardEasing, // ignore: undefined_hidden_name + accelerateEasing; // ignore: undefined_hidden_name +// TODO(goderbauer): Remove implementation import when material properly exports the file. +import 'package:flutter/src/material/curves.dart'; // ignore: implementation_imports import 'package:flutter/widgets.dart'; // TODO(shihaohong): Remove DualTransitionBuilder once flutter/flutter's `stable` // branch contains DualTransitionBuilder. import 'dual_transition_builder.dart' as dual_transition_builder; -import 'utils/curves.dart'; /// Determines which type of shared axis transition is used. enum SharedAxisTransitionType { @@ -398,7 +403,7 @@ class _ExitTransition extends StatelessWidget { final Color fillColor; final Widget child; - static final Animatable _fadeOutTransition = FlippedCurveTween( + static final Animatable _fadeOutTransition = _FlippedCurveTween( curve: accelerateEasing, ).chain(CurveTween(curve: const Interval(0.0, 0.3))); @@ -478,3 +483,21 @@ class _ExitTransition extends StatelessWidget { return null; // unreachable } } + +/// Enables creating a flipped [CurveTween]. +/// +/// This creates a [CurveTween] that evaluates to a result that flips the +/// tween vertically. +/// +/// This tween sequence assumes that the evaluated result has to be a double +/// between 0.0 and 1.0. +class _FlippedCurveTween extends CurveTween { + /// Creates a vertically flipped [CurveTween]. + _FlippedCurveTween({ + @required Curve curve, + }) : assert(curve != null), + super(curve: curve); + + @override + double transform(double t) => 1.0 - super.transform(t); +} diff --git a/packages/animations/lib/src/utils/curves.dart b/packages/animations/lib/src/utils/curves.dart deleted file mode 100644 index f464679b1cc3..000000000000 --- a/packages/animations/lib/src/utils/curves.dart +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2019 The Flutter 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 'package:flutter/animation.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; - -// The easing curves of the Material Library -/// The standard easing curve in the Material specification. -/// -/// Elements that begin and end at rest use standard easing. -/// They speed up quickly and slow down gradually, in order -/// to emphasize the end of the transition. -/// -/// See also: -/// * -const Curve standardEasing = Cubic(0.4, 0.0, 0.2, 1); - -/// The accelerate easing curve in the Material specification. -/// -/// Elements exiting a screen use acceleration easing, -/// where they start at rest and end at peak velocity. -/// -/// See also: -/// * -const Curve accelerateEasing = Cubic(0.4, 0.0, 1.0, 1.0); - -/// The decelerate easing curve in the Material specification. -/// -/// Incoming elements are animated using deceleration easing, -/// which starts a transition at peak velocity (the fastest -/// point of an element’s movement) and ends at rest. -/// -/// See also: -/// * -const Curve decelerateEasing = Cubic(0.0, 0.0, 0.2, 1.0); - -// A tween that starts from 1.0 and ends at 0.0. -final Tween _flippedTween = Tween( - begin: 1.0, - end: 0.0, -); - -/// Enables creating a flipped [CurveTween]. -/// -/// This creates a [CurveTween] that evaluates to a result that flips the -/// tween vertically. -/// -/// This tween sequence assumes that the evaluated result has to be a double -/// between 0.0 and 1.0. -class FlippedCurveTween extends CurveTween { - /// Creates a vertically flipped [CurveTween]. - FlippedCurveTween({ - @required Curve curve, - }) : assert(curve != null), - super(curve: curve); - - @override - double transform(double t) => 1.0 - super.transform(t); -} - -/// Flips the incoming passed in [Animation] to start from 1.0 and end at 0.0. -Animation flipTween(Animation animation) { - return _flippedTween.animate(animation); -} diff --git a/packages/animations/pubspec.yaml b/packages/animations/pubspec.yaml index 3635d0f81121..f14256bb50b9 100644 --- a/packages/animations/pubspec.yaml +++ b/packages/animations/pubspec.yaml @@ -1,6 +1,6 @@ name: animations description: Fancy pre-built animations that can easily be integrated into any Flutter application. -version: 1.1.1 +version: 1.1.2 homepage: https://github.com/flutter/packages/tree/master/packages/animations environment: diff --git a/packages/imitation_game/CHANGELOG.md b/packages/imitation_game/CHANGELOG.md new file mode 100644 index 000000000000..d7756211733e --- /dev/null +++ b/packages/imitation_game/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* Initial version (TBD). diff --git a/packages/imitation_game/LICENSE b/packages/imitation_game/LICENSE new file mode 100644 index 000000000000..bc67b8f95568 --- /dev/null +++ b/packages/imitation_game/LICENSE @@ -0,0 +1,27 @@ +Copyright 2019 The Chromium Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/packages/imitation_game/README.md b/packages/imitation_game/README.md new file mode 100644 index 000000000000..5f389b99897e --- /dev/null +++ b/packages/imitation_game/README.md @@ -0,0 +1,103 @@ +# Imitation Game + +## Description + +`imitation_game` is a platform for performing automated tests to compare the +performance of different UI frameworks. For example, how much memory does the +same app written in Flutter and UIKit take? + +## Running all the tests + +You need a mobile device plugged into your computer and setup for development. +The mobile device and the computer need to be on the same network, one that +allows communication between computers since that's how the mobile phone will +report its results to the computer. + +```sh +dart imitation_game.dart +``` + +## Dependencies + +In order to run the tests you will need the union of all the platforms being +tested. As new tests are added please add to this list: + +### iOS + +- Flutter +- Xcode +- [ios_deploy](https://github.com/ios-control/ios-deploy) - used to launch apps + on the attached iOS device. + +## Example File Layout + +```text +./ +├─ imitation_game.dart +└─ imitation_tests/ + ├─ smiley/ + │ ├─ README.md + │ ├─ flutter/ + │ │ ├─ run_ios.sh + │ │ └─ + │ └─ uikit/ + │ ├─ run_ios.sh + │ └─ + └─ memory/ + ├─ README.md + ├─ flutter/ + │ ├─ run_ios.sh + │ └─ + └─ uikit/ + ├─ run_ios.sh + └─ +``` + +Here there are 2 different tests with 2 different platform implementations. The +tests are named `smiley` and `memory`, they are both implemented on the +platforms `flutter` and `uikit`. + +### Adding a test + +Tests should comprise of implementations on one or more platform. The directory +for the test should be added to `./tests`. Inside that directory there should +be a directory of implementations and a `README.md` file that explains the test. + +### Adding an implementation to a test + +An implementation has to follow these rules: + +- It needs to perform the same operations as the other implementations and + follow the description in the test's `README.md`. +- It needs to contain a `run_ios.sh` script that will build and launch the test + on the connected device. +- It should contain a file named `ip.txt` which will be overwritten by + `imitation_game.dart` with the ip address and port that should be used to + report results to. +- It needs to report its results to the ip and port in the `ip.txt` via an HTTP + POST of JSON data. + +## Data format for results + +```json +{ + "test": "name_of_test", + "platform": "name_of_platform", + "results": { + "some_result_name": 1.23, + "some_result_name2": 4.56, + } +} +``` + +A single test run can report multiple numbers. + +## Results +Date created: 2020-08-17 23:57:16.702500Z + +- smiley + - flutter + - startupTime: 0.561475s + - uikit + - startupTime: 0.373102068901062s + diff --git a/packages/imitation_game/bin/imitation_game.dart b/packages/imitation_game/bin/imitation_game.dart new file mode 100644 index 000000000000..59a047d5259e --- /dev/null +++ b/packages/imitation_game/bin/imitation_game.dart @@ -0,0 +1,210 @@ +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'package:mustache/mustache.dart'; +import 'package:imitation_game/README_template.dart'; + +const int _port = 4040; + +Future _findIpAddress() async { + String result; + final List interfaces = await NetworkInterface.list(); + for (NetworkInterface interface in interfaces) { + for (InternetAddress address in interface.addresses) { + if (address.type == InternetAddressType.IPv4) { + // TODO(gaaclarke): Implment having multiple addresses. + assert(result == null); + result = address.address; + } + } + } + return result; +} + +typedef FileFilter = bool Function(FileSystemEntity); +Future> findFiles(Directory dir, {FileFilter where}) { + final List files = []; + final Completer> completer = + Completer>(); + final Stream lister = dir.list(recursive: true); + lister.listen((FileSystemEntity file) { + if (where == null || where(file)) { + files.add(file); + } + }, onDone: () => completer.complete(files)); + return completer.future; +} + +String _makeMarkdownOutput(Map results) { + final Template template = Template(readmeTemplate, name: 'README.md'); + final Map values = Map.from(results); + values['date'] = DateTime.now().toUtc(); + final String output = template.renderString(values); + return output; +} + +class _Script { + _Script({this.path}); + String path; +} + +class _ScriptRunner { + _ScriptRunner(this._scriptPaths); + + final List _scriptPaths; + Process _currentProcess; + StreamSubscription _stdoutSubscription; + StreamSubscription _stderrSubscription; + + Future<_Script> runNext() async { + if (_currentProcess != null) { + _stdoutSubscription.cancel(); + _stderrSubscription.cancel(); + _currentProcess.kill(); + _currentProcess = null; + } + + if (_scriptPaths.isEmpty) { + return null; + } else { + final String path = _scriptPaths.last; + print('running: $path'); + _scriptPaths.removeLast(); + _currentProcess = await Process.start('sh', [path]); + // TODO(gaaclarke): Implement a timeout. + _stdoutSubscription = + _currentProcess.stdout.transform(utf8.decoder).listen((String data) { + print(data); + }); + _stderrSubscription = + _currentProcess.stderr.transform(utf8.decoder).listen((String data) { + print(data); + }); + return _Script(path: path); + } + } +} + +/// Recursively converts a map of maps to a map of lists of maps. +/// +/// For example: +/// _map2List({'a': {'b': 123}}, ['foo', 'bar']) -> +/// { +/// 'foo':[ +/// { +/// 'name': 'a', +/// 'bar': [{'name': 'b', 'value': 123}] +/// } +/// ] +/// } +Map _map2List(Map map, List names) { + final List> returnList = >[]; + final List tail = names.sublist(1); + map.forEach((String key, dynamic value) { + final Map testResult = {'name': key}; + if (tail.isEmpty) { + testResult['value'] = value; + } else { + testResult[tail.first] = _map2List(value, tail)[tail.first]; + } + returnList.add(testResult); + }); + return {names.first: returnList}; +} + +class _ImitationGame { + final Map results = {}; + _ScriptRunner _scriptRunner; + _Script _currentScript; + + Future start(List iosScripts) { + _scriptRunner = _ScriptRunner(iosScripts); + return _runNext(); + } + + Future handleResult(Map data) { + final String test = data['test']; + final String platform = data['platform']; + if (!results.containsKey(test)) { + results[test] = {}; + } + if (!results[test].containsKey(platform)) { + results[test][platform] = {}; + } + data['results'].forEach((String k, dynamic v) { + // ignore: avoid_as + results[test][platform][k] = v as double; + }); + return _runNext(); + } + + Future handleTimeout() { + return _runNext(); + } + + Future _runNext() async { + _currentScript = await _scriptRunner.runNext(); + return _currentScript != null; + } +} + +Future main() async { + final HttpServer server = await HttpServer.bind( + InternetAddress.anyIPv4, + _port, + ); + final String ipaddress = await _findIpAddress(); + print('Listening on $ipaddress:${server.port}'); + + for (FileSystemEntity entity in await findFiles(Directory.current, + where: (FileSystemEntity f) => f.path.endsWith('ip.txt'))) { + final File file = File(entity.path); + file.writeAsStringSync('$ipaddress:${server.port}'); + } + + final List iosScripts = (await findFiles(Directory.current, + where: (FileSystemEntity f) => f.path.endsWith('run_ios.sh'))) + .map((FileSystemEntity e) => e.path) + .toList(); + + if (iosScripts.isEmpty) { + return; + } + + final _ImitationGame game = _ImitationGame(); + bool keepRunning = await game.start(iosScripts); + + while (keepRunning) { + try { + final Stream timeoutServer = server.timeout( + const Duration(minutes: 5), onTimeout: (EventSink sink) { + print('TIMEOUT!'); + throw TimeoutException('timeout'); + }); + await for (HttpRequest request in timeoutServer) { + print('got request: ${request.method}'); + if (request.method == 'POST') { + final String content = await utf8.decoder.bind(request).join(); + final Map data = + // ignore: avoid_as + jsonDecode(content) as Map; + print('$data'); + keepRunning = await game.handleResult(data); + if (!keepRunning) { + break; + } + } else { + request.response.write('use post'); + } + await request.response.close(); + } + } on TimeoutException catch (_) { + keepRunning = await game.handleTimeout(); + } + } + + final Map markdownValues = + _map2List(game.results, ['tests', 'platforms', 'measurements']); + File('README.md').writeAsStringSync(_makeMarkdownOutput(markdownValues)); + await server.close(force: true); +} diff --git a/packages/imitation_game/imitation_tests/smiley/README.md b/packages/imitation_game/imitation_tests/smiley/README.md new file mode 100644 index 000000000000..db2321c19f64 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/README.md @@ -0,0 +1,11 @@ +# Smiley + +This test is an app that just draws one large image to the screen `smiley.png`, +stretched to fit inside the screen. + +The following things are measured: + +- 'startupTime' - The time between the start of the process and the rendering of + the image to the screen. +- 'memory' - The amount of system memory the app is using after having rendered + the image to the screen. diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/run_ios.sh b/packages/imitation_game/imitation_tests/smiley/flutter/run_ios.sh new file mode 100755 index 000000000000..decb485de54c --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/run_ios.sh @@ -0,0 +1,4 @@ +#!/bin/sh +cd $( dirname "${BASH_SOURCE[0]}" ) +cd smiley +flutter run --release diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/.gitignore b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/.gitignore new file mode 100644 index 000000000000..f3c205341e7d --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/.gitignore @@ -0,0 +1,44 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Exceptions to above rules. +!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/.metadata b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/.metadata new file mode 100644 index 000000000000..3f3cbf60a08f --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: 227990ab308574184e06944710bae000330412d0 + channel: unknown + +project_type: app diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/README.md b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/README.md new file mode 100644 index 000000000000..683f68d8b56c --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/README.md @@ -0,0 +1,16 @@ +# smiley + +A new Flutter project. + +## Getting Started + +This project is a starting point for a Flutter application. + +A few resources to get you started if this is your first Flutter project: + +- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) +- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) + +For help getting started with Flutter, view our +[online documentation](https://flutter.dev/docs), which offers tutorials, +samples, guidance on mobile development, and a full API reference. diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/.gitignore b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/.gitignore new file mode 100644 index 000000000000..0a741cb43d66 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/.gitignore @@ -0,0 +1,11 @@ +gradle-wrapper.jar +/.gradle +/captures/ +/gradlew +/gradlew.bat +/local.properties +GeneratedPluginRegistrant.java + +# Remember to never publicly share your keystore. +# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app +key.properties diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/build.gradle b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/build.gradle new file mode 100644 index 000000000000..01823adc6439 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/build.gradle @@ -0,0 +1,63 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withReader('UTF-8') { reader -> + localProperties.load(reader) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +def flutterVersionCode = localProperties.getProperty('flutter.versionCode') +if (flutterVersionCode == null) { + flutterVersionCode = '1' +} + +def flutterVersionName = localProperties.getProperty('flutter.versionName') +if (flutterVersionName == null) { + flutterVersionName = '1.0' +} + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 28 + + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + } + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). + applicationId "com.example.smiley" + minSdkVersion 16 + targetSdkVersion 28 + versionCode flutterVersionCode.toInteger() + versionName flutterVersionName + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/debug/AndroidManifest.xml b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/debug/AndroidManifest.xml new file mode 100644 index 000000000000..81779326ddf4 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/debug/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/AndroidManifest.xml b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/AndroidManifest.xml new file mode 100644 index 000000000000..d377ac5221f5 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/AndroidManifest.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/kotlin/com/example/smiley/MainActivity.kt b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/kotlin/com/example/smiley/MainActivity.kt new file mode 100644 index 000000000000..ccd14efb0159 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/kotlin/com/example/smiley/MainActivity.kt @@ -0,0 +1,6 @@ +package com.example.smiley + +import io.flutter.embedding.android.FlutterActivity + +class MainActivity: FlutterActivity() { +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/drawable/launch_background.xml b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/drawable/launch_background.xml new file mode 100644 index 000000000000..304732f88420 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/drawable/launch_background.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 000000000000..db77bb4b7b09 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 000000000000..17987b79bb8a Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 000000000000..09d4391482be Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 000000000000..d5f1c8d34e7a Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 000000000000..4d6372eebdb2 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/values/styles.xml b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/values/styles.xml new file mode 100644 index 000000000000..1f83a33fd4f2 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/profile/AndroidManifest.xml b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/profile/AndroidManifest.xml new file mode 100644 index 000000000000..81779326ddf4 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/app/src/profile/AndroidManifest.xml @@ -0,0 +1,7 @@ + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/build.gradle b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/build.gradle new file mode 100644 index 000000000000..3100ad2d5553 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/build.gradle @@ -0,0 +1,31 @@ +buildscript { + ext.kotlin_version = '1.3.50' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:3.5.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +allprojects { + repositories { + google() + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} +subprojects { + project.evaluationDependsOn(':app') +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/gradle.properties b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/gradle.properties new file mode 100644 index 000000000000..38c8d4544ff1 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/gradle.properties @@ -0,0 +1,4 @@ +org.gradle.jvmargs=-Xmx1536M +android.enableR8=true +android.useAndroidX=true +android.enableJetifier=true diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/gradle/wrapper/gradle-wrapper.properties b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 000000000000..296b146b7318 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Fri Jun 23 08:50:38 CEST 2017 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/settings.gradle b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/settings.gradle new file mode 100644 index 000000000000..44e62bcf06ae --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/android/settings.gradle @@ -0,0 +1,11 @@ +include ':app' + +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() + +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + +def flutterSdkPath = properties.getProperty("flutter.sdk") +assert flutterSdkPath != null, "flutter.sdk not set in local.properties" +apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/assets/ip.txt b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/assets/ip.txt new file mode 100644 index 000000000000..d331e21174a0 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/assets/ip.txt @@ -0,0 +1 @@ +192.168.0.18:4040 \ No newline at end of file diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/images/smiley.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/images/smiley.png new file mode 100644 index 000000000000..441b66ae8922 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/images/smiley.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/.gitignore b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/.gitignore new file mode 100644 index 000000000000..e96ef602b8d1 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/.gitignore @@ -0,0 +1,32 @@ +*.mode1v3 +*.mode2v3 +*.moved-aside +*.pbxuser +*.perspectivev3 +**/*sync/ +.sconsign.dblite +.tags* +**/.vagrant/ +**/DerivedData/ +Icon? +**/Pods/ +**/.symlinks/ +profile +xcuserdata +**/.generated/ +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Flutter.podspec +Flutter/Generated.xcconfig +Flutter/app.flx +Flutter/app.zip +Flutter/flutter_assets/ +Flutter/flutter_export_environment.sh +ServiceDefinitions.json +Runner/GeneratedPluginRegistrant.* + +# Exceptions to above rules. +!default.mode1v3 +!default.mode2v3 +!default.pbxuser +!default.perspectivev3 diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/AppFrameworkInfo.plist b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/AppFrameworkInfo.plist new file mode 100644 index 000000000000..6b4c0f78a785 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/AppFrameworkInfo.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + App + CFBundleIdentifier + io.flutter.flutter.app + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + App + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1.0 + MinimumOSVersion + 8.0 + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/Debug.xcconfig b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/Debug.xcconfig new file mode 100644 index 000000000000..e8efba114687 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/Debug.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/Release.xcconfig b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/Release.xcconfig new file mode 100644 index 000000000000..399e9340e6f6 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Flutter/Release.xcconfig @@ -0,0 +1,2 @@ +#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" +#include "Generated.xcconfig" diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Podfile b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Podfile new file mode 100644 index 000000000000..6697f0a539e2 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Podfile @@ -0,0 +1,87 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def parse_KV_file(file, separator='=') + file_abs_path = File.expand_path(file) + if !File.exists? file_abs_path + return []; + end + generated_key_values = {} + skip_line_start_symbols = ["#", "/"] + File.foreach(file_abs_path) do |line| + next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } + plugin = line.split(pattern=separator) + if plugin.length == 2 + podname = plugin[0].strip() + path = plugin[1].strip() + podpath = File.expand_path("#{path}", file_abs_path) + generated_key_values[podname] = podpath + else + puts "Invalid plugin specification: #{line}" + end + end + generated_key_values +end + +target 'Runner' do + use_frameworks! + use_modular_headers! + + # Flutter Pod + + copied_flutter_dir = File.join(__dir__, 'Flutter') + copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') + copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') + unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) + # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. + # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. + # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. + + generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') + unless File.exist?(generated_xcode_build_settings_path) + raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) + cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; + + unless File.exist?(copied_framework_path) + FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) + end + unless File.exist?(copied_podspec_path) + FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) + end + end + + # Keep pod path relative so it can be checked into Podfile.lock. + pod 'Flutter', :path => 'Flutter' + + # Plugin Pods + + # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock + # referring to absolute paths on developers' machines. + system('rm -rf .symlinks') + system('mkdir -p .symlinks/plugins') + plugin_pods = parse_KV_file('../.flutter-plugins') + plugin_pods.each do |name, path| + symlink = File.join('.symlinks', 'plugins', name) + File.symlink(path, symlink) + pod name, :path => File.join(symlink, 'ios') + end +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + target.build_configurations.each do |config| + config.build_settings['ENABLE_BITCODE'] = 'NO' + end + end +end diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.pbxproj b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..24067aa41683 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.pbxproj @@ -0,0 +1,576 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; + E871A0843F25069A572B8976 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6ED58CA389D243E9D25A3BCF /* Pods_Runner.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 1653BF8CF7D70B08243DF6A2 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; + 1A3DE4B0B684E0679C64523E /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 6ED58CA389D243E9D25A3BCF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C4C62015C2EE2797ABF091BA /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + E871A0843F25069A572B8976 /* Pods_Runner.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 2BE839568BFB70043910F5F6 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 6ED58CA389D243E9D25A3BCF /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 8E5CD0CA74B3FF8D250A4283 /* Pods */ = { + isa = PBXGroup; + children = ( + 1A3DE4B0B684E0679C64523E /* Pods-Runner.debug.xcconfig */, + C4C62015C2EE2797ABF091BA /* Pods-Runner.release.xcconfig */, + 1653BF8CF7D70B08243DF6A2 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + 8E5CD0CA74B3FF8D250A4283 /* Pods */, + 2BE839568BFB70043910F5F6 /* Frameworks */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + CAB15821656924BCC3058D97 /* [CP] Check Pods Manifest.lock */, + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + DBD650350FBE96B42D816E77 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; + CAB15821656924BCC3058D97 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; + DBD650350FBE96B42D816E77 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + 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; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = S8QB4VV633; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.smiley; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + 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"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + 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; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = S8QB4VV633; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.smiley; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + DEVELOPMENT_TEAM = S8QB4VV633; + ENABLE_BITCODE = NO; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Flutter", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.example.smiley; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..1d526a16ed0f --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme new file mode 100644 index 000000000000..a28140cfdb3f --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..21a3cc14c74e --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 000000000000..f9b0d7c5ea15 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + PreviewsEnabled + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/AppDelegate.swift b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/AppDelegate.swift new file mode 100644 index 000000000000..70693e4a8c12 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/AppDelegate.swift @@ -0,0 +1,13 @@ +import UIKit +import Flutter + +@UIApplicationMain +@objc class AppDelegate: FlutterAppDelegate { + override func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + GeneratedPluginRegistrant.register(with: self) + return super.application(application, didFinishLaunchingWithOptions: launchOptions) + } +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..d36b1fab2d9d --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,122 @@ +{ + "images" : [ + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "iphone", + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "iphone", + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" + }, + { + "size" : "60x60", + "idiom" : "iphone", + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" + }, + { + "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" + }, + { + "size" : "29x29", + "idiom" : "ipad", + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" + }, + { + "size" : "40x40", + "idiom" : "ipad", + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" + }, + { + "size" : "76x76", + "idiom" : "ipad", + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" + }, + { + "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Icon-App-1024x1024@1x.png", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png new file mode 100644 index 000000000000..dc9ada4725e9 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png new file mode 100644 index 000000000000..28c6bf03016f Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000000..2ccbfd967d96 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png new file mode 100644 index 000000000000..f091b6b0bca8 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png new file mode 100644 index 000000000000..4cde12118dda Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png new file mode 100644 index 000000000000..d0ef06e7edb8 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png new file mode 100644 index 000000000000..dcdc2306c285 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png new file mode 100644 index 000000000000..2ccbfd967d96 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png new file mode 100644 index 000000000000..c8f9ed8f5cee Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png new file mode 100644 index 000000000000..a6d6b8609df0 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png new file mode 100644 index 000000000000..a6d6b8609df0 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png new file mode 100644 index 000000000000..75b2d164a5a9 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png new file mode 100644 index 000000000000..c4df70d39da7 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png new file mode 100644 index 000000000000..6a84f41e14e2 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png new file mode 100644 index 000000000000..d0e1f5853602 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 000000000000..0bedcf2fd467 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 000000000000..9da19eacad3b Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md new file mode 100644 index 000000000000..89c2725b70f1 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md @@ -0,0 +1,5 @@ +# Launch Screen Assets + +You can customize the launch screen with your own desired assets by replacing the image files in this directory. + +You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..f2e259c7c939 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Base.lproj/Main.storyboard b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..f3c28516fb38 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Base.lproj/Main.storyboard @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Info.plist b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Info.plist new file mode 100644 index 000000000000..9907fcda4d9c --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + smiley + CFBundlePackageType + APPL + CFBundleShortVersionString + $(FLUTTER_BUILD_NAME) + CFBundleSignature + ???? + CFBundleVersion + $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + + diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Runner-Bridging-Header.h b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Runner-Bridging-Header.h new file mode 100644 index 000000000000..308a2a560b42 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/ios/Runner/Runner-Bridging-Header.h @@ -0,0 +1 @@ +#import "GeneratedPluginRegistrant.h" diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/lib/main.dart b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/lib/main.dart new file mode 100644 index 000000000000..0dcab31f25fa --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/lib/main.dart @@ -0,0 +1,110 @@ +// Copyright 2020 The Flutter 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 'dart:convert' show jsonEncode; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:http/http.dart' as http; +import 'package:poll_ios_stats/poll_ios_stats.dart'; + +String _hostIp; + +Future _getHostIp() async { + return await rootBundle.loadString('assets/ip.txt'); +} + +Future _sendResult(double result) async { + assert(_hostIp != null); + print('sending result $result...'); + final http.Response response = await http.post( + 'http://$_hostIp', + headers: { + 'Content-Type': 'application/json; charset=UTF-8', + }, + body: jsonEncode({ + 'test': 'smiley', + 'platform': 'flutter', + 'results': {'startupTime': result}, + }), + ); + if (response.statusCode != 200) { + print('error when posting results:${response.statusCode}'); + } +} + +void main() { + runApp(MyApp()); + // Hide status bar. + SystemChrome.setEnabledSystemUIOverlays([]); + _getHostIp().then((String ip) async { + _hostIp = ip; + }); +} + +/// Top level Material App. +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Flutter Demo', + theme: ThemeData( + primarySwatch: Colors.blue, + visualDensity: VisualDensity.adaptivePlatformDensity, + ), + home: const MyHomePage(), + ); + } +} + +/// `Scaffold` that has the image widget. +class MyHomePage extends StatefulWidget { + /// Standard constructor for a StatefulWidget. + const MyHomePage({Key key}) : super(key: key); + + @override + _MyHomePageState createState() => _MyHomePageState(); +} + +class _MyHomePageState extends State { + final AssetImage _image = const AssetImage('images/smiley.png'); + bool _loading = true; + + @override + void initState() { + _image + .resolve(const ImageConfiguration()) + .addListener(ImageStreamListener((_, __) { + if (mounted) { + setState(() { + _loading = false; + // This should get called when the image has actually been drawn to the screen. + WidgetsBinding.instance.addPostFrameCallback((_) async { + final DateTime renderTime = DateTime.now(); + final PollIosStats _poller = PollIosStats(); + final StartupTime startupTime = await _poller.pollStartupTime(); + final Duration diff = renderTime.difference( + DateTime.fromMicrosecondsSinceEpoch(startupTime.startupTime)); + _sendResult(diff.inMicroseconds / 1000000.0); + }); + }); + } + })); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _loading ? Container() : Image(image: _image), + ], + ), + ), + ); + } +} diff --git a/packages/imitation_game/imitation_tests/smiley/flutter/smiley/pubspec.yaml b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/pubspec.yaml new file mode 100644 index 000000000000..6d8e6cc49748 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/flutter/smiley/pubspec.yaml @@ -0,0 +1,78 @@ +name: smiley +description: A new Flutter project. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.7.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^0.1.3 + http: ^0.12.2 + poll_ios_stats: ^0.0.1 + +dev_dependencies: + flutter_test: + sdk: flutter + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add assets to your application, add an assets section, like this: + assets: + - images/smiley.png + - assets/ip.txt + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/assets-and-images/#resolution-aware. + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/assets-and-images/#from-packages + + # To add custom fonts to your application, add a fonts section here, + # in this "flutter" section. Each entry in this list should have a + # "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/custom-fonts/#from-packages diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/run_ios.sh b/packages/imitation_game/imitation_tests/smiley/uikit/run_ios.sh new file mode 100755 index 000000000000..794db7247a76 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/run_ios.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# TODO: What about customizing the DEVELOPMENT_TEAM? +set -e +cd $( dirname "${BASH_SOURCE[0]}" ) +cd smiley +xcodebuild -scheme smiley -configuration Release -project smiley.xcodeproj -archivePath ./smiley.xcarchive archive +xcodebuild -exportArchive -archivePath ./smiley.xcarchive/ -exportPath . -exportOptionsPlist exportOptions.plist -allowProvisioningUpdates +ios-deploy --justlaunch --bundle ./smiley.xcarchive/Products/Applications/smiley.app diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/exportOptions.plist b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/exportOptions.plist new file mode 100644 index 000000000000..687b403b2208 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/exportOptions.plist @@ -0,0 +1,18 @@ + + + + + compileBitcode + + method + development + signingStyle + automatic + stripSwiftSymbols + + teamID + S8QB4VV633 + thinning + <none> + + diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.pbxproj b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.pbxproj new file mode 100644 index 000000000000..aca7bdbfa676 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.pbxproj @@ -0,0 +1,350 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 0D313B6D24C6613900D7044B /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D313B6C24C6613900D7044B /* AppDelegate.m */; }; + 0D313B7024C6613900D7044B /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D313B6F24C6613900D7044B /* SceneDelegate.m */; }; + 0D313B7324C6613900D7044B /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D313B7224C6613900D7044B /* ViewController.m */; }; + 0D313B7624C6613900D7044B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0D313B7424C6613900D7044B /* Main.storyboard */; }; + 0D313B7824C6613A00D7044B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 0D313B7724C6613A00D7044B /* Assets.xcassets */; }; + 0D313B7B24C6613A00D7044B /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0D313B7924C6613A00D7044B /* LaunchScreen.storyboard */; }; + 0D313B7E24C6613A00D7044B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D313B7D24C6613A00D7044B /* main.m */; }; + 0D313B8524C66AB700D7044B /* ip.txt in Resources */ = {isa = PBXBuildFile; fileRef = 0D313B8424C66AB700D7044B /* ip.txt */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 0D313B6824C6613900D7044B /* smiley.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = smiley.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 0D313B6B24C6613900D7044B /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + 0D313B6C24C6613900D7044B /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + 0D313B6E24C6613900D7044B /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = ""; }; + 0D313B6F24C6613900D7044B /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = ""; }; + 0D313B7124C6613900D7044B /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + 0D313B7224C6613900D7044B /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + 0D313B7524C6613900D7044B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 0D313B7724C6613A00D7044B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 0D313B7A24C6613A00D7044B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 0D313B7C24C6613A00D7044B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 0D313B7D24C6613A00D7044B /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 0D313B8424C66AB700D7044B /* ip.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = ip.txt; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 0D313B6524C6613900D7044B /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 0D313B5F24C6613900D7044B = { + isa = PBXGroup; + children = ( + 0D313B6A24C6613900D7044B /* smiley */, + 0D313B6924C6613900D7044B /* Products */, + ); + sourceTree = ""; + }; + 0D313B6924C6613900D7044B /* Products */ = { + isa = PBXGroup; + children = ( + 0D313B6824C6613900D7044B /* smiley.app */, + ); + name = Products; + sourceTree = ""; + }; + 0D313B6A24C6613900D7044B /* smiley */ = { + isa = PBXGroup; + children = ( + 0D313B6B24C6613900D7044B /* AppDelegate.h */, + 0D313B6C24C6613900D7044B /* AppDelegate.m */, + 0D313B6E24C6613900D7044B /* SceneDelegate.h */, + 0D313B6F24C6613900D7044B /* SceneDelegate.m */, + 0D313B7124C6613900D7044B /* ViewController.h */, + 0D313B7224C6613900D7044B /* ViewController.m */, + 0D313B7424C6613900D7044B /* Main.storyboard */, + 0D313B7724C6613A00D7044B /* Assets.xcassets */, + 0D313B7924C6613A00D7044B /* LaunchScreen.storyboard */, + 0D313B7C24C6613A00D7044B /* Info.plist */, + 0D313B7D24C6613A00D7044B /* main.m */, + 0D313B8424C66AB700D7044B /* ip.txt */, + ); + path = smiley; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 0D313B6724C6613900D7044B /* smiley */ = { + isa = PBXNativeTarget; + buildConfigurationList = 0D313B8124C6613A00D7044B /* Build configuration list for PBXNativeTarget "smiley" */; + buildPhases = ( + 0D313B6424C6613900D7044B /* Sources */, + 0D313B6524C6613900D7044B /* Frameworks */, + 0D313B6624C6613900D7044B /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = smiley; + productName = smiley; + productReference = 0D313B6824C6613900D7044B /* smiley.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0D313B6024C6613900D7044B /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1150; + ORGANIZATIONNAME = "Aaron Clarke"; + TargetAttributes = { + 0D313B6724C6613900D7044B = { + CreatedOnToolsVersion = 11.5; + }; + }; + }; + buildConfigurationList = 0D313B6324C6613900D7044B /* Build configuration list for PBXProject "smiley" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 0D313B5F24C6613900D7044B; + productRefGroup = 0D313B6924C6613900D7044B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 0D313B6724C6613900D7044B /* smiley */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 0D313B6624C6613900D7044B /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0D313B7B24C6613A00D7044B /* LaunchScreen.storyboard in Resources */, + 0D313B8524C66AB700D7044B /* ip.txt in Resources */, + 0D313B7824C6613A00D7044B /* Assets.xcassets in Resources */, + 0D313B7624C6613900D7044B /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 0D313B6424C6613900D7044B /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 0D313B7324C6613900D7044B /* ViewController.m in Sources */, + 0D313B6D24C6613900D7044B /* AppDelegate.m in Sources */, + 0D313B7E24C6613A00D7044B /* main.m in Sources */, + 0D313B7024C6613900D7044B /* SceneDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 0D313B7424C6613900D7044B /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 0D313B7524C6613900D7044B /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 0D313B7924C6613A00D7044B /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 0D313B7A24C6613A00D7044B /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 0D313B7F24C6613A00D7044B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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 = 13.5; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + 0D313B8024C6613A00D7044B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + 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 = 13.5; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 0D313B8224C6613A00D7044B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S8QB4VV633; + INFOPLIST_FILE = smiley/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "dev.flutter.imitation-game.smiley"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 0D313B8324C6613A00D7044B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = S8QB4VV633; + INFOPLIST_FILE = smiley/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "dev.flutter.imitation-game.smiley"; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 0D313B6324C6613900D7044B /* Build configuration list for PBXProject "smiley" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0D313B7F24C6613A00D7044B /* Debug */, + 0D313B8024C6613A00D7044B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 0D313B8124C6613A00D7044B /* Build configuration list for PBXNativeTarget "smiley" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 0D313B8224C6613A00D7044B /* Debug */, + 0D313B8324C6613A00D7044B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0D313B6024C6613900D7044B /* Project object */; +} diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000000..1ba2d6e1c0d4 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000000..18d981003d68 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/AppDelegate.h b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/AppDelegate.h new file mode 100644 index 000000000000..9a7d7f20dea6 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/AppDelegate.h @@ -0,0 +1,9 @@ +// Copyright 2020 The Flutter 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 + +@interface AppDelegate : UIResponder + +@end diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/AppDelegate.m b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/AppDelegate.m new file mode 100644 index 000000000000..cac844f52dd6 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/AppDelegate.m @@ -0,0 +1,38 @@ +// Copyright 2020 The Flutter 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 "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + +- (BOOL)application:(UIApplication *)application + didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + +#pragma mark - UISceneSession lifecycle + +- (UISceneConfiguration *)application:(UIApplication *)application + configurationForConnectingSceneSession:(UISceneSession *)connectingSceneSession + options:(UISceneConnectionOptions *)options { + // Called when a new scene session is being created. + // Use this method to select a configuration to create the new scene with. + return [[UISceneConfiguration alloc] initWithName:@"Default Configuration" + sessionRole:connectingSceneSession.role]; +} + +- (void)application:(UIApplication *)application + didDiscardSceneSessions:(NSSet *)sceneSessions { + // Called when the user discards a scene session. + // If any sessions were discarded while the application was not running, this will be called + // shortly after application:didFinishLaunchingWithOptions. Use this method to release any + // resources that were specific to the discarded scenes, as they will not return. +} + +@end diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 000000000000..9221b9bb1a35 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "20x20" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "29x29" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "40x40" + }, + { + "idiom" : "iphone", + "scale" : "2x", + "size" : "60x60" + }, + { + "idiom" : "iphone", + "scale" : "3x", + "size" : "60x60" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" + }, + { + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "76x76" + }, + { + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" + }, + { + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/Contents.json b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/Contents.json new file mode 100644 index 000000000000..73c00596a7fc --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/smiley.imageset/Contents.json b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/smiley.imageset/Contents.json new file mode 100644 index 000000000000..79308c15f26c --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/smiley.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "smiley.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/smiley.imageset/smiley.png b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/smiley.imageset/smiley.png new file mode 100644 index 000000000000..441b66ae8922 Binary files /dev/null and b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Assets.xcassets/smiley.imageset/smiley.png differ diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Base.lproj/LaunchScreen.storyboard b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 000000000000..865e9329f376 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Base.lproj/Main.storyboard b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Base.lproj/Main.storyboard new file mode 100644 index 000000000000..4f0a58ac372e --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Base.lproj/Main.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Info.plist b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Info.plist new file mode 100644 index 000000000000..7b6037c25e51 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/Info.plist @@ -0,0 +1,64 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + SceneDelegate + UISceneStoryboardFile + Main + + + + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/SceneDelegate.h b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/SceneDelegate.h new file mode 100644 index 000000000000..bc46a078a237 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/SceneDelegate.h @@ -0,0 +1,11 @@ +// Copyright 2020 The Flutter 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 + +@interface SceneDelegate : UIResponder + +@property(strong, nonatomic) UIWindow* window; + +@end diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/SceneDelegate.m b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/SceneDelegate.m new file mode 100644 index 000000000000..061f723671d3 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/SceneDelegate.m @@ -0,0 +1,52 @@ +// Copyright 2020 The Flutter 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 "SceneDelegate.h" + +@interface SceneDelegate () + +@end + +@implementation SceneDelegate + +- (void)scene:(UIScene *)scene + willConnectToSession:(UISceneSession *)session + options:(UISceneConnectionOptions *)connectionOptions { + // Use this method to optionally configure and attach the UIWindow `window` to the provided + // UIWindowScene `scene`. If using a storyboard, the `window` property will automatically be + // initialized and attached to the scene. This delegate does not imply the connecting scene or + // session are new (see `application:configurationForConnectingSceneSession` instead). +} + +- (void)sceneDidDisconnect:(UIScene *)scene { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene + // connects. The scene may re-connect later, as its session was not neccessarily discarded (see + // `application:didDiscardSceneSessions` instead). +} + +- (void)sceneDidBecomeActive:(UIScene *)scene { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was + // inactive. +} + +- (void)sceneWillResignActive:(UIScene *)scene { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). +} + +- (void)sceneWillEnterForeground:(UIScene *)scene { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. +} + +- (void)sceneDidEnterBackground:(UIScene *)scene { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state + // information to restore the scene back to its current state. +} + +@end diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ViewController.h b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ViewController.h new file mode 100644 index 000000000000..a3585bf5c130 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ViewController.h @@ -0,0 +1,10 @@ +// Copyright 2020 The Flutter 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 + +@interface ViewController : UIViewController +@property(nonatomic, strong) IBOutlet UIImageView* imageView; + +@end diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ViewController.m b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ViewController.m new file mode 100644 index 000000000000..deaa9bb8921d --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ViewController.m @@ -0,0 +1,114 @@ +// Copyright 2020 The Flutter 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 "ViewController.h" +#import +#import +#import + +static int64_t loadStartupTime(NSError **error) { + pid_t pid = [[NSProcessInfo processInfo] processIdentifier]; + int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, pid}; + struct kinfo_proc proc; + size_t size = sizeof(proc); + int err = sysctl(mib, 4, &proc, &size, NULL, 0); + if (err != 0) { + int errCode = errno; + if (error) { + *error = [NSError errorWithDomain:@"smiley" code:errCode userInfo:@{}]; + } + return 0; + } + + struct timeval startTime = proc.kp_proc.p_starttime; + int64_t microsecondsInSecond = 1000000LL; + int64_t microsecondsSinceEpoch = + (int64_t)(startTime.tv_sec * microsecondsInSecond) + (int64_t)startTime.tv_usec; + + return microsecondsSinceEpoch; +} + +static NSString *loadIpAddress() { +#if TARGET_IPHONE_SIMULATOR + return @"127.0.0.1:4040"; +#else + NSString *ipPath = [[NSBundle mainBundle] pathForResource:@"ip" ofType:@"txt"]; + NSError *err; + NSString *ipAddress = + [NSString stringWithContentsOfFile:ipPath encoding:NSUTF8StringEncoding error:&err]; + assert(err == nil); + return + [ipAddress stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; +#endif +} + +static void sendResults(NSTimeInterval result) { + NSLog(@"send results:%f", result); + NSString *ipAddress = loadIpAddress(); + NSString *url = [NSString stringWithFormat:@"http://%@", ipAddress]; + NSMutableURLRequest *urlRequest = + [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]]; + NSDictionary *payload = @{ + @"test" : @"smiley", + @"platform" : @"uikit", + @"results" : @{ + @"startupTime" : @(result), + } + }; + NSError *error; + NSData *jsonData = [NSJSONSerialization dataWithJSONObject:payload options:0 error:&error]; + assert(error == nil && jsonData); + [urlRequest setHTTPMethod:@"POST"]; + [urlRequest setHTTPBody:jsonData]; + + NSURLSession *session = [NSURLSession sharedSession]; + NSURLSessionDataTask *dataTask = + [session dataTaskWithRequest:urlRequest + completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) { + NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; + if (httpResponse.statusCode != 200) { + NSLog(@"Error %@ '%@'", error, url); + } + }]; + [dataTask resume]; +} + +@interface ViewController () +@property(nonatomic, strong) CADisplayLink *displayLink; +@end + +@implementation ViewController { + BOOL _waitingForDraw; +} + +- (void)viewDidLoad { + [super viewDidLoad]; +} + +- (void)loadView { + [super loadView]; + self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(onTick:)]; + [self.displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; + self.imageView.image = [UIImage imageNamed:@"smiley"]; + _waitingForDraw = YES; +} + +- (BOOL)prefersStatusBarHidden { + return YES; +} + +- (void)onTick:(CADisplayLink *)sender { + if (_waitingForDraw) { + int64_t epochTime = loadStartupTime(nil); + NSTimeInterval epocTimeSeconds = (double)epochTime / 1000000.0; + NSDate *startTime = [NSDate dateWithTimeIntervalSince1970:epocTimeSeconds]; + NSTimeInterval runTime = [[NSDate now] timeIntervalSinceDate:startTime]; + sendResults(runTime); + _waitingForDraw = NO; + [self.displayLink invalidate]; + self.displayLink = nil; + } +} + +@end diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ip.txt b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ip.txt new file mode 100644 index 000000000000..d331e21174a0 --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/ip.txt @@ -0,0 +1 @@ +192.168.0.18:4040 \ No newline at end of file diff --git a/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/main.m b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/main.m new file mode 100644 index 000000000000..9098614813ea --- /dev/null +++ b/packages/imitation_game/imitation_tests/smiley/uikit/smiley/smiley/main.m @@ -0,0 +1,15 @@ +// Copyright 2020 The Flutter 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 "AppDelegate.h" + +int main(int argc, char* argv[]) { + NSString* appDelegateClassName; + @autoreleasepool { + // Setup code that might create autoreleased objects goes here. + appDelegateClassName = NSStringFromClass([AppDelegate class]); + } + return UIApplicationMain(argc, argv, nil, appDelegateClassName); +} diff --git a/packages/imitation_game/lib/README_template.dart b/packages/imitation_game/lib/README_template.dart new file mode 100644 index 000000000000..be3443ee40da --- /dev/null +++ b/packages/imitation_game/lib/README_template.dart @@ -0,0 +1,109 @@ +/// Mustache template used for generating README.md. +String readmeTemplate = """# Imitation Game + +## Description + +`imitation_game` is a platform for performing automated tests to compare the +performance of different UI frameworks. For example, how much memory does the +same app written in Flutter and UIKit take? + +## Running all the tests + +You need a mobile device plugged into your computer and setup for development. +The mobile device and the computer need to be on the same network, one that +allows communication between computers since that's how the mobile phone will +report its results to the computer. + +```sh +dart imitation_game.dart +``` + +## Dependencies + +In order to run the tests you will need the union of all the platforms being +tested. As new tests are added please add to this list: + +### iOS + +- Flutter +- Xcode +- [ios_deploy](https://github.com/ios-control/ios-deploy) - used to launch apps + on the attached iOS device. + +## Example File Layout + +```text +./ +├─ imitation_game.dart +└─ tests/ + ├─ smiley/ + │ ├─ README.md + │ ├─ flutter/ + │ │ ├─ run_ios.sh + │ │ └─ + │ └─ uikit/ + │ ├─ run_ios.sh + │ └─ + └─ memory/ + ├─ README.md + ├─ flutter/ + │ ├─ run_ios.sh + │ └─ + └─ uikit/ + ├─ run_ios.sh + └─ +``` + +Here there are 2 different tests with 2 different platform implementations. The +tests are named `smiley` and `memory`, they are both implemented on the +platforms `flutter` and `uikit`. + +### Adding a test + +Tests should comprise of implementations on one or more platform. The directory +for the test should be added to `./tests`. Inside that directory there should +be a directory of implementations and a `README.md` file that explains the test. + +### Adding an implementation to a test + +An implementation has to follow these rules: + +- It needs to perform the same operations as the other implementations and + follow the description in the test's `README.md`. +- It needs to contain a `run_ios.sh` script that will build and launch the test + on the connected device. +- It should contain a file named `ip.txt` which will be overwritten by + `imitation_game.dart` with the ip address and port that should be used to + report results to. +- It needs to report its results to the ip and port in the `ip.txt` via an HTTP + POST of JSON data. + +## Data format for results + +```json +{ + "test": "name_of_test", + "platform": "name_of_platform", + "results": { + "some_result_name": 1.23, + "some_result_name2": 4.56, + } +} +``` + +A single test run can report multiple numbers. + +## Results +Date created: {{date}} + +{{#tests}} +- {{name}} + {{#platforms}} + - {{name}} + {{#measurements}} + - {{name}}: {{value}}s + {{/measurements}} + {{/platforms}} +{{/tests}} + +"""; diff --git a/packages/imitation_game/lib/imitation_game.dart b/packages/imitation_game/lib/imitation_game.dart new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/packages/imitation_game/lib/imitation_game.dart @@ -0,0 +1 @@ + diff --git a/packages/imitation_game/pubspec.yaml b/packages/imitation_game/pubspec.yaml new file mode 100644 index 000000000000..931556b15d63 --- /dev/null +++ b/packages/imitation_game/pubspec.yaml @@ -0,0 +1,8 @@ +name: imitation_game +version: 0.0.1 +description: Testing framework for comparing multiple frameworks' performance. +homepage: https://github.com/flutter/packages/tree/master/packages/imitation_game +dependencies: + mustache: ^1.1.1 +environment: + sdk: ">=1.8.0 <3.0.0" diff --git a/packages/imitation_game/run.sh b/packages/imitation_game/run.sh new file mode 100755 index 000000000000..f29e0eb4fba2 --- /dev/null +++ b/packages/imitation_game/run.sh @@ -0,0 +1 @@ +pub run imitation_game diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 403788f838e8..f3622b48ab7c 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,15 @@ +## 0.1.4 + +* Fixed nullability for NSError's in generated objc code. +* Fixed nullability of nested objects in the Dart generator. +* Added test to make sure the pigeon version is correct in generated code headers. + +## 0.1.3 + +* Added error message if supported datatypes are used as arguments or return + types directly, without an enclosing class. +* Added support for List and Map datatypes in Java and Objective-C targets. + ## 0.1.2+1 * Updated the Readme.md. diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index 989f9d3a9258..baea13ecb367 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -151,7 +151,8 @@ void generateDart(Root root, StringSink sink) { for (Field field in klass.fields) { indent.write('pigeonMap[\'${field.name}\'] = '); if (customClassNames.contains(field.dataType)) { - indent.addln('${field.name}._toMap();'); + indent.addln( + '${field.name} == null ? null : ${field.name}._toMap();'); } else { indent.addln('${field.name};'); } @@ -162,6 +163,10 @@ void generateDart(Root root, StringSink sink) { indent.write( 'static ${klass.name} _fromMap(Map pigeonMap) '); indent.scoped('{', '}', () { + indent.write('if (pigeonMap == null)'); + indent.scoped('{', '}', () { + indent.writeln('return null;'); + }); indent.writeln('final ${klass.name} result = ${klass.name}();'); for (Field field in klass.fields) { indent.write('result.${field.name} = '); diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index c65c2f2509dc..db3157c7ff77 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -8,7 +8,7 @@ import 'dart:mirrors'; import 'ast.dart'; /// The current version of pigeon. -const String pigeonVersion = '0.1.2'; +const String pigeonVersion = '0.1.4'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/lib/java_generator.dart b/packages/pigeon/lib/java_generator.dart index 176dc2df7d3f..0710bb09edc3 100644 --- a/packages/pigeon/lib/java_generator.dart +++ b/packages/pigeon/lib/java_generator.dart @@ -14,6 +14,8 @@ const Map _javaTypeForDartTypeMap = { 'Int32List': 'int[]', 'Int64List': 'long[]', 'Float64List': 'double[]', + 'List': 'ArrayList', + 'Map': 'HashMap', }; /// Options that control how Java code will be generated. @@ -195,6 +197,7 @@ void generateJava(JavaOptions options, Root root, StringSink sink) { indent.writeln('import io.flutter.plugin.common.BasicMessageChannel;'); indent.writeln('import io.flutter.plugin.common.BinaryMessenger;'); indent.writeln('import io.flutter.plugin.common.StandardMessageCodec;'); + indent.writeln('import java.util.ArrayList;'); indent.writeln('import java.util.HashMap;'); indent.addln(''); diff --git a/packages/pigeon/lib/objc_generator.dart b/packages/pigeon/lib/objc_generator.dart index dd8dbb953e5f..e264ef35e291 100644 --- a/packages/pigeon/lib/objc_generator.dart +++ b/packages/pigeon/lib/objc_generator.dart @@ -28,8 +28,8 @@ String _className(String prefix, String className) { String _callbackForType(String dartType, String objcType) { return dartType == 'void' - ? 'void(^)(NSError*)' - : 'void(^)($objcType*, NSError*)'; + ? 'void(^)(NSError* _Nullable)' + : 'void(^)($objcType*, NSError* _Nullable)'; } const Map _objcTypeForDartTypeMap = { @@ -41,6 +41,8 @@ const Map _objcTypeForDartTypeMap = { 'Int32List': 'FlutterStandardTypedData *', 'Int64List': 'FlutterStandardTypedData *', 'Float64List': 'FlutterStandardTypedData *', + 'List': 'NSArray *', + 'Map': 'NSDictionary *', }; const Map _propertyTypeForDartTypeMap = { @@ -52,6 +54,8 @@ const Map _propertyTypeForDartTypeMap = { 'Int32List': 'strong', 'Int64List': 'strong', 'Float64List': 'strong', + 'List': 'strong', + 'Map': 'strong', }; String _objcTypeForDartType(String type) { diff --git a/packages/pigeon/lib/pigeon_lib.dart b/packages/pigeon/lib/pigeon_lib.dart index 6207757594d8..b04d12d9d143 100644 --- a/packages/pigeon/lib/pigeon_lib.dart +++ b/packages/pigeon/lib/pigeon_lib.dart @@ -317,6 +317,21 @@ options: } } } + for (Api api in root.apis) { + for (Method method in api.methods) { + if (_validTypes.contains(method.argType)) { + result.add(Error( + message: + 'Unsupported argument type: "${method.argType}" in API: "${api.name}" method: "${method.name}')); + } + if (_validTypes.contains(method.returnType)) { + result.add(Error( + message: + 'Unsupported return type: "${method.returnType}" in API: "${api.name}" method: "${method.name}')); + } + } + } + return result; } diff --git a/packages/pigeon/mock_handler_tester/test/message.dart b/packages/pigeon/mock_handler_tester/test/message.dart index 9f0db48b7eaf..1aa33c6494b3 100644 --- a/packages/pigeon/mock_handler_tester/test/message.dart +++ b/packages/pigeon/mock_handler_tester/test/message.dart @@ -17,6 +17,9 @@ class SearchReply { // ignore: unused_element static SearchReply _fromMap(Map pigeonMap) { + if (pigeonMap == null) { + return null; + } final SearchReply result = SearchReply(); result.result = pigeonMap['result']; result.error = pigeonMap['error']; @@ -39,6 +42,9 @@ class SearchRequest { // ignore: unused_element static SearchRequest _fromMap(Map pigeonMap) { + if (pigeonMap == null) { + return null; + } final SearchRequest result = SearchRequest(); result.query = pigeonMap['query']; result.anInt = pigeonMap['anInt']; @@ -52,12 +58,15 @@ class Nested { // ignore: unused_element Map _toMap() { final Map pigeonMap = {}; - pigeonMap['request'] = request._toMap(); + pigeonMap['request'] = request == null ? null : request._toMap(); return pigeonMap; } // ignore: unused_element static Nested _fromMap(Map pigeonMap) { + if (pigeonMap == null) { + return null; + } final Nested result = Nested(); result.request = SearchRequest._fromMap(pigeonMap['request']); return result; @@ -105,6 +114,23 @@ class NestedApi { } } +abstract class TestNestedApi { + SearchReply search(Nested arg); + static void setup(TestNestedApi api) { + { + const BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.NestedApi.search', StandardMessageCodec()); + channel.setMockMessageHandler((dynamic message) async { + final Map mapMessage = + message as Map; + final Nested input = Nested._fromMap(mapMessage); + final SearchReply output = api.search(input); + return {'result': output._toMap()}; + }); + } + } +} + class Api { Future search(SearchRequest arg) async { final Map requestMap = arg._toMap(); diff --git a/packages/pigeon/mock_handler_tester/test/widget_test.dart b/packages/pigeon/mock_handler_tester/test/widget_test.dart index 82f652a8ef0a..41322b3e9e15 100644 --- a/packages/pigeon/mock_handler_tester/test/widget_test.dart +++ b/packages/pigeon/mock_handler_tester/test/widget_test.dart @@ -14,10 +14,32 @@ class Mock implements TestHostApi { } } +class MockNested implements TestNestedApi { + bool didCall = false; + @override + SearchReply search(Nested arg) { + didCall = true; + if (arg.request == null) { + return SearchReply(); + } else { + return SearchReply()..result = arg.request.query; + } + } +} + void main() { TestWidgetsFlutterBinding.ensureInitialized(); - test('description', () async { + test('simple', () async { + final NestedApi api = NestedApi(); + final MockNested mock = MockNested(); + TestNestedApi.setup(mock); + final SearchReply reply = await api.search(Nested()..request = null); + expect(mock.didCall, true); + expect(reply.result, null); + }); + + test('nested', () async { final Api api = Api(); final Mock mock = Mock(); TestHostApi.setup(mock); diff --git a/packages/pigeon/pigeons/list.dart b/packages/pigeon/pigeons/list.dart new file mode 100644 index 000000000000..bed4a79227b9 --- /dev/null +++ b/packages/pigeon/pigeons/list.dart @@ -0,0 +1,15 @@ +// Copyright 2020 The Flutter 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 'package:pigeon/pigeon.dart'; + +class TestMessage { + // ignore: always_specify_types + List testList; +} + +@HostApi() +abstract class TestApi { + void test(TestMessage msg); +} diff --git a/packages/pigeon/pigeons/message.dart b/packages/pigeon/pigeons/message.dart index 73dc13843ee0..2dff2f090ead 100644 --- a/packages/pigeon/pigeons/message.dart +++ b/packages/pigeon/pigeons/message.dart @@ -27,7 +27,7 @@ class Nested { SearchRequest request; } -@HostApi() +@HostApi(dartHostTestHandler: 'TestNestedApi') abstract class NestedApi { SearchReply search(Nested nested); } diff --git a/packages/pigeon/platform_tests/ios_unit_tests/ios/Runner.xcodeproj/project.pbxproj b/packages/pigeon/platform_tests/ios_unit_tests/ios/Runner.xcodeproj/project.pbxproj index f285dc91805e..20ab37a48ec5 100644 --- a/packages/pigeon/platform_tests/ios_unit_tests/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/pigeon/platform_tests/ios_unit_tests/ios/Runner.xcodeproj/project.pbxproj @@ -11,10 +11,6 @@ 0D50127523FF75B100CD5B95 /* RunnerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 0D50127423FF75B100CD5B95 /* RunnerTests.m */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -39,8 +35,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, - 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -56,13 +50,11 @@ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; @@ -83,8 +75,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, - 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -103,9 +93,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEBA1CF902C7004384FC /* Flutter.framework */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, @@ -271,7 +259,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; @@ -408,7 +396,6 @@ }; 249021D3217E4FDB00AE95B9 /* Profile */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -482,7 +469,6 @@ }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; @@ -538,7 +524,6 @@ }; 97C147041CF9000F007C117D /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 97dbc7247586..8e7b9f036936 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -1,5 +1,5 @@ name: pigeon -version: 0.1.2+1 +version: 0.1.4 description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. homepage: https://github.com/flutter/packages/tree/master/packages/pigeon dependencies: diff --git a/packages/pigeon/run_tests.sh b/packages/pigeon/run_tests.sh index 3bfbaf71e083..2b3ee4f467e7 100755 --- a/packages/pigeon/run_tests.sh +++ b/packages/pigeon/run_tests.sh @@ -1,10 +1,28 @@ +############################################################################### +# run_tests.sh +# +# This runs all the different types of tests for pigeon. It should be run from +# the directory that contains the script. +############################################################################### + # exit when any command fails set -e +############################################################################### +# Variables +############################################################################### flutter=$(which flutter) flutter_bin=$(dirname $flutter) framework_path="$flutter_bin/cache/artifacts/engine/ios/" +############################################################################### +# Functions +############################################################################### + +# test_pigeon_ios() +# +# Compiles the pigeon file to a temp directory and attempts to compile the code +# and runs the dart analyzer on the generated dart code. test_pigeon_ios() { temp_dir=$(mktemp -d -t pigeon) @@ -30,6 +48,9 @@ test_pigeon_ios() { rm -rf $temp_dir } +# test_pigeon_android() +# +# Compiles the pigeon file to a temp directory and attempts to compile the code. test_pigeon_android() { temp_dir=$(mktemp -d -t pigeon) @@ -48,20 +69,40 @@ test_pigeon_android() { rm -rf $temp_dir } +############################################################################### +# Dart unit tests +############################################################################### +pub get pub run test test/ + +############################################################################### +# Compilation tests (Code is generated and compiled) +############################################################################### +# Make sure the artifacts are present. +flutter precache +# Make sure flutter dependencies are available. +pushd $PWD +cd e2e_tests/test_objc/ +flutter pub get +popd test_pigeon_android ./pigeons/voidflutter.dart test_pigeon_android ./pigeons/voidhost.dart test_pigeon_android ./pigeons/host2flutter.dart test_pigeon_android ./pigeons/message.dart test_pigeon_android ./pigeons/void_arg_host.dart test_pigeon_android ./pigeons/void_arg_flutter.dart +test_pigeon_android ./pigeons/list.dart test_pigeon_ios ./pigeons/message.dart test_pigeon_ios ./pigeons/host2flutter.dart test_pigeon_ios ./pigeons/voidhost.dart test_pigeon_ios ./pigeons/voidflutter.dart test_pigeon_ios ./pigeons/void_arg_host.dart test_pigeon_ios ./pigeons/void_arg_flutter.dart +test_pigeon_ios ./pigeons/list.dart +############################################################################### +# Mock handler flutter tests. +############################################################################### pushd $PWD pub run pigeon \ --input pigeons/message.dart \ @@ -71,6 +112,31 @@ cd mock_handler_tester flutter test popd +############################################################################### +# iOS unit tests on generated code. +############################################################################### +pub run pigeon \ + --input pigeons/message.dart \ + --dart_out /dev/null \ + --objc_header_out platform_tests/ios_unit_tests/ios/Runner/messages.h \ + --objc_source_out platform_tests/ios_unit_tests/ios/Runner/messages.m +clang-format -i platform_tests/ios_unit_tests/ios/Runner/messages.h +clang-format -i platform_tests/ios_unit_tests/ios/Runner/messages.m +pushd $PWD +cd platform_tests/ios_unit_tests +flutter build ios +cd ios +xcodebuild \ + -workspace Runner.xcworkspace \ + -scheme RunnerTests \ + -sdk iphonesimulator \ + -destination 'platform=iOS Simulator,name=iPhone 8' \ + test +popd + +############################################################################### +# End-to-end (e2e) integration tests. +############################################################################### DARTLE_H="e2e_tests/test_objc/ios/Runner/dartle.h" DARTLE_M="e2e_tests/test_objc/ios/Runner/dartle.m" DARTLE_DART="e2e_tests/test_objc/lib/dartle.dart" @@ -95,5 +161,8 @@ xcodebuild \ test | xcpretty popd +############################################################################### +# Run the formatter on generated code. +############################################################################### cd ../.. -pub global activate flutter_plugin_tools && pub global run flutter_plugin_tools format \ No newline at end of file +pub global activate flutter_plugin_tools && pub global run flutter_plugin_tools format diff --git a/packages/pigeon/test/dart_generator_test.dart b/packages/pigeon/test/dart_generator_test.dart index 008914588507..296b275c1ccb 100644 --- a/packages/pigeon/test/dart_generator_test.dart +++ b/packages/pigeon/test/dart_generator_test.dart @@ -58,7 +58,10 @@ void main() { final StringBuffer sink = StringBuffer(); generateDart(root, sink); final String code = sink.toString(); - expect(code, contains('pigeonMap[\'nested\'] = nested._toMap()')); + expect( + code, + contains( + 'pigeonMap[\'nested\'] = nested == null ? null : nested._toMap()')); expect(code, contains('result.nested = Input._fromMap(pigeonMap[\'nested\']);')); }); diff --git a/packages/pigeon/test/java_generator_test.dart b/packages/pigeon/test/java_generator_test.dart index 9113261ad6ea..7174c2b76a3e 100644 --- a/packages/pigeon/test/java_generator_test.dart +++ b/packages/pigeon/test/java_generator_test.dart @@ -199,4 +199,34 @@ void main() { expect(code, contains('doSomething(Reply')); expect(code, contains('channel.send(null')); }); + + test('gen list', () { + final Root root = Root(apis: [], classes: [ + Class( + name: 'Foobar', + fields: [Field(name: 'field1', dataType: 'List')]), + ]); + final StringBuffer sink = StringBuffer(); + final JavaOptions javaOptions = JavaOptions(); + javaOptions.className = 'Messages'; + generateJava(javaOptions, root, sink); + final String code = sink.toString(); + expect(code, contains('public static class Foobar')); + expect(code, contains('private ArrayList field1;')); + }); + + test('gen map', () { + final Root root = Root(apis: [], classes: [ + Class( + name: 'Foobar', + fields: [Field(name: 'field1', dataType: 'Map')]), + ]); + final StringBuffer sink = StringBuffer(); + final JavaOptions javaOptions = JavaOptions(); + javaOptions.className = 'Messages'; + generateJava(javaOptions, root, sink); + final String code = sink.toString(); + expect(code, contains('public static class Foobar')); + expect(code, contains('private HashMap field1;')); + }); } diff --git a/packages/pigeon/test/objc_generator_test.dart b/packages/pigeon/test/objc_generator_test.dart index 939bed1f530a..1acbcc5680fa 100644 --- a/packages/pigeon/test/objc_generator_test.dart +++ b/packages/pigeon/test/objc_generator_test.dart @@ -315,7 +315,7 @@ void main() { final StringBuffer sink = StringBuffer(); generateObjcHeader(ObjcOptions(header: 'foo.h', prefix: 'ABC'), root, sink); final String code = sink.toString(); - expect(code, contains('completion:(void(^)(NSError*))')); + expect(code, contains('completion:(void(^)(NSError* _Nullable))')); }); test('gen flutter void return source', () { @@ -331,7 +331,7 @@ void main() { final StringBuffer sink = StringBuffer(); generateObjcSource(ObjcOptions(header: 'foo.h', prefix: 'ABC'), root, sink); final String code = sink.toString(); - expect(code, contains('completion:(void(^)(NSError*))')); + expect(code, contains('completion:(void(^)(NSError* _Nullable))')); expect(code, contains('completion(nil)')); }); @@ -383,7 +383,7 @@ void main() { expect( code, contains( - '(void)doSomething:(void(^)(ABCOutput*, NSError*))completion')); + '(void)doSomething:(void(^)(ABCOutput*, NSError* _Nullable))completion')); }); test('gen flutter void arg header', () { @@ -402,7 +402,33 @@ void main() { expect( code, contains( - '(void)doSomething:(void(^)(ABCOutput*, NSError*))completion')); + '(void)doSomething:(void(^)(ABCOutput*, NSError* _Nullable))completion')); expect(code, contains('channel sendMessage:nil')); }); + + test('gen list', () { + final Root root = Root(apis: [], classes: [ + Class( + name: 'Foobar', + fields: [Field(name: 'field1', dataType: 'List')]), + ]); + final StringBuffer sink = StringBuffer(); + generateObjcHeader(ObjcOptions(), root, sink); + final String code = sink.toString(); + expect(code, contains('@interface Foobar')); + expect(code, matches('@property.*NSArray.*field1')); + }); + + test('gen map', () { + final Root root = Root(apis: [], classes: [ + Class( + name: 'Foobar', + fields: [Field(name: 'field1', dataType: 'Map')]), + ]); + final StringBuffer sink = StringBuffer(); + generateObjcHeader(ObjcOptions(), root, sink); + final String code = sink.toString(); + expect(code, contains('@interface Foobar')); + expect(code, matches('@property.*NSDictionary.*field1')); + }); } diff --git a/packages/pigeon/test/pigeon_lib_test.dart b/packages/pigeon/test/pigeon_lib_test.dart index 2d3b44913d00..0059687d3c45 100644 --- a/packages/pigeon/test/pigeon_lib_test.dart +++ b/packages/pigeon/test/pigeon_lib_test.dart @@ -66,6 +66,16 @@ abstract class NestorApi { Nestor getit(); } +@HostApi() +abstract class InvalidArgTypeApi { + void doit(bool value); +} + +@HostApi() +abstract class InvalidReturnTypeApi { + bool doit(); +} + void main() { test('parse args - input', () { final PigeonOptions opts = @@ -215,4 +225,16 @@ void main() { expect(classNames.contains('Nestor'), true); expect(classNames.contains('OnlyVisibleFromNesting'), true); }); + + test('invalid datatype for argument', () { + final Pigeon pigeon = Pigeon.setup(); + final ParseResults results = pigeon.parse([InvalidArgTypeApi]); + expect(results.errors.length, 1); + }); + + test('invalid datatype for argument', () { + final Pigeon pigeon = Pigeon.setup(); + final ParseResults results = pigeon.parse([InvalidReturnTypeApi]); + expect(results.errors.length, 1); + }); } diff --git a/packages/pigeon/test/version_test.dart b/packages/pigeon/test/version_test.dart new file mode 100644 index 000000000000..70e4382a1226 --- /dev/null +++ b/packages/pigeon/test/version_test.dart @@ -0,0 +1,19 @@ +// Copyright 2020 The Flutter 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 'dart:io'; + +import 'package:pigeon/generator_tools.dart'; +import 'package:test/test.dart'; + +void main() { + test('pigeon version matches pubspec', () { + final String pubspecPath = '${Directory.current.path}/pubspec.yaml'; + final String pubspec = File(pubspecPath).readAsStringSync(); + final RegExp regex = RegExp('version:\s*(.*)'); + final RegExpMatch match = regex.firstMatch(pubspec); + expect(match, isNotNull); + expect(pigeonVersion, match.group(1).trim()); + }); +} diff --git a/packages/xdg_directories/lib/xdg_directories.dart b/packages/xdg_directories/lib/xdg_directories.dart index 857b72c1c18b..ba4be8b4cd8f 100644 --- a/packages/xdg_directories/lib/xdg_directories.dart +++ b/packages/xdg_directories/lib/xdg_directories.dart @@ -7,7 +7,7 @@ library xdg_directories; import 'dart:convert'; import 'dart:io'; -import 'package:flutter/cupertino.dart'; +import 'package:meta/meta.dart'; import 'package:path/path.dart' as path; import 'package:process/process.dart'; @@ -30,6 +30,7 @@ set xdgEnvironmentOverride(EnvironmentAccessor override) { /// replaces the real environment lookups with an override. /// /// Only available to tests. +@visibleForTesting EnvironmentAccessor get xdgEnvironmentOverride => _xdgEnvironmentOverride; EnvironmentAccessor _xdgEnvironmentOverride; EnvironmentAccessor _productionGetEnv = diff --git a/packages/xdg_directories/pubspec.yaml b/packages/xdg_directories/pubspec.yaml index 02b47b32b2cd..ba1d47dd2ffe 100644 --- a/packages/xdg_directories/pubspec.yaml +++ b/packages/xdg_directories/pubspec.yaml @@ -7,12 +7,10 @@ environment: sdk: ">=2.3.0 <3.0.0" dependencies: + meta: ^1.2.2 path: ^1.6.4 process: ^3.0.12 - flutter: - sdk: flutter dev_dependencies: + test: ^1.15.3 mockito: ^4.1.1 - flutter_test: - sdk: flutter diff --git a/packages/xdg_directories/test/xdg_directories_test.dart b/packages/xdg_directories/test/xdg_directories_test.dart index c32089dcc893..9e1eca2b3c04 100644 --- a/packages/xdg_directories/test/xdg_directories_test.dart +++ b/packages/xdg_directories/test/xdg_directories_test.dart @@ -5,7 +5,7 @@ import 'dart:convert'; import 'dart:io'; -import 'package:flutter_test/flutter_test.dart'; +import 'package:test/test.dart'; import 'package:path/path.dart' as path; import 'package:mockito/mockito.dart' show Fake; import 'package:process/process.dart'; @@ -46,6 +46,7 @@ XDG_VIDEOS_DIR="$HOME/Videos" '''); xdg.xdgEnvironmentOverride = (String key) => fakeEnv[key]; }); + tearDown(() { if (tmpDir != null) { tmpDir.deleteSync(recursive: true); @@ -70,6 +71,7 @@ XDG_VIDEOS_DIR="$HOME/Videos" expectDirList(xdg.configDirs, ['/etc/xdg']); expectDirList(xdg.dataDirs, ['/usr/local/share', '/usr/share']); }); + test('Values pull from environment', () { expect(xdg.cacheHome.path, equals(testPath('.test_cache'))); expect(xdg.configHome.path, equals(testPath('.test_config'))); @@ -82,6 +84,7 @@ XDG_VIDEOS_DIR="$HOME/Videos" testPath('usr/test_share'), ]); }); + test('Can get userDirs', () { final Map expected = { 'DESKTOP': testPath('Desktop'), @@ -102,6 +105,7 @@ XDG_VIDEOS_DIR="$HOME/Videos" } xdg.xdgProcessManager = const LocalProcessManager(); }); + test('Throws StateError when HOME not set', () { fakeEnv.clear(); expect(() {