I set this up by creating a "themes" directory inside my main repo. For instance with ProForm, my directory structure in development actually looks like this:
~/public_html/ee/third_party/proform/
__notes/
__static/
config/
docs/
language/
libraries/
models/
plugins/
templates/
tests/
themes/
views/
config.php
ext.proform.php
index.html
mcp.proform.php
mod.proform.php
README
tab.proform.php
upd.proform.php
I have multiple directories like this, one for each add-on that I write. Each of these is it's own git repository.
Notice that there is a directory here named "themes". This doesn't actually end up in this location within my produced ZIP files, but is just here to keep everything in one place within the repository.
I create a shared themes directory which contains soft links into each add-on:
$ cd ~/public_html/ee
$ mkdir themes
$ cd themes
$ ln -s ~/public_html/ee/third_party/proform/themes ./proform
This directory ends up with a single linked themes directory for each add-on.
I then have multiple EE installations, one for each point release that I test with. These go into directories such as
~/public_html/ee231
~/public_html/ee252
Within each of these, I go to it's system/expressionengine/ directory and create a soft link to the main third_party directory above:
$ cd ~/public_html/ee252/system/expressionengine
$ rm -rf third_party
$ ln -s ~/public_html/ee/third_party ./third_party
I then create a link to the themes directory which itself contains the soft links into each add-on:
$ cd ~/public_html/ee252/themes
$ rm -rf third_party
$ ln -s ~/public_html/ee/themes/third_party ./third_party
This way, I have all of my add-ons 1) in their own repos, 2) with a simple layout including the theme directory and 3) available for easy testing in all my supported EE versions.
Edit: I should also note that I use a build script which assembles the actual add-on directories into the expected structure prior to zipping them up - for example, for ProForm this is:
- Removes all directories that start with __
- Moves the root into {zip_base}/system/expressionengine/third_party/proform
- Moves the themes/ directory into {zip_base}/themes/third_party/proform
Finally, I also manage all of this using the excellent git-flow strategy. My build script will produce a ZIP file using this logic from any point release tagged by git-flow, and will automatically include reusable libraries or other bits that I need to assemble (such as building static documentation HTML from sources, including ProLib, etc.).