Boot tasks for fetching google protobuf protoc binary and compiling proto file.
(set-env!
:dependencies
'[[com.google.protobuf/protobuf-java "3.0.2"] ;; needed to compile *.java
[boot-protobuf "0.3.0" :scope "test"]])
(require '[boot-protobuf.core :refer [compile-protobuf-java]])
compile-protobuf-java
task do following jobs.
- Fetch google protobuf protoc(protobuf compiler) binary files.
- Caching protoc binary file for next trampoline.
- Execute protoc for compiling `*.proto` file to java.
- `add-resource` above generated java source file.
(boot
(compile-protobuf-java :proto "message.proto")
(javac :options ["-Xlint:none"])
(sift :include #{#".*/.*.java$"} :invert true) ; optional
)
Deprecated boot-protobuf single segment ns, use boot-protobuf.core instead.