projectGeneratorSimple
projectGeneratorSimple copied to clipboard
Allow existing projects to be dropped onto the generator to edit them
It would be really nice to be able to add addons to your project after you actually created it. I think you can do this if you use the project generator to create a project in exactly the same place as the old one, but it woud be nicer to drop onto the window rather than type the identical name.
In order to make it easier, I made a class to analyze what gets dropped onto the oF window here:
https://github.com/mazbox/projectGeneratorSimple/blob/master/src/DroppedFileAnalyzer.h
Name is a little long winded, but you call
analyzer.analyzeDroppedFiles(vector<string> &files, DroppedFileAnalyzerListener *listener);
then your listener gets callbacks depending on what was dropped:
virtual void droppedAddon(string addonName) {
// this gets called back if addons are dropped (Can be called multiple times.)
}
virtual void droppedSourceFolder(string src) {
// called if you have dropped a single source folder containing at least one source file.
}
virtual void droppedSourceFiles(vector<string> &files) {
// called if you drop a bunch of files (at least one must be a source file.
}
virtual void droppedProjectFolder(string path) {
// called if you dropped a folder which contains at least one project file.
}
virtual void droppedProjectFile(string path) {
// called if you dropped a single file and it's a project file
}
virtual void droppedNothingOfImportance() {
// ...
}
I didn't try to roll this in myself, because it looks as if the project generator is going to change a lot as of ofdevconxYCAM, and thought it would be good to keep it separate.
I think it also picks out what addons are already in the project file with a regex (should work on all platforms). From that you should be able to tell if an xcode project is mac or iphone.