Skip to content

Commit 04c06bd

Browse files
travis79badboy
authored andcommitted
Add conditional Foundation import to swift.jinja2 template
Xcode started complaining about this while trying to consume Glean via the AppServices megazord (which is required for A-S components to use the Glean Rust bindings on iOS). I purposefully made this conditional to protect against the cases where Foundation may not be importable/available, which I _think_ should keep this working in our sample app which doesn't consume Glean from rust-components-swift.
1 parent 5888ea3 commit 04c06bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

glean_parser/templates/swift.jinja2

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
{# The rendered markdown is autogenerated, but this
55
Jinja2 template is not. Please file bugs! #}
66

7+
#if canImport(Foundation)
8+
import Foundation
9+
#endif
10+
711
/* This Source Code Form is subject to the terms of the Mozilla Public
812
* License, v. 2.0. If a copy of the MPL was not distributed with this
913
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

0 commit comments

Comments
 (0)