Bazel support coming soon to J2ObjC

5 views
Skip to first unread message

Tom Ball

unread,
Sep 3, 2025, 4:56:20 PM (6 days ago) Sep 3
to j2objc-discuss
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:
  1. Set up a J2ObjC build environment and cd to that directory.
  2. Install Bazelisk, which helps manage Bazel versions across projects. If you have Homebrew installed, use "brew install bazelisk".
  3. Run "make -j dist" to generate the JRE libraries (this is a temporary step).
  4. Navigate to examples/Hello and run "bazel run hello_j2objc_app".
  5. 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.
Reply all
Reply to author
Forward
0 new messages