Search code examples
androidcordovabuck

Buck Build Rules For Sub-Projects


Our project uses Cordova and a number of other sub-projects.

I read through the Buck documentation and start guide a few times and have been experimenting with building simple projects. I am now attempting to migrate our project over to using Buck (and Exopackage).

From the AntennaPod sample I see how to bundle the src files, the assets, and res into a project. However I am not clear on what build rules I need to follow to bundle sub-projects into the main one.

Can you point out the build rules I need that will add sub-projects to my main build or explain what I need to add to my main BUCK file that will properly organize and build sub-projects.

Below is a screen shot of our project structure with one of the sub-projects expanded.

The sub-projects I need to build and add are:

xwalk_core_library

CordovaLib

Cordova

com.phonegap.plugins.facebookconnect

Project Structure


Solution

  • You can create as many android_library and android_resource rules that you want. The important thing is to make sure you set your deps correctly. The final APK will contain all the transitive deps you specify.