-
-
Save nfisher/bf610d33c5772e7c8cdaf64edee542f1 to your computer and use it in GitHub Desktop.
BUCK file to generate Java code from an Avro IDL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prebuilt_jar( | |
name = 'avro', | |
binary_jar = 'lib/avro-1.8.1.jar', | |
source_jar = 'lib/avro-1.8.1-sources.jar', | |
) | |
prebuilt_jar( | |
name = 'avro-tools-jar', | |
binary_jar = 'lib/avro-tools-1.8.1.jar', | |
) | |
java_binary( | |
name = 'avro-tools', | |
main_class = 'org.apache.avro.tool.Main', | |
deps = [':avro-tools-jar'], | |
) | |
genrule( | |
name = 'policy-avpr', | |
srcs = ['src/main/resources/policy.avdl'], | |
cmd = '$(exe //:avro-tools) idl $SRCS $OUT', | |
out = 'policy.avpr', | |
) | |
# d'oh this generates a Java src package directory structure | |
genrule( | |
name = 'policy-java', | |
srcs = [':policy-avpr'], | |
cmd = '$(exe //:avro-tools) compile -string protocol $SRCS $OUT', | |
out = 'com', | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment