boot-protobuf

Boot tasks for fetching google protobuf protoc binary and compiling proto file



Documentation

boot-protobuf

https://img.shields.io/clojars/v/boot-protobuf.svg https://jarkeeper.com/ajchemist/boot-protobuf/downloads.svg https://travis-ci.org/aJchemist/boot-protobuf.svg?branch=master

Boot tasks for fetching google protobuf protoc binary and compiling proto file.

Usage

(set-env!
 :dependencies
 '[[com.google.protobuf/protobuf-java "3.0.2"] ;; needed to compile *.java
   [boot-protobuf "0.2.0"]])

(require '[boot-protobuf :refer [compile-protobuf-java]])

compile-protobuf-java task do following jobs.

  1. Fetch google protobuf protoc(protobuf compiler) binary files.
  2. Caching protoc binary file for next trampoline.
  3. Execute protoc for compiling `*.proto` file to java.
  4. `add-resource` above generated java source file.
(boot
 (compile-protobuf-java :proto "message.proto")
 (javac :options ["-Xlint:none"])
 (sift :include #{#".*/.*.java$"} :invert true) ; optional
 )