Giter VIP home page Giter VIP logo

bazel-project-generator's Introduction

Bazel BUILD files generator for JVM with package-level granularity

Build Status

This project aims not to provide a silver bullet for converting your Gradle or Maven build configurations to Bazel but instead it aims to help automate the most annoying 90+% of work required to support dependencies in your BUILD files for Kotlin/Java project. This Generator only relies on parsing your source code for figuring out package-level dependencies.

Example Projects Using the Generator

How to use

First of all a WORKSPACE file is needed to be created to define rules_jvm_external and rules_kotlin of your choice (you can take a look at WORKSPACE file of this project or any other example projects from above).

External Maven Dependencies

All external maven dependencies should be pined and defined in maven_install.json file in the root of your repository. Please refer to rules_jvm_external documentation for details.

The generator will use maven_install.json in order to infer packages that each of the external dependencies contain.

BUILD files generation

Please clone and build this project:

bazel build //:cmd 

Now you can try to generate BUILD files for your project:

bazel-bin/cmd --workspace-root ~/worspace/my-project --source-content-root module1/src --source-content-root module2/src

Note: if none of the --source-content-root are passed the generator will try to find recursively all src folders inside --workspace-root.

Generation options

  • --source-content-root - path to root of your project where WORKSPACE file from above was created.
  • --source-content-root - relative or absolute paths to folder where Generator will look for source roots (Generator expects Maven project structure ).
  • --dependencies - path to a JSON file with dependencies (defaults to dependencies.json).
  • --caching - Downloaded jar files will be cached in .cache/maven folder.
  • --dry-run - Run everything without generating BUILD files.

Questions

Feel free to open issues with feature request and reports. Also don't hesitate to reach out on Twitter.

bazel-project-generator's People

Contributors

fkorotkov avatar seanabraham 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.