Programming Languages - Build Tools
Build toolchain: compiler + linker + libraries + others.
- compilers: check out Compilers and Runtimes page.
- linker: used to combine the objects into a single executable image or binary file.
Build tools / package managers:
Tool | Config / DSL | C/C++ | JVM | Rust | Go | Swift | JS |
---|---|---|---|---|---|---|---|
CMake | CMakeLists.txt | Yes | |||||
Gradle | Groovy / Kotlin | Yes | Yes | Yes | |||
Maven | xml | Yes | |||||
Bazel | Starlark (Python) | Yes | Yes | Yes | Yes | ||
Cargo | toml | Yes | |||||
NPM | json | Yes |
JVM inclues Java, Kotlin, Scala, etc.
Build Tools
- Makefile: manual, only for small projects
- CMake: (https://cmake.org/) an open-source build tool
- Bazel (https://bazel.build/): Google's open-source build tool (internally called Blaze) client / server
- Starlark as the config language, a dialect of Python. Used in
BUILD
and.bzl
files https://github.com/bazelbuild/starlark/ - Soong: for Android AOSP. Similar to Bazel, and being migrated to Bazel;. https://android.googlesource.com/platform/build/soong/+/refs/heads/master/README.md
- Starlark as the config language, a dialect of Python. Used in
- Buck2 (https://buck2.build/): Facebook's open-source build tool. C++, Python, Rust. Also using Starlark (same as Bazel)
- Meson: https://mesonbuild.com/
- supported languages include C, C++, D, Fortran, Java, Rust.
- used by GIMP, glib, lxc, libfuse (https://github.com/libfuse/libfuse)
- Gradle: Android Studio uses Gradle by default to build Android apps. Use Groovy or Kotlin. Can build JVM languages and C++, Swift, etc.
- Kotlin DSL added in 8.0 as an alternative to the Groovy DSL.
- Gradle vs Gradlew:
gradle
is the command, used to init the project andgradlew
script;gradlew
is the wrapper, which is committed in the source control, used to build / test a project and run gradle tasks.
- Maven
Both Bazel (from Google) and Buck (from Meta) write rules in starlark (a Python-like language); Buck 1 and Bazel are written in Java, while Buck 2 is in Rust.
Package Managers and Registries
- Java / Kotlin / Scala: Maven Central https://search.maven.org/
- Python: Python Package Index
- Node.js:
npm
(Node Package Manager) https://www.npmjs.com/ - Ruby: RubyGems.
- Perl: Comprehensive Perl Archive Network (CPAN)
- R: Comprehensive R Archive Network (CRAN).
- Rust: https://crates.io/
Cloud Services
- Google Cloud Build: https://cloud.google.com/build
- AWS CodeBuild: https://aws.amazon.com/codebuild/