You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/en/migrate/xcode.md
+29-34Lines changed: 29 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,27 +20,12 @@ troubleshooting solutions to address common errors.
20
20
* When building Xcode projects with Bazel, the `BUILD` file(s) become the
21
21
source of truth. If you work on the project in Xcode, you must generate a
22
22
new version of the Xcode project that matches the `BUILD` files using
23
-
[Tulsi](http://tulsi.bazel.build/) whenever you update the `BUILD` files. If
24
-
you're not using Xcode, the `bazel build` and `bazel test` commands provide
25
-
build and test capabilities with certain limitations described later in this
26
-
guide.
27
-
28
-
* Due to differences in build configuration schemas, such as directory layouts
29
-
or build flags, Xcode might not be fully aware of the "big picture" of the
30
-
build and thus some Xcode features might not work. Namely:
31
-
32
-
* Depending on the targets you select for conversion in Tulsi, Xcode might
33
-
not be able to properly index the project source. This affects code
34
-
completion and navigation in Xcode, since Xcode won't be able to see all
35
-
of the project's source code.
36
-
37
-
* Static analysis, address sanitizers, and thread sanitizers might not
38
-
work, since Bazel does not produce the outputs that Xcode expects for
39
-
those features.
40
-
41
-
* If you generate an Xcode project with Tulsi and use that project to run
42
-
tests from within Xcode, Xcode will run the tests instead of
43
-
Bazel. To run tests with Bazel, run the `bazel test` command manually.
To integrate CocoaPods dependencies into the Bazel workspace, you must convert
102
-
them into Bazel packages as described in [Converting CocoaPods dependencies](/migrate/cocoapods).
86
+
To integrate SwiftPM dependencies into the Bazel workspace with [swift_bazel](https://github.com/cgrindel/swift_bazel){: .external},
87
+
you must convert them into Bazel packages as described in the [following tutorial](https://chuckgrindel.com/swift-packages-in-bazel-using-swift_bazel/){: .external}.
103
88
104
-
Note: CocoaPods conversion is a manual process with many variables.
105
-
CocoaPods integration with Bazel has not been fully verified and is not
89
+
Note: SwiftPM support is a manual process with many variables.
90
+
SwiftPM integration with Bazel has not been fully verified and is not
106
91
officially supported.
107
92
108
93
### Step 3: Create a `BUILD` file {:#create-build-file}
running library-based unit tests on iOS and macOS, as well as application-based
148
133
tests on macOS. For application-based tests on iOS or UI tests on either
149
134
platform, Bazel will build the test outputs but the tests must run within Xcode
150
-
through a project generated with Tulsi. Add test targets as follows:
135
+
through a project generated with rules_xcodeproj. Add test targets as follows:
151
136
152
137
*[`macos_unit_test`](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-macos.md#macos_unit_test){: .external} to run library-based and application-based unit tests on a macOS.
to build outputs required to run user interface tests in the iOS simulator
162
-
using Xcode. You must [generate an Xcode project with Tulsi](#step-5-generate-the-xcode-project-with-tulsi)
147
+
using Xcode. You must [generate an Xcode project with rules_xcodeproj](#generate-the-xcode-project-with-rules_xcodeproj)
163
148
and run the tests from within Xcode. Bazel cannot natively run UI tests.
164
149
165
150
At the minimum, specify a value for the `minimum_os_version` attribute. While
@@ -173,7 +158,7 @@ simulator, also specify the `ios_application` target name as the value of the
173
158
#### Step 3c: Add the library target(s) {:#add-library-target}
174
159
175
160
Add an [`objc_library`](/reference/be/objective-c#objc_library)
176
-
target for each ObjectiveC library and a [`swift_library`](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-swift.md){: .external}
161
+
target for each Objective-C library and a [`swift_library`](https://github.com/bazelbuild/rules_swift/blob/master/doc/rules.md#swift_library){: .external}
177
162
target for each Swift library on which the application and/or tests depend.
178
163
179
164
@@ -192,6 +177,16 @@ Note: You can use the [`glob`](/reference/be/functions#glob)
192
177
function to include all sources and/or headers of a certain type. Use it
193
178
carefully as it might include files you do not want Bazel to build.
194
179
180
+
You can browse existing examples for various types of applications directly in the
181
+
[rules_apple examples directory](https://github.com/bazelbuild/rules_apple/tree/master/examples/). For example:
For more information on build rules, see [Apple Rules for Bazel](https://github.com/bazelbuild/rules_apple){: .external}.
196
191
197
192
At this point, it is a good idea to test the build:
@@ -244,11 +239,11 @@ For example:
244
239
bazel build //:my-target
245
240
```
246
241
247
-
### Step 6: Generate the Xcode project with Tulsi {:#generate-xcode-tulsi}
242
+
### Step 6: Generate the Xcode project with rules_xcodeproj {:#generate-the-xcode-project-with-rules_xcodeproj}
248
243
249
244
When building with Bazel, the `WORKSPACE` and `BUILD` files become the source
250
245
of truth about the build. To make Xcode aware of this, you must generate a
251
-
Bazel-compatible Xcode project using [Tulsi](http://tulsi.bazel.build/).
246
+
Bazel-compatible Xcode project using [rules_xcodeproj](https://github.com/buildbuddy-io/rules_xcodeproj#features){: .external}.
0 commit comments