I have an Android Project made up of 5 separate modules. Many of the modules contain .java files as well .thrift files; for these modules, Thrift must execute before the java build can begin. These modules have build.xml files which contain targets for the Thrift part of the build. In order to execute the Thrift build target for a module prior to its java build, I do the following:
1) Add the module's build.xml file to the Ant Build Window.
2) Select the module in the Ant Build window, right-click, and select "Execute on > Before Compilation".
My problem is that "Before Compilation" can only be set for one module at a time. I would like to be able to have "Before Compilation" set for all the individual modules that depend on Thrift (and not have to "toggle" the setting between modules).
My solution was to have a build.xml file at the top level Project directory that contains a target to do the Thrift part of the build for all modules that rely on Thrift. Now I just add the top-level build.xml to the Ant Build window and set that to "Execute on > Before Compilation". The problem with this solution is, now if I execute "Make Module" on a module in the Project window, the Before Compilation target is executed for all modules with a Thrift target (as opposed to just for the module being built).
Any suggestions for a better solution?