All Projects → jin → create-bazel-workspace

jin / create-bazel-workspace

Licence: Apache-2.0 License
Generate a new polyglot Bazel workspace with minimal configuration

Programming Languages

python
139335 projects - #7 most used programming language
go
31211 projects - #10 most used programming language
java
68154 projects - #9 most used programming language
C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to create-bazel-workspace

Bazel
a fast, scalable, multi-language and extensible build system
Stars: ✭ 17,790 (+111087.5%)
Mutual labels:  bazel, build-system, multi-language
Please
High-performance extensible build system for reproducible multi-language builds.
Stars: ✭ 1,856 (+11500%)
Mutual labels:  bazel, build-system, multi-language
Rules haskell
Haskell rules for Bazel.
Stars: ✭ 196 (+1125%)
Mutual labels:  bazel, build-system
Awesome Bazel
A curated list of Bazel rules, tooling and resources.
Stars: ✭ 640 (+3900%)
Mutual labels:  bazel, build-system
android-projects
Android benchmark projects for Bazel and Gradle
Stars: ✭ 29 (+81.25%)
Mutual labels:  bazel, build-system
react-native-multi-language-app
Multi Language example app with react native
Stars: ✭ 26 (+62.5%)
Mutual labels:  multi-language
bazel-demo
Simple demo for building a TypeScript project with Bazel.
Stars: ✭ 40 (+150%)
Mutual labels:  bazel
cmany
Easily batch-build cmake projects!
Stars: ✭ 15 (-6.25%)
Mutual labels:  build-system
bazel-cache
Minimal cloud oriented Bazel gRPC cache
Stars: ✭ 33 (+106.25%)
Mutual labels:  bazel
l3build
A testing and building system for LaTeX
Stars: ✭ 63 (+293.75%)
Mutual labels:  build-system
jekyll-skeleton
Scaffolding to start with a Jekyll website
Stars: ✭ 27 (+68.75%)
Mutual labels:  multi-language
kconfig
Kconfig for ARM based MCUs
Stars: ✭ 15 (-6.25%)
Mutual labels:  build-system
rules hugo
Bazel build rules for hugo static website generator
Stars: ✭ 41 (+156.25%)
Mutual labels:  bazel
CODER
CODER: Knowledge infused cross-lingual medical term embedding for term normalization. [JBI, ACL-BioNLP 2022]
Stars: ✭ 24 (+50%)
Mutual labels:  multi-language
rules gwt
Bazel rules for GWT
Stars: ✭ 20 (+25%)
Mutual labels:  bazel
LMPHP
Multi-language management and support on the site.
Stars: ✭ 19 (+18.75%)
Mutual labels:  multi-language
real-world-bazel
Bazel build files collected from real-world GitHub projects
Stars: ✭ 24 (+50%)
Mutual labels:  bazel
blight
A framework for instrumenting build tools
Stars: ✭ 57 (+256.25%)
Mutual labels:  build-system
alfred
(v0.2) Even Batman needs a little help. Task runner. Automator. Build system.
Stars: ✭ 62 (+287.5%)
Mutual labels:  build-system
covector
Transparent and flexible change management for publishing packages and assets.
Stars: ✭ 28 (+75%)
Mutual labels:  polyglot

create-bazel-workspace

Create a polyglot Bazel workspace easily, with sane defaults for multiple languages (layers).

Quick start

$ go get github.com/jin/create-bazel-workspace

$ go install github.com/jin/create-bazel-workspace

$ $GOPATH/bin/create-bazel-workspace -dir <output-dir> <layer 1> <layer 2> ... <layer N>

For example, if you want go and scala, run

$ create-bazel-workspace go scala

The default output directory is named bazel-workspace.

Layers

A layer contains the following:

  • Minimal example that makes use of the layer's rulesets (e.g. android_binary and android_library for the android layer). This example is available as a top level target //:<layer>_example in the generated workspace.
  • WORKSPACE: Specifies the WORKSPACE content
  • BUILD.bazel: Specifies the top level BUILD file
  • post_create.txt: Further instructions for a layer after create-bazel-workspace

When you specify multiple layers, files in each layer will be appended to the base layer sequentially.

Supported <layer> are the the names of the directories in this repository, e.g. android, scala, go.

Additional instructions

Depending on the layer, there may be more commands to run after create-bazel-workspace. For example, the go layer may require running bazel run //:gazelle. These instructions are logged in <bazel-workspace-output>/instructions.md:

$ cat bazel-workspace/instructions.md
# Instructions for the base layer:

Please file issues at https://github.com/jin/create-bazel-workspace

# Instructions for the go layer:

From rules_go, please run:

    $ bazel run //:gazelle

This will generate a BUILD.bazel file for each Go package in your repository. 
You can run the same command in the future to update existing build files with 
new source files, dependencies, and options.

Please file issues at https://github.com/bazelbuild/rules_go

# Instructions for the android layer:

From https://github.com/quittle/bazel_android_sdk_downloader:

    $ bazel run @androidsdk//install

This will attempt to download the SDK for the versions specified. If you change
these values, clean the workspace, or check it out fresh, you will need to
re-run this command to download and install the SDK again.

Please file issues at https://github.com/bazelbuild/rules_android

# Instructions for the scala layer:

Please file issues at https://github.com/bazelbuild/rules_scala

Development

This project can be built with Bazel. Build the binary by running

$ bazel run //:create-bazel-workspace

To regenerate the BUILD files, run

$ bazel run //:gazelle

To add a new dep, run

$ bazel run //:gazelle -- update-repos example.com/dep/repo

Contributing a Layer

To add a layer, open a pull request with new top-level directory named after the layer, containing these files:

  • <layer>/WORKSPACE.bzl
  • <layer>/BUILD.bazel.bzl
  • <layer>/post_create.txt

These files are allowed to be empty.

Idea

create-bazel-workspace is inspired by create-react-app and Spacemacs's concept of layers.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].