rulesets of various languages in Bazel
Bazel supports various programming languages through rulesets, which provide rules and configurations specific to each language. These rulesets define how Bazel handles building, testing, and managing dependencies for projects written in different programming languages. Here are some of the commonly used rulesets for different languages supported by Bazel:
1. Java
- Java Ruleset: Built-in support for Java projects.
java_library
: Defines a Java library target.java_binary
: Defines a Java executable target.java_test
: Defines a Java test target.
2. C++
- C++ Ruleset: Provides rules for C++ projects.
cc_library
: Defines a C++ library target.cc_binary
: Defines a C++ executable target.cc_test
: Defines a C++ test target.
3. Python
- Python Ruleset: Provides rules for Python projects.
py_library
: Defines a Python library target.py_binary
: Defines a Python executable target.py_test
: Defines a Python test target.
4. Go
- Go Ruleset: Provides rules for Go projects.
go_library
: Defines a Go library target.go_binary
: Defines a Go executable target.go_test
: Defines a Go test target.
5. TypeScript / JavaScript
- NodeJS Ruleset: Rules for Node.js projects.
nodejs_binary
: Defines a Node.js executable target.nodejs_library
: Defines a Node.js library target.nodejs_test
: Defines a Node.js test target.
6. Rust
- Rust Ruleset: Rules for Rust projects.
rust_library
: Defines a Rust library target.rust_binary
: Defines a Rust executable target.rust_test
: Defines a Rust test target.
7. Swift / Objective-C
- Apple Ruleset: Rules for iOS and macOS development.
objc_library
: Defines an Objective-C library target.objc_binary
: Defines an Objective-C executable target.objc_test
: Defines an Objective-C test target.swift_library
: Defines a Swift library target.swift_binary
: Defines a Swift executable target.swift_test
: Defines a Swift test target.
8. Scala / Kotlin
-
Scala Ruleset: Rules for Scala projects.
scala_library
: Defines a Scala library target.scala_binary
: Defines a Scala executable target.scala_test
: Defines a Scala test target.
-
Kotlin Ruleset: Rules for Kotlin projects.
kt_library
: Defines a Kotlin library target.kt_binary
: Defines a Kotlin executable target.kt_test
: Defines a Kotlin test target.
Custom and Community Rulesets
In addition to the built-in rulesets provided by Bazel, there are also custom and community-maintained rulesets available for integrating with other languages and tools not directly supported out-of-the-box by Bazel. These rulesets can extend Bazel's capabilities to support specific project requirements and environments.