Quick Start
Migrate any CMake or Gradle project to Bazel in three commands.
-
Analyze — See what rebaze detects
Terminal window rebaze analyze .Detected build systems: cmake -
Migrate — Generate Bazel files
Terminal window rebaze migrate .- MODULE.bazel
- BUILD.bazel
- .bazelversion
- .bazelrc
-
Build — Verify it works
Terminal window bazel build //...
Done. Your project now builds with Bazel.
Preview before writing
Section titled “Preview before writing”Use --dry-run to see what would be generated:
rebaze migrate . --dry-runCustomize with config
Section titled “Customize with config”Create rebaze.toml for custom dependency mappings:
[mappings.system_libraries]myvendorlib = "@myvendor//:lib"
[strategy]default = "system"Then migrate:
rebaze migrate . --config rebaze.tomlCommon recipes
Section titled “Common recipes”Map an unknown library
Section titled “Map an unknown library”[mappings.system_libraries]customlib = "@customlib"Use hermetic builds
Section titled “Use hermetic builds”[strategy]default = "source"Pin dependency versions
Section titled “Pin dependency versions”[versions]rules_cc = "0.1.1"googletest = "1.15.2"Troubleshooting
Section titled “Troubleshooting”“Unknown library ‘xyz’, skipping”
→ Add to [mappings.system_libraries] in rebaze.toml
Build fails after migration → Check include paths and verify all sources are captured
Missing dependencies
→ Run with --verbose to see what rebaze detected
Next steps
Section titled “Next steps”- CMake Tutorial — Detailed walkthrough with examples
- Gradle Tutorial — Java/Kotlin project migration
- CLI Reference — All command options