Commit d8947a59 authored by Mike Dougherty's avatar Mike Dougherty Committed by Commit Bot

Add documentation with Xcode IDE information

This is not meant to be an exhastive document, but rather a starting
point to help describe how to best use the Xcode IDE.

TBR=noyau@chromium.org

Bug: None
Change-Id: I821dba060353220c1f93cd49dd12dcd74aeaf790
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2188519Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Commit-Queue: Mike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766549}
parent 93991aaf
......@@ -76,6 +76,8 @@ build directories under `out` for Release and Debug device and simulator
builds, and generates an appropriate Xcode workspace
(`out/build/all.xcworkspace`) as well.
More information about [developing with Xcode](xcode_tips.md).
You can customize the build by editing the file `$HOME/.setup-gn` (create it if
it does not exist). Look at `src/ios/build/tools/setup-gn.config` for
available configuration options.
......@@ -91,9 +93,11 @@ $ autoninja -C out/Debug-iphonesimulator gn_all
(`autoninja` is a wrapper that automatically provides optimal values for the
arguments passed to `ninja`.)
Note: you need to run `setup-gn.py` script every time one of the `BUILD.gn`
file is updated (either by you or after rebasing). If you forget to run it,
the list of targets and files in the Xcode solution may be stale.
Note: The `setup-gn.py` script needs to run every time one of the `BUILD.gn`
files is updated (either by you or after rebasing). If you forget to run it,
the list of targets and files in the Xcode solution may be stale. You can run
the script directly or use either `gclient sync` or `gclient runhooks` which
will run `setup-gn.py` for you as part of the update hooks.
You can also follow the manual instructions on the
[Mac page](../mac_build_instructions.md), but make sure you set the
......
# Developing Chrome for iOS with the Xcode IDE
This document contains notes used during a presentation about how to use Xcode
to develop Chrome for iOS.
## Background
### .xcworkspace and .xcproject
* Generated from BUILD.gn files.
* Don't make changes to it as it is a "fake" representation of the project
- changes will not be committed
- changes will be overwritten without warning
* Modify BUILD files instead
* Added BUILD.gn files/`source_sets` need to be referenced from other ones as
a `dep` in order for it to be shown in xcode.
### Adding new files
* Create new files with `tools/boilerplate.py`
* Add files to BUILD.gn `mate ios/chrome/...BUILD.gn`
* Add new source_set target as a dep of another target
* Execute `gclient runhooks` or `gclient sync`
### Simulators
* Simulators build for Mac architecture, not emulators. Fast, generally good
for most development
* To run on device, need provisioning profiles and certificate
## Xcode
* Project location is `src/out/build/`, open `all.workspace`
* Choose "Automatically generate targets" after a `gclient sync`
* Start typing while dropdowns are presented to filter the displayed items
### Targets
* `chrome' is the main application target
* `ios_web_shell` and `ios_web_view_shell` test lower level of application
### Tests
* Unittests/Inttests
- Add flags to specify tests to run (Option-Click on unittest target name,
select Run from left panel, add to "Arguments Passed on Launch")
- `gtest_filter=TestClass.*`
- `gtest_repeat=20`
- Full list of options available by sending an unknown option
* EarlGrey
- EG1 deprecated
- EG2 are current UI tests
- A separate "test" process communicates with "the app".
- EDO is term for "distant object" on "the other side".
- egtest files can run under both EG1 and EG2 with correct setup in
BUILD.gn because the layer of helpers encapsulate the necessary
differences.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment