Revision control

2
===============
3
5
6
This branch (master)
7
-----------
8
9
This branch only works with Xcode 11 and supports iOS 11.0 and above
10
11
Please make sure you aim your pull requests in the right direction.
12
13
For bug fixes and features for a specific release use the version branch.
14
15
Getting involved
16
----------------
17
18
Want to contribute but don't know where to start? Here is a list of [issues that are contributor friendly](https://github.com/mozilla-mobile/firefox-ios/issues?q=is%3Aissue+is%3Aopen+label%3A%22Contributor+OK+%F0%9F%A4%9D%22)
19
20
Building the code
21
-----------------
22
23
1. Install the latest [Xcode developer tools](https://developer.apple.com/xcode/downloads/) from Apple.
24
1. Install Carthage
25
```shell
26
brew update
27
brew install carthage
28
```
29
1. Clone the repository:
30
```shell
32
```
33
1. Pull in the project dependencies:
34
```shell
35
cd firefox-ios
36
sh ./bootstrap.sh
37
```
38
1. Open `Client.xcodeproj` in Xcode.
39
1. Build the `Fennec` scheme in Xcode.
40
41
## Building User Scripts
42
43
User Scripts (JavaScript injected into the `WKWebView`) are compiled, concatenated and minified using [webpack](https://webpack.js.org/). User Scripts to be aggregated are placed in the following directories:
44
45
```
46
/Client
47
|-- /Frontend
48
|-- /UserContent
49
|-- /UserScripts
50
|-- /AllFrames
51
| |-- /AtDocumentEnd
52
| |-- /AtDocumentStart
53
|-- /MainFrame
54
|-- /AtDocumentEnd
55
|-- /AtDocumentStart
56
```
57
58
This reduces the total possible number of User Scripts down to four. The compiled output from concatenating and minifying the User Scripts placed in these folders resides in `/Client/Assets` and are named accordingly:
59
60
* `AllFramesAtDocumentEnd.js`
61
* `AllFramesAtDocumentStart.js`
62
* `MainFrameAtDocumentEnd.js`
63
* `MainFrameAtDocumentStart.js`
64
65
To simplify the build process, these compiled files are checked-in to this repository. When adding or editing User Scripts, these files can be re-compiled with `webpack` manually. This requires Node.js to be installed and all required `npm` packages can be installed by running `npm install` in the root directory of the project. User Scripts can be compiled by running the following `npm` command in the root directory of the project:
66
67
```
68
npm run build
69
```
70
71
## Contributor guidelines
72
73
### Creating a pull request
74
* All pull requests must be associated with a specific Issue. If an issue doesn't exist please first create it.
75
76
### Swift style
77
* Swift code should generally follow the conventions listed at https://github.com/raywenderlich/swift-style-guide.
78
* Exception: we use 4-space indentation instead of 2.
79
* This is a loose standard. We do our best to follow this style
80
81
### Whitespace
82
* New code should not contain any trailing whitespace.
83
* We recommend enabling both the "Automatically trim trailing whitespace" and "Including whitespace-only lines" preferences in Xcode (under Text Editing).
84
* <code>git rebase --whitespace=fix</code> can also be used to remove whitespace from your commits before issuing a pull request.
85
86
### Commits
87
* Each commit should have a single clear purpose. If a commit contains multiple unrelated changes, those changes should be split into separate commits.
88
* If a commit requires another commit to build properly, those commits should be squashed.
89
* Follow-up commits for any review comments should be squashed. Do not include "Fixed PR comments", merge commits, or other "temporary" commits in pull requests.