OK so if ANYONE is watching this topic, or cares, I am working on a prototype
Comments welcomed !
So far a “sync config” , which going in the same DIR as the project your going to sun other code INTO looks like
{
"last-sync" : "" ,
"sources" : [
{ "source" : "../project-dir/",
"items" : [
{ "item" : "Folder=folder_full_of_parts" },
{ "item" : "Class=timer_subclass" } ,
{ "item" : "Module=some_module_name" }
]
},
{ "source" : "../another-project/untitled.xojo_project",
"items" : [
{ "item" : "Module=CSVModule" },
{ "item" : "Module=generic_methods" }
]
}
]
}
last sync will get rewritten all the time with the last sync data (not 100% sold on this but … )
sources is an array of source projects so any number of other projects code can be copied in
each source has
source : a relative path to the dir containing a text project
OR
a relative path to a specific xojo_project file
an array of items where each item has
the KEY=VALUE name of the item from the manifest
the sync process will :
- verify the sources are reachable
- verify the items in each source are reachable
- verify that copying the items will not cause conflicts in terms of names, types, paths, ids etc
it will do all this BEFORE it ever touches the project its going to copy things in to
Because the process needs to be robust & IS going to alter project files etc it needs to be right before doing any of this (ESP if you’re NOT using source control for everything !)
Once it has verified that things are one it will
- copy ALL items from the source into the destination
- add every copied item to the manifest of the project that things re being copied into
If, as shown above, you copy a FOLDER from a project, you do not have to list all items contained in the folder. The process will copy them all automatically.
The same will happen for a module
You can list individual items IF you want and any needed paths will be added to the file system
Thoughts ?
FAQS :
-
why copy and not use relative paths for everything ?
relative paths only work well for some items
and relative paths mean that any changes in the original immediately hap[pen in the other projects
copies allow me to control WHEN the updates to other projects happen
-
why is such tool needed ?
You could copy & paste from one project to another
But that doesnt scale very well, can be time consuming and, as noted in a couple bug reports, may not work for every kind of project item (web projects you cant copy the App instance or remove it so if you need to replace it you have to do something else)
You could put everything in the same directory as others have done but that has its own set of risks when you intermingle many projects in the same directory. Some items, like Build Automation, don’t share well across many projects.