Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • B bazel-java
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Administrator
  • bazel-java
  • Wiki
  • 2. Monorepos & Bazel

2. Monorepos & Bazel · Changes

Page history
Updated Monorepos & Bazel (markdown) authored Jan 06, 2022 by AzbotGithub's avatar AzbotGithub
Show whitespace changes
Inline Side-by-side
2.-Monorepos-&-Bazel.md 0 → 100644
View page @ 731c8bda
## Monorepo
### What is Monorepo?
Definitions vary, but we define a monorepo as follows:
The repository contains more than one logical project (e.g. an iOS client and a web-application)
These projects are most likely unrelated, loosely connected or can be connected by other means (e.g via dependency management tools)
![](https://github.com/evydtech/bazel-java/blob/83db84fc9387b48a08d98b44408054ab934724fe/Docs/Images/monorepo_bg.PNG)
### Benefits
* Ease of code reuse
* Simplified dependency management
* Atomic commits, Faster builds
* Large-scale code refactoring
* Closer Collaboration across teams
### Build Tools
* [Bazel](https://github.com/bazelbuild/bazel) (Google)
* [Buck](https://buck.build/) (Facebook)
* [Pants](https://www.pantsbuild.org/) (Twitter)
* [Nx](https://nx.dev/)
* [Please](https://please.build/)
## Bazel
Bazel is an open-source build and test tool similar to Make, Maven, and Gradle.
It uses a human-readable, high-level build language. Bazel supports projects in
multiple languages and builds outputs for multiple platforms. Bazel supports
large codebases across multiple repositories, and large numbers of users.
Bazel offers the following advantages:
* **High-level build language.** Bazel uses an abstract, human-readable
language to describe the build properties of your project at a high
semantical level. Unlike other tools, Bazel operates on the *concepts*
of libraries, binaries, scripts, and data sets, shielding you from the
complexity of writing individual calls to tools such as compilers and
linkers.
* **Bazel is fast and reliable.** Bazel caches all previously done work and
tracks changes to both file content and build commands. This way, Bazel
knows when something needs to be rebuilt, and rebuilds only that. To further
speed up your builds, you can set up your project to build in a highly
parallel and incremental fashion.
* **Bazel is multi-platform.** Bazel runs on Linux, macOS, and Windows. Bazel
can build binaries and deployable packages for multiple platforms, including
desktop, server, and mobile, from the same project.
* **Bazel scales.** Bazel maintains agility while handling builds with 100k+
source files. It works with multiple repositories and user bases in the tens
of thousands.
* **Bazel is extensible.** Many [languages](rules.html) are
supported, and you can extend Bazel to support any other language or
framework.
![](https://github.com/evydtech/bazel-java/blob/83db84fc9387b48a08d98b44408054ab934724fe/Docs/Images/bazel_structure.png)
### Drawbacks
One of the major drawback of Monorepo is its size, as all components are in single repo.
1. Git sparse-checkout
2. Github codespace
Clone repository
  • 1. DevOps
  • 2. Monorepos & Bazel
  • 3. Hello World in Java using Bazel
  • 4. Infrastructure Deployment
  • Dev Infrastructure
  • Home
  • Log management