Skip to content

Commit 658da09

Browse files
committed
Remove swift wrappers from a-s
1 parent ba10c73 commit 658da09

File tree

64 files changed

+10
-10531
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+10
-10531
lines changed

docs/howtos/adding-a-new-component.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -114,21 +114,16 @@ You will end up with a directory structure something like this:
114114

115115
> *For more information on our how we ship components using the Swift Package Manager, check the [ADR that introduced the Swift Package Manager](../adr/0003-swift-packaging.md)*
116116
117-
> [!CRITICAL]
118-
> This section will be soon outdated as all swift wrappers and related tests will be moving to the firefox-ios repository.
119-
120117
Add your component into the iOS ["megazord"](../design/megazords.md) through the local Swift Package Manager (SPM) package `MozillaRustComponentsWrapper`. Note this SPM is for ease of testing APIs locally. The official SPM that is consumed by firefox-ios is a [local package in their repo](https://github.com/mozilla-mobile/firefox-ios/tree/main/MozillaRustComponents).
121118

122-
1. Place any hand-written Swift wrapper code for your component in:
123-
```
124-
megazords/ios-rust/sources/MozillaRustComponentsWrapper/<your_crate_name>/
125-
```
126119

127-
2. Place your Swift test code in:
120+
1. Place your Swift test code in:
128121
```
129122
megazords/ios-rust/tests/MozillaRustComponentsWrapper/
130123
```
131124

125+
> Note: swift-specific tests are ideally suited in the consuming app as there is better integration coverage and ensures we're accurately testing how it's being consumed
126+
132127
That's it! At this point, if you don't intend on writing tests _(are you sure?)_ you can skip this next section.
133128

134129
### Writing and Running Tests
@@ -150,26 +145,17 @@ To test your component:
150145

151146
The script will:
152147
1. Build the XCFramework (combines all rust binaries for SPM)
153-
2. Generate UniFFi bindings (artifacts can be found in `megazords/ios-rust/sources/MozillaRustComponentsWrapper/Generated/`)
148+
2. Generate UniFFi bindings (generated files will be found in `megazords/ios-rust/sources/MozillaRustComponentsWrapper/Generated/`)
154149
3. Generate Glean metrics
155150
4. Run any tests found in the test dir mentioned above
156151

157-
TODO: Update this section??
158-
159-
To ensure distribution of this code, edit `taskcluster/scripts/build-and-test-swift.py`:
160-
161-
- Add your component's directory path to `SOURCE_TO_COPY`
162-
- Optionally, add the path to `FOCUS_SOURCE_TO_COPY` if your component targets Firefox Focus.
163-
164-
165152

166-
Make sure that this code gets distributed. Edit `taskcluster/scripts/build-and-test-swift.py` and:
153+
### Distribution of the component
167154

168-
- Add the path to the directory containing any hand-written swift code to `SOURCE_TO_COPY`
169-
- Optionally also to `FOCUS_SOURCE_TO_COPY` if your component is also targeting Firefox Focus
155+
The UniFFi files will be generated & packaged via `taskcluster/scripts/build-and-test-swift.py`.
170156

157+
Consumers (eg: Firefox iOS) pull the latest artifacts via a nightly [Gitub action](https://github.com/mozilla-mobile/firefox-ios/actions/workflows/update-appservices-nightly.yml). Once your changes are pulled via a nightly release you'll be able to use your new APIs!
171158

172-
### Distribute your component with `rust-components-swift`
173-
The Swift source code and generated UniFFI bindings are distributed to consumers (eg: Firefox iOS) through [`rust-components-swift`](https://github.com/mozilla/rust-components-swift).
159+
> Note: If you don't want to wait for a nightly, once the CI finishes your build -- you can request the action run in firefox-ios to get it sooner
174160
175-
Your component should now automatically get included in the next `rust-component-swift` nightly release.
161+
> Note pt2: If you want to locally test against firefox-ios, follow [this guide](https://github.com/mozilla/application-services/blob/main/docs/howtos/locally-published-components-in-firefox-ios.md)

docs/howtos/locally-published-components-in-firefox-ios.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ In Xcode:
9595
- (If needed) File → Packages → Update to Latest Package Versions
9696
- Product → Clean Build Folder, then build and run Firefox iOS.
9797

98-
If you still see stale artifacts, delete:
98+
If you still see stale artifacts (rare), delete:
9999

100100
```swift
101101
~/Library/Caches/org.swift.swiftpm

megazords/ios-rust/Sources/MozillaRustComponentsWrapper/ASOhttpClient/OhttpManager.swift

Lines changed: 0 additions & 110 deletions
This file was deleted.

megazords/ios-rust/Sources/MozillaRustComponentsWrapper/FxAClient/FxAKeychain/FxAKeychain.swift

Lines changed: 0 additions & 185 deletions
This file was deleted.

0 commit comments

Comments
 (0)