|
1 |
| -# Contributing |
2 |
| - |
3 |
| -## Downloading Source |
4 |
| - |
5 |
| -Download the source and install all submodules if you have not already, by running the following from the root of the repository. |
6 |
| - |
7 |
| -``` |
8 |
| -git clone --recurse-submodules git@github.com:maplibre/maplibre-native.git |
9 |
| -cd maplibre-native |
10 |
| -``` |
| 1 | +# MapLibre iOS Developer Guide |
11 | 2 |
|
12 | 3 | ## Bazel
|
13 | 4 |
|
@@ -56,91 +47,32 @@ Try to run the example App in the simulator and on a device to confirm your setu
|
56 | 47 | > [!IMPORTANT]
|
57 | 48 | > The Bazel configuration files are the source of truth of the build configuration. All changes to the build settings need to be done through Bazel, not in Xcode.
|
58 | 49 |
|
59 |
| -### Troubleshooting Provisioning Profiles |
| 50 | +### Troubleshooting |
| 51 | + |
| 52 | +#### Provisioning Profiles |
60 | 53 |
|
61 | 54 | If you get a Python `KeyError` when processing provisioning profiles, you probably have some _really_ old or corrupted profiles.
|
62 | 55 |
|
63 | 56 | Have a look through `~/Library/MobileDevice/Provisioning\ Profiles` and remove any expired profiles. Removing all profiles here can also resolve some issues.
|
64 | 57 |
|
65 |
| -## Using Bazel from the Command Line |
| 58 | +#### Cleaning Bazel environments |
66 | 59 |
|
67 |
| -It is also possible to build and run the test application in a simulator from the command line without opening Xcode. |
| 60 | +You should almost never have to do this, but sometimes problems can be solved with: |
68 | 61 |
|
69 | 62 | ```
|
70 |
| -bazel run //platform/ios:App --//:renderer=metal |
| 63 | +bazel clean --expunge |
71 | 64 | ```
|
72 | 65 |
|
73 |
| -You can also build targets from the command line. For example, if you want to build your own XCFramework, see the 'Build XCFramework' step in the [iOS CI workflow](../../.github/workflows/ios-ci.yml). |
74 |
| - |
75 |
| -## Render Tests |
76 |
| - |
77 |
| -To run the render tests, run the `RenderTest` target from iOS. |
| 66 | +## Using Bazel from the Command Line |
78 | 67 |
|
79 |
| -When running in a simulator, use |
| 68 | +It is also possible to build and run the test application in a simulator from the command line without opening Xcode. |
80 | 69 |
|
81 | 70 | ```
|
82 |
| -# check for 'DataContainer' of the app with `*.maplibre.RenderTestApp` id |
83 |
| -xcrun simctl listapps booted |
| 71 | +bazel run //platform/ios:App --//:renderer=metal |
84 | 72 | ```
|
85 | 73 |
|
86 |
| -to get the data directory of the render test app. This allows you to inspect test results. When adding new tests, the generated expectations and `actual.png` file can be copied into the source directory from here. |
87 |
| - |
88 |
| -## C++ Unit Tests |
89 |
| - |
90 |
| -Run the tests from the `CppUnitTests` target in Xcode to run the C++ Unit Tests on iOS. |
| 74 | +You can also build targets from the command line. For example, if you want to build your own XCFramework, see the 'Build XCFramework' step in the [iOS CI workflow](../../.github/workflows/ios-ci.yml). |
91 | 75 |
|
92 | 76 | ## Swift App
|
93 | 77 |
|
94 |
| -There is also an example app built with Swift instead of Objective-C. The target is called `MapLibreApp` and the source code lives in `platform/ios/app-swift`. |
95 |
| - |
96 |
| -## Documentation |
97 |
| - |
98 |
| -We use [DocC](https://www.swift.org/documentation/docc) for documentation. You need to have [aws-cli](https://github.com/aws/aws-cli) installed to download the resources from S3 (see below). Run the following command: |
99 |
| - |
100 |
| -``` |
101 |
| -aws s3 sync --no-sign-request "s3://maplibre-native/ios-documentation-resources" "platform/ios/MapLibre.docc/Resources" |
102 |
| -``` |
103 |
| - |
104 |
| -Then, to build the documentation locally, run the following command: |
105 |
| - |
106 |
| -``` |
107 |
| -platform/ios/scripts/docc.sh preview |
108 |
| -``` |
109 |
| - |
110 |
| -### Resources |
111 |
| - |
112 |
| -Resources like images should not be checked in but should be uploaded to the [S3 Bucket](https://s3.eu-central-1.amazonaws.com/maplibre-native/index.html#ios-documentation-resources/). You can share a `.zip` with all files that should be added in the PR. |
113 |
| - |
114 |
| -If you want to get direct access you need an AWS account to get permissions to upload files. Create an account and authenticate with aws-cli. Share the account ARN that you can get with |
115 |
| - |
116 |
| -``` |
117 |
| -aws sts get-caller-identity |
118 |
| -``` |
119 |
| - |
120 |
| -### Examples |
121 |
| - |
122 |
| -The code samples in the documentation should ideally be compiled on CI so they do not go out of date. |
123 |
| - |
124 |
| -Fence your example code with |
125 |
| - |
126 |
| -```swift |
127 |
| -// #-example-code(LineTapMap) |
128 |
| -... |
129 |
| -// #-end-example-code |
130 |
| -``` |
131 |
| - |
132 |
| -Prefix your documentation code block with |
133 |
| - |
134 |
| -````md |
135 |
| -<!-- include-example(LineTapMap) --> |
136 |
| - |
137 |
| -```swift |
138 |
| -... |
139 |
| -``` |
140 |
| -```` |
141 |
| - |
142 |
| -Then the code block will be updated when you run: |
143 |
| - |
144 |
| -```sh |
145 |
| -node scripts/update-ios-examples.mjs |
146 |
| -``` |
| 78 | +There is also an example app built with Swift instead of Objective-C. The target is called `MapLibreApp` and the source code lives in `platform/ios/app-swift`. |
0 commit comments