diff options
author | 2015-10-14 18:23:25 +0000 | |
---|---|---|
committer | 2015-10-14 18:30:25 +0000 | |
commit | 6afd4167fabf9fb292167f70b20b674829c0739a (patch) | |
tree | 1681a177a1fafb65d0ea2e0760244256de8f616e /site | |
parent | c4c93891c5107390648318b7564c9fdc690b034a (diff) |
Update ios-app tutorial to use ios_application for bundling instead of the deprecated bundling functionality of objc_binary.
This is to be coordinated with updating the example app (linked to within the tutorial)
--
MOS_MIGRATED_REVID=105430949
Diffstat (limited to 'site')
-rw-r--r-- | site/docs/tutorial/ios-app.md | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/site/docs/tutorial/ios-app.md b/site/docs/tutorial/ios-app.md index 89908175f9..fd99f6be30 100644 --- a/site/docs/tutorial/ios-app.md +++ b/site/docs/tutorial/ios-app.md @@ -65,21 +65,38 @@ Note the name of the rule, `UrlGetClasses`. ## Add an objc_binary rule -The [`objc_binary`](/docs/build-encyclopedia.html#objc_binary) rule creates the -bundled `.ipa` archive file for the application and also generates an Xcode -project file. +The [`objc_binary`](/docs/build-encyclopedia.html#objc_binary) rule creates a +binary to be bundled in the application. Add the following to your `BUILD` file: ```python objc_binary( - name = "ios-app", + name = "ios-app-binary", srcs = [ "UrlGet/main.m", ], deps = [ ":UrlGetClasses", ], +) + +``` +Note how the `deps` attribute references the output of the +`UrlGetClasses` rule you added to the `BUILD` file above. + +## Add an ios_application rule + +The [`ios_application`](/docs/build-encyclopedia.html#ios_application) rule +creates the bundled `.ipa` archive file for the application and also generates +an Xcode project file. + +Add the following to your `BUILD` file: + +```python +ios_application( + name = "ios-app", + binary = ":ios-app-binary", infoplist = "UrlGet/UrlGet-Info.plist", ) ``` @@ -88,9 +105,6 @@ Now, save and close the file. You can compare your `BUILD` file to the [completed example](https://github.com/bazelbuild/examples/blob/master/tutorial/ios-app/BUILD) in the `master` branch of the GitHub repo. -Again, note how the `deps` attribute references the output of the -`UrlGetClasses` rule you added to the `BUILD` file above. - ## Run the build Make sure that your current working directory is inside your Bazel workspace: @@ -111,7 +125,6 @@ output will appear similar to the following: ```bash INFO: Found 1 target... Target //ios-app:ios-app up-to-date: - bazel-bin/ios-app/ios-app_bin bazel-bin/ios-app/ios-app.ipa bazel-bin/ios-app/ios-app.xcodeproj/project.pbxproj INFO: Elapsed time: 3.765s, Critical Path: 3.44s |