Git Product home page Git Product logo

rules_player's Introduction

rules_player

CircleCI

This repository contains all of the common Bazel definitions for building Player polyglot repositories. While these rules are mostly generic and may be suitable for other use-cases, our primary goal is to enable the Player repo and plugin builds โ€” rules and implementations may change to support that.

This repo takes inspiration from the following:

Usage

Add the following to you WORKSPACE to setup player_common for consumption:

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "rules_player",
    remote = "https://github.com/player-ui/rules_player",
    branch = "main",
)

Then, for most cases, you can add all ruleset declarations by executing the deps macro from //workspace.bzl file and configure toolsets as needed with the macros from tool/conf.bzl:

# Load all Player common ruleset definitions
load("@rules_player//:workspace.bzl", "deps")
deps()

# Configure specific toolchain with common properties
load("@rules_player//kotlin:conf.bzl", "kotlin")
kotlin()

If you don't want to add all common ruleset declarations, adding ruleset declarations can be done on a 1-by-1 basis:

load("@rules_player//kotlin:workspace.bzl", kotlin_deps = "kotlin")
kotlin_deps()

Contributing

Each tool defined in this repo has it's own folder that contains two main .bzl files, workspace.bzl and conf.bzl. workspace.bzl is responsible for declaring where the tool rules live, i.e. an http_archive or git_repository. These are just definitions and Bazel will download or clone them lazily, only once the workspace or builds attempt to load a macro or rule from these definitions. The conf.bzl file is optional, but can be used to contain configuration logic in a macro.

For instance, the kotlin/workspace.bzl defines the http_archive where to load Kotlin rules from and the kotlin/conf.bzl loads the rules from the http_archive to regsiter the default Kotlin toolchains.

The top-level workspace.bzl exposes a macro that will define all the common rulesets necessary for Player build system. Consumers can then explicitly configure these rulesets, or use the corresponding conf.bzl files if the common configurations work for them.

rules_player's People

Contributors

adierkens avatar sugarmanz avatar ketanreddy avatar hborawski avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.