Git Product home page Git Product logo

lein-protobuf's Introduction

lein-protobuf is a Leiningen plugin for compiling Google Protobuf .proto files into Java .class files. It can be used with or without clojure-protobuf, which is a Clojure wrapper around the Java protobuf API.

Getting started

Add the following to your project.clj file:

:plugins [[lein-protobuf "0.5.0"]]

Replace "0.5.0" with the actual latest version, which you can find at http://clojars.org/lein-protobuf.

Also, you should add the version of the protobuf library to your dependencies in project.clj corresponding to the version of protoc being used:

:dependencies [[com.google.protobuf/protobuf-java "2.6.1"]]

Note: lein-protobuf requires at least version 2.0 of Leiningen.

Usage

By default, lein-protobuf looks for .proto files in resources/proto in your project directory. This was chosen as the default location so that .proto files would also be included in your jar files. You can change this with:

:proto-path "path/to/proto"

You can specify custom protoc executable with:

:protoc "/usr/local/bin/protoc260"

To compile all .proto files in this directory, just run:

lein protobuf

You can also compile specific proto files with:

lein protobuf file1.proto file2.proto

We also add a hook to Leiningen's compile task, so .proto files will automatically be compiled before that task runs. So if you like, you can simply run:

lein compile

Protoc versions

Protoc version lein-protobuf version
2.6.1 0.4.3
2.5.0 0.4.0

Getting Help

If you have any questions or need help, you can find us on IRC in #flatland.

License

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

lein-protobuf's People

Contributors

echeran avatar edvorg avatar glenjamin avatar ninjudd avatar raspasov avatar raynes avatar rymndhng avatar

Watchers

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