Including generated code in JAR with Gradle -


I have written a simple job to generate savings files:

  Turnstreet & lt; & Lt; ({Src / main / thrift}} {{'/ / *. Thrift '} exec {executable =' saving 'args = [' --gen ',' java: hashcode ',' -o ',' tmp ', thriftfileSollege {relative path (this)} .join (",")) }}   

This works fine for me what I want to do, hook it in the build process, so that my jar file includes stubbs. I'm having a lot of trouble telling where from where it is hooking up, and where do I write the files so that they get involved in my jar. What is the best way to do this or such a project?

I recommend writing files in a subdirectory of the output output directory, thrift- Speak stubbs . Then you can include them in the jar:

  jar {from "$ buildDir / thrift-stubs"}    

Comments