brew install bazelisk@1.4.0
ln -s /user/local/Cellar/bazelisk/1.4.0/bin/bazelisk /user/local/bin/bazel
carthage bootstrap --platform iOS
[Optional] (Carthage) Create an additional BUILD
file in the root directory of the iOS project with imports of dynamic frameworks.
CFBundlePackageType: $(PRODUCT_BUNDLE_PACKAGE_TYPE) -> APPL
UISceneDelegateClassName: $(PRODUCT_MODULE_NAME).SceneDelegate -> *_Sources.SceneDelegate
5. Add a new .bazelversion
and specify exact version of Bazel in it. Additionally add a new .bazelrc
with predefined build flags for iOS.
bazel build @build_bazel_rules_swift//examples/xplatform/hello_world
bazel fetch //*:*
bazel build //*:* --spawn_strategy=local --apple_platform_type=ios --cpu=ios_x86_64
8. Install Tulsi 0.20200219.88
– Xcode Project Generator For Bazel: https://github.com/bazelbuild/tulsi#building-and-installing.
11. Add */BUILD
file associated with the project as a Package to the created Tulsi's project. Repeat this step if you have more than one BUILD
file containing targets you wish to build directly.
12. Next, you have to select one or more targets that you want to build in Xcode, for example *
- ios_application
and Sources
– swift_library
.
13. Select one or more Source Targets
with a Recursive strategy (Optional). This allows you to select a working set from your full source tree that best matches the portion of the project that you're likely to edit. Save a new Config with the Default
name.
14. Generate a new Xcode Project with Tulsi and save it on the same level with WORKSPACE
and *.tulsiproj
files.
INFO: Analyzed target //Bazel:Bazel (0 packages loaded, 196 targets configured).
INFO: Found 1 target...
INFO: From ImportedDynamicFrameworkProcessor Bazel/Bazel-intermediates/_imported_frameworks/Kingfisher.framework.zip:
bazel-out/ios_x86_64-fastbuild/bin/Bazel/Bazel-intermediates/_imported_frameworks/Kingfisher.framework: replacing existing signature
Target //Bazel:Bazel up-to-date:
bazel-bin/Bazel/Bazel.ipa
INFO: Elapsed time: 7.829s, Critical Path: 7.51s
INFO: 15 processes: 15 local.
INFO: Build completed successfully, 44 total actions
INFO: Invocation ID: *
INFO: Analyzed target //Bazel:Bazel (0 packages loaded, 196 targets configured).
INFO: Found 1 target...
INFO: From ImportedDynamicFrameworkProcessor Bazel/Bazel-intermediates/_imported_frameworks/Kingfisher.framework.zip:
bazel-out/ios_x86_64-fastbuild/bin/Bazel/Bazel-intermediates/_imported_frameworks/Kingfisher.framework: replacing existing signature
Target //Bazel:Bazel up-to-date:
bazel-bin/Bazel/Bazel.ipa
INFO: Elapsed time: 7.864s, Critical Path: 7.11s
INFO: 15 processes: 15 local.
INFO: Build completed successfully, 44 total actions
INFO: Invocation ID: *
INFO: Analyzed target //Bazel:Bazel (0 packages loaded, 196 targets configured).
INFO: Found 1 target...
INFO: From ImportedDynamicFrameworkProcessor Bazel/Bazel-intermediates/_imported_frameworks/Kingfisher.framework.zip:
bazel-out/ios_x86_64-fastbuild/bin/Bazel/Bazel-intermediates/_imported_frameworks/Kingfisher.framework: replacing existing signature
Target //Bazel:Bazel up-to-date:
bazel-bin/Bazel/Bazel.ipa
INFO: Elapsed time: 1.614s, Critical Path: 1.26s
INFO: 15 processes: 14 remote cache hit, 1 local.
INFO: Build completed successfully, 44 total actions