You must generate an Xcode project with rules_xcodeprojĪnd run the tests from within Xcode. To build outputs required to run user interface tests in the iOS simulator Generate an Xcode project with rules_xcodeproj Simulator, Bazel will build the test outputs but not run the tests. Macos_unit_test to run library-based and application-based unit tests on a macOS. Through a project generated with rules_xcodeproj. Platform, Bazel will build the test outputs but the tests must run within Xcode For application-based tests on iOS or UI tests on either Running library-based unit tests on iOS and macOS, as well as application-based Step 3b: (Optional) Add the test target(s) This ensures Bazel builds the application with the Minimum_os_version - the minimum version of macOS or iOS that theĪpplication supports. plist files to merge into the final ist file. Provisioning_profile - provisioning profile from your Apple DeveloperĪccount (if building for an iOS device device).įamilies (iOS only) - whether to build the application for iPhone, iPad, In the target, specify the following at the minimum:īundle_id - the bundle ID (reverse-DNS path followed by app name) of the This target builds a macOS or iOS application bundle, respectively. Tip: To learn more about packages and other Bazel concepts, see Step 3b: (Optional) Add the test target(s).The BUILD file at the root of the Bazel workspace and configure it to do an Once you have defined the workspace and external dependencies, you need toĬreate a BUILD file that tells Bazel how the project is structured. SwiftPM integration with Bazel has not been fully verified and is not Note: SwiftPM support is a manual process with many variables. You must convert them into Bazel packages as described in the following tutorial. To integrate SwiftPM dependencies into the Bazel workspace with swift_bazel, Step 2: (Experimental) Integrate SwiftPM dependencies Note: Place the project source code within the directory tree containing the Project's directories, specify these external dependencies in the WORKSPACEįile. If the project depends on files or packages that are not in one of the If the project uses no external dependencies, this file can beĮmpty. Generate the Xcode project with rules_xcodeprojĬreate a WORKSPACE file in a new directory. (Experimental) Integrate SwiftPM dependencies To build or test an Xcode project with Bazel, do the following: Build or test an Xcode project with Bazel Unlike Xcode, Bazel requires you to explicitly declare all dependencies forįor more information on external dependencies, see Workspace, including the WORKSPACE and BUILD files, as well as theĬoncepts of targets, build rules, and Bazel packages.Īnalyze and understand the project's dependencies. If you're not familiar with Bazel and its concepts, complete the Install Bazel if you have not already done so. With certain limitations described later in this guide. If you're not using Xcode, theīazel build and bazel test commands provide build and test capabilities Such as adding dependencies to a target don't require regenerating the New version of the Xcode project that matches the BUILD files using If you work on the project in Xcode, you must generate a When building Xcode projects with Bazel, the BUILD file(s) become the Within the workspace directory or specified as imports in the WORKSPACE Differences between Xcode and Bazelīazel requires you to explicitly specify every build target and itsĭependencies, plus the corresponding build settings via build rules.īazel requires all files on which the project depends to be present Troubleshooting solutions to address common errors. Itĭescribes the differences between Xcode and Bazel, and provides the stepsįor converting an Xcode project to a Bazel project. This page describes how to build or test an Xcode project with Bazel.
0 Comments
Leave a Reply. |