I wrote a simple gradle task to generate economical files:
task generateThrift << { thriftFiles = fileTree(dir: 'src/main/thrift').matching { include '**/*.thrift' } exec { executable = 'thrift' args = ['--gen', 'java:hashcode', '-o', '/tmp', thriftFiles.collect { relativePath(it) }.join(",") ] } }
This works great for me. What I want to do is connect it to the build process so that the stubs are included in my JAR file. I am having trouble finding a good example where to do this and where to write files so that they are included in my JAR. What is the best way to do this or a project that has an example?
source share