Hey all,
I’m hoping to start a conversation that will turn into a consistent way to develop addons for openframeworks.
When we reach something we think is the best approach, we can create an official document and perhaps make a sticky post on the ‘extend’ forum describing it, as well as a post on the of wiki.
Say we’re making ofxMyAddon that requires ofxDependentAddon that someone else made
Folder structure:
the top level folder should be the same name as the addon
_ ofxMyAddon/_
beneath it there should be at least two sub folders
_ ofxMyAddon/src
ofxMyAddon/example_
the src folder should contain your addon source
_ ofxMyAddon/src/ofxMyAddon.h
ofxMyAddon/src/ofxMyAddon.cpp
…_
where the example should contain the example source and project files (the same style that you would normally find in apps/examples/someExample
_ ofxMyAddon/example/MyAddonExample.xcodeproj
…
ofxMyAddon/example/src/main.cpp
ofxMyAddon/example/src/testApp.h
ofxMyAddon/example/src/testApp.cpp
…
ofxMyAddon/example/bin/data_
if there are multiple examples you can have more than one example folder too
This is advantageous because users who download your addon folder can simply drop it into openFrameworks/addons/ and run the examples since they are at the same folder level as the project files in the apps examples.
Managing dependencies
Here’s where I think there will be some potential controversy. If ofxMyAddon requires someone else’s ofxDependentAddon how do we handle this?
My suggestion is that wherever you store ofxMyAddon you also store next to it a copy of ofxDependentAddon that your addon compiles against. This way if the developer of ofxDependentAddon changes it, it wont’ break yours.
If you’re using github for example, you should fork their addon repository into your account.
Also addons should follow the same github branching pattern that openFrameworks has adopted. Namely that there should always be a branch that compiles against the main releases, and a separate branches to keep up with development oF branch and try new features.
Central place for addons
We should find a way to ensure addons are updated here: http://openframeworks.info/ and in general try to build against the latest addons here if you have dependencies.
I know this is different than how Memo does MSA libs (https://github.com/memo/msalibs) or how I was managing ofxFlightphase addons - but I think one repository per addon will be more sustainable in the long run to have.
What does everyone think?