blob: 40a5157f68ec84812d98bda3d2967b3cc5c86e35 [file] [log] [blame] [view]
Dave MacLachlan2f4d1c22016-02-03 22:29:27 +00001# J2ObjC Examples
Michael Thvedt583c3562015-08-12 18:09:52 +00002
3J2ObjC is an open-source tool that can transpile Java code to Objective-C code,
Dave MacLachlan2f4d1c22016-02-03 22:29:27 +00004which can then be used by dependent Objective-C code. The J2ObjC repository can
5be found at <https://github.com/google/j2objc>.
Michael Thvedt583c3562015-08-12 18:09:52 +00006
Dave MacLachlan2f4d1c22016-02-03 22:29:27 +00007The example in this directory shows a simple use of J2Objc with a Java library
8and an iOS app.
Michael Thvedt583c3562015-08-12 18:09:52 +00009Because it builds an iOS application it can only be run on Mac OSX.
10Here, a java_library is transpiled to Objective-C via j2objc_library.
11We can then have an objc_library call upon this library.
12
13Build the top-level application with
14`bazel build examples/j2objc:J2ObjcExample`, which when finished emits the
15path to a generated .ipa which you can then install to your test device. The
16same build will also emits the path to an Xcode project directory which you can
Dave MacLachlan2f4d1c22016-02-03 22:29:27 +000017open to continue working with the application in Xcode.