Commit Graph

39 Commits

Author SHA1 Message Date
Chris Bracken
feb16d8d01
Build App.framework for all requested architectures (#17296)
In debug mode iOS builds, we build a stub App.framework with no
functionality, since the engine itself loads the code from the included
bundle and subsequently via hot reload. This is simply done for
consistency with profile/release AOT app structure.

To satisfy the linker, ensure that we're building this code for all
build architectures, not just CURRENT_ARCH.

This is pre-work for supporting arbitrary iOS architectures (armv7,
arm64, universal) in Flutter.
2018-05-04 13:20:17 -07:00
Chris Bracken
7f0876700a
Handle multi-arch builds in Xcode lipo phase (#17212)
Correctly split ARCHS into a Bash array in xcode_backend.sh.

Previously, when ARCHS contained multiple values (e.g., ARCHS="armv7 arm64"),
we treated that as a single architecture, and lipo invocation would
fail.
2018-05-02 18:50:35 -07:00
Chris Bracken
68a1e2f7aa
Simplify iOS debug build (#17145)
iOS debug builds always run in interpreted mode whether on device or on
simulator. In both cases, we can skip snapshotting and link against an
empty App.framework. Previously, we did this for iOS simulator builds.
This does the same for device builds.

Previously, debug iOS builds used gen_snapshot to generate a core
snapshot, then used 'xxd' to generate C files containing the snapshot
data in buffers named kDartVmSnapshotData and kDartIsolateSnapshotData,
which are then compiled/linked into App.framework. This is unnecessary
since the VM compiled into Flutter.framework already contains this data.
2018-04-30 19:51:30 -07:00
Chris Bracken
ebcd08c6ef
Eliminate build aot --interpreter flag (#17025) (#17033)
This is required for iOS debug builds, but unused otherwise. In theory,
Android debug builds could be run in this mode, but this is historically
untested and adds unnecessary complexity to the code. If ad-hoc testing
is required, it can be patched in when necessary.

This re-lands 8c4f0c0d21 with a fix to
xcode_backend.sh to eliminate the use of --interpreter.
2018-04-26 17:25:23 -07:00
Chris Bracken
337d6df73d
Pass verbose flag to Xcode subcommands (#16483)
When flutter builds are run with --verbose, pass the flag through to
flutter sub-commands run via xcode_backend.sh.
2018-04-12 09:30:50 -07:00
Sarah Zakarias
4443e4d4cf
Cleanup FLX related code (#16416) 2018-04-12 10:12:26 +02:00
Vyacheslav Egorov
71b2cfb2a0
Turn Dart 2 mode by default. (#15565) 2018-03-16 20:29:38 +01:00
Josh Soref
c5a5945e92 Spelling (#15229)
* spelling: accommodate

* spelling: allotted

* spelling: anonymous

* spelling: artificial

* spelling: associated

* spelling: asset

* spelling: button

* spelling: canvas

* spelling: compatibility

* spelling: coverage

* spelling: condition

* spelling: decoration

* spelling: deferring

* spelling: diameter

* spelling: direction

* spelling: displacement

* spelling: dropdown

* spelling: needing

* spelling: environment

* spelling: exited

* spelling: expansion

* spelling: explore

* spelling: families

* spelling: horizontal

* spelling: increment

* spelling: indices

* spelling: internationalization

* spelling: labrador

* spelling: localizations

* spelling: midflight

* spelling: milliseconds

* spelling: minimum

* spelling: multiple

* spelling: multiplication

* spelling: navigator

* spelling: overridden

* spelling: package

* spelling: performance

* spelling: platform

* spelling: porsche

* spelling: position

* spelling: preceded

* spelling: precede

* spelling: precedence

* spelling: print

* spelling: property

* spelling: readily

* spelling: reproducibility

* spelling: rounded

* spelling: scroll

* spelling: separate

* spelling: separator

* spelling: services

* spelling: specific

* spelling: specify

* spelling: synchronously

* spelling: through

* spelling: timeout

* spelling: triangle

* spelling: trivial

* spelling: unusual

* spelling: then

* spelling: vertically

* spelling: visible

* spelling: visited

* spelling: voice
2018-03-06 21:36:03 -08:00
xster
1e397d3fb7
Break up and show more progression during an Xcode build (#14715)
* Created plumbing but has stream problem

* testing with makePipe

* Trying pipe but not really getting anywhere

* works by repeatedly reading line

* Minor cleanup

* works

* Clean up pipe after use.

* Move the last status forward

* Make sure failed script commands bubble up
2018-02-15 15:16:23 -08:00
xster
d401bd78ae
Reduce Xcode noise #3 (#14663)
* Revert "Revert "Reduce xcodebuild noise #2" (#14641)"

This reverts commit 2d47481f1e.

* Stop scrapping xcodebuild output, get the right build settings

* clone the command params first
2018-02-13 01:56:13 -08:00
Mikkel Nygaard Ravn
2d47481f1e
Revert "Reduce xcodebuild noise #2" (#14641)
Merging to get back to a green tree.
2018-02-12 15:15:51 +01:00
xster
33ea7f84a9
Reduce xcodebuild noise #2 (#14622)
* Revert "Revert "Reduce noise in xcodebuild stdout (#14586)" (#14605)"

This reverts commit 8e2278bd8d.

* Specify the build config when cleaning
2018-02-11 05:54:14 -08:00
xster
8e2278bd8d
Revert "Reduce noise in xcodebuild stdout (#14586)" (#14605)
This reverts commit 74ddda5177.
2018-02-09 14:28:36 -08:00
xster
74ddda5177
Reduce noise in xcodebuild stdout (#14586)
* Reduce noise in xcodebuild stdout

* Reduce output from cleaning, from non failing xcode outputs and from script

* Check xcodebuild clean's exit code

* Revert "Reduce noise in xcodebuild stdout"

This reverts commit 222a26f55f.
2018-02-09 12:47:27 -08:00
asiva
225b52bc0e Fix iOS build which broke after the change to fuse --strong option into
--preview-dart-2.
2018-02-08 11:38:12 -08:00
Alexander Aprelev
bedf987fc8
Pipe strong mode option for iOS simulator. (#14002) 2018-01-11 14:08:28 -08:00
Sarah Zakarias
5e18c07614
Reapply flutter_assets (#13567)
* Revert "Revert engine (#13547)"

This reverts commit ee65db11d4.

* Keep flaky mark
2017-12-14 17:27:25 +01:00
Yegor
ee65db11d4
Revert engine (#13547)
* Revert "Include a directory with Flutter assets (#12944)"

This reverts commit 3af6b9cbf5.

* Revert "Upgrade project.pbxproj to include flutter_assets (#13011)"

This reverts commit 08128cb29b.

* Revert "Upgrade complex_layout project.pbxproj to include flutter_assets (#13544)"

This reverts commit 35f1a04195.

* mark complex_layout_ios__start_up as flaky
2017-12-13 16:25:25 -08:00
Sarah Zakarias
3af6b9cbf5
Include a directory with Flutter assets (#12944) 2017-12-13 22:30:32 +01:00
Alexander Aprelev
4447c0aaf3 Add --preview-dart-2 option support for ios builds (#13251) 2017-11-29 18:11:34 -08:00
Chris Bracken
acdbe45670
Report error on iOS non-release archive builds (#12773)
Archive builds for upload to iTunes Connect should always be built in
release mode, not doing so results in crash on startup.

Bug: https://github.com/flutter/flutter/issues/12086
2017-10-27 18:23:50 -07:00
Chris Bracken
0ee3f57a10 Build Flutter app as a framework on iOS (#8971)
**THIS IS A BREAKING CHANGE.** See below for migration steps for
existing projects.

Previously, Flutter app code was built as a raw dylib on iOS.  Dynamic
libraries outside of a framework bundle are not supported on iOS, except
for the system Swift libraries provided by Xcode.

See:
https://developer.apple.com/library/content/technotes/tn2435/_index.html#//apple_ref/doc/uid/DTS40017543-CH1-TROUBLESHOOTING_BUNDLE_ERRORS-EMBEDDED__DYLIB_FILES

* Migrates Xcode build from app.dylib to App.framework
* Migrates flutter create template
* Migrates example projects

Migration steps for existing projects
=====================================

The following steps should be taken from the root of your Flutter
project:

1. Edit `ios/.gitignore`: add `/Flutter/App.framework` on a new line.
2. In the Xcode project navigator, remove `app.dylib` from the Flutter
   folder. Delete this file from the `ios/Flutter` directory in your project.
3. Run a build to generate `ios/Flutter/App.framework`. From the command
   line, run `flutter build ios`. If you have not configured app signing
   in Xcode, an alternative method is to open the simulator, then run
   `flutter run -d iP`.
4. In the Xcode project navigator, select the `Runner` project. In the
   project settings that are displayed in the main view, ensure that the
   `Runner` target is selected. You can verify this by exposing the
   sidebar using the [| ] icon in the upper-left corner of the main
   view.
5. Select the *General* tab in the project settings. Under the
   *Embedded Binaries* section, click '+' to add `App.framework`. In the
   sheet that drops down, click the *Add Other...* button. Navigate to
   the `ios/Flutter` directory and select `App.framework`. Click *Open*.
   In the sheet that drops down, select *Create folder references*, then
   click *Finish*.
6. In the project settings, verify that `App.framework` has been added to the
   *Embedded Binaries* and *Linked Frameworks and Libraries* lists.
7. In the Xcode project navigator, drag `App.framework` under the
   Flutter folder.
8. In the Xcode project navigator, select `Flutter` then from the
   *File* menu, select *Add Files to "Runner"...*. Navigate to the
   `ios/Flutter` directory, select `AppFrameworkInfo.plist` and click
   the *Add* button.
9. From the command line, in your project directory, run
   `flutter build clean`, then `flutter run`.

At this point your project should be fully migrated.
2017-03-22 17:41:49 -07:00
Chris Bracken
e22d0e603c Make only Flutter.framework files read-only (#8766)
Making the directories read-only causes problems with deletion, which
breaks the Mac chrome buildbot and DeviceLab.

Followup patch to cb2b89c38.
2017-03-14 09:31:31 -07:00
Chris Bracken
cb2b89c389 Set derived dir Flutter.framework directory readonly (#8748)
Provides a strong hint to developers that editing Flutter framework
headers isn't supported.
2017-03-13 15:26:35 -07:00
Chris Bracken
1a2e6f3389 Support Xcode builds in project dirs with spaces (#8709)
Use line-based iteration in place of word-based iteration over the
framework directories, to avoid breaking on spaces.
2017-03-10 09:32:58 -08:00
Chris Bracken
36e3260bfe Do not attempt to merge non-fat frameworks in Xcode build (#8251)
* Do not attempt to merge non-fat frameworks in Xcode build

During the Xcode build, we strip code irrelevant to the target
architecture in frameworks used by the application. In the case of
non-fat executables, no stripping occurs, so the frameworks can be used
as-is. No merge & replace step is necessary.

* fixup! Do not attempt to merge non-fat frameworks in Xcode build
2017-02-17 13:38:47 -08:00
Chris Bracken
3449545e80 Quote all paths in Xcode build backend (#8039)
Required to handle Flutter SDK (and other) paths that include spaces.

Also includes general cleanup:
* Declare explicitly that we use /bin/bash, since we rely on its
  features.
* Add -- where possible, to avoid interpreting files starting in - as
  options.
* Suppress output of pushd/popd.
* Avoid stringifying arrays.
2017-02-09 15:08:33 -08:00
Chris Bracken
0294cf863e Improve file/dir existence check for Xcode backend (#8037) 2017-02-09 13:45:39 -08:00
Chris Bracken
b16a515d9c Handle non-fat frameworks in iOS app framework thinning (#7950)
Support for thinning app frameworks to the target architecture was added
in 708909fc6b. This commit adds support
and error-checking for non-fat frameworks that are not of the target
architecture. In such cases, we now fail the build, and emit an error
message and the contents of lipo -info for the affected framework.
2017-02-07 15:57:16 -08:00
Chris Bracken
1926d11188 Thin iOS app frameworks to the target architecture (#7913)
* Support thinning iOS frameworks to supported architectures

When building against frameworks that are distributed as
multi-architecture fat binaries, we want to strip the frameworks we
distribute down to only the architectures specified in $ARCHS.

This patch adds:
* The ability to specify commands to xcode_backend.sh (if none is
  specified, run BuildApp for backward compatibility).
* A 'thin' command that invokes lipo to thin down the distributed as
  described above.

* Add framework thinning step to iOS build

Invokes xcode_backend.sh thin on the build application.

* Limit architectures to arm64 in Xcode template

Flutter does not yet support armv7 iOS devices. Limit the $ARCHS build
variable to arm64 until then.
2017-02-07 12:04:36 -08:00
Chris Bracken
b5f763b45e Support a configurable build directory (#5601)
This change adds a top-level getBuildDirectory func and funcs for
android, aot, asset, ios build products.

Developers may now add a "build-dir" mapping to their
~/.flutter_settings (JSON format) config file. Output directory is
relative to the main flutter application directory.

This change also changes the default build directory for iOS builds to a
subdirectory of the configured build directory, 'build/ios' by default.
2016-08-25 16:38:19 -07:00
Chris Bracken
81d672688d Emit iOS build products under $SYMROOT (#5560)
Previously, `flutter build` products were emitted to build/ and only
xcode build products were emitted to $SYMROOT.
2016-08-23 14:08:59 -07:00
Todd Volkert
d2ee6f7838 Rename app.so -> app.dylib (#4522) 2016-06-10 16:57:21 -07:00
Adam Barth
8f03ebe56b Teach FlutterPlugin.groovy about AOT builds (#4389)
The `flutter.buildMode` property now controls whether to build in debug,
profiling, or release.
2016-06-06 12:56:04 -07:00
Adam Barth
29af5c0317 Set a sensible default framework path (#4370)
This patch sets a default path for Flutter.framework that's sensible based on
the FLUTTER_MODE.
2016-06-03 17:01:18 -07:00
Chinmay Garde
8756a094a9 Add a FLUTTER_MODE variable to the generated Xcconfig and fix snapshot generation on all targets. (#4362)
Get rid of the DART_EXPERIMENTAL_INTERPRETER_FLAG.
2016-06-03 13:55:57 -07:00
Adam Barth
8171aa86f0 Document how to build hello_services for iOS (#4354)
This patch adds some sensible defaults to xcode_backend.sh and documents how to
build hello_services for iOS using Xcode.
2016-06-03 12:20:54 -07:00
Adam Barth
612a097d1f Add --target support to flutter build ios (#4318)
Fixes #4298
2016-06-02 08:57:13 -07:00
Adam Barth
aee32698ac Add backend tools for extensible iOS apps (#4250)
Instead of embedding Flutter.framework and BuildFlutterApp in the Xcode
project, we store these in flutter.git, where we can reference them.
2016-05-27 15:30:42 -07:00