We are excited to announce that the J2ObjC project has started adding support for
Bazel! Bazel is a build and test tool, similar to Maven or Gradle, that is designed for speed and reliability. Here's the
Bazel Getting Started documentation.
This support introduces a J2ObjC Bazel module and a
j2objc_library build rule. iOS build rules are provided by the
rules_apple module (
tutorial), where
j2objc_library references are used like
objc_library references are.
To try Bazel out with J2ObjC, please follow these steps on a Mac:
- Set up a J2ObjC build environment and cd to that directory.
- Install Bazelisk, which helps manage Bazel versions across projects. If you have Homebrew installed, use "brew install bazelisk".
- Run "make -j dist" to generate the JRE libraries (this is a temporary step).
- Navigate to examples/Hello and run "bazel run hello_j2objc_app".
- Navigate to examples/Contacts and run "bazel run Contacts".
Coming soon:
- Updated documentation.
- The ability to build jre_emul with j2objc_library (which will eliminate the make dist step).
- New build rules: j2objc_proto_library, j2objc_import, and j2objc_cycle_finder.
- Contributing J2ObjC's rules to the Bazel Central Repository.