Suppose I have 3 project files in Xojo.
Project 1 is a Cartesian graph class (test harness application unit tests)
Project 2 is a histogram graph class (test harness application unit tests)
These are tested and work and are committed as in git.
Projects as xojo_project and Classes as xojo_code
Project 3 will be an application that will use the ‘classes’ developed in 1 and 2.
I want to use the classes I built in these two projects as external classes.
Q1) How do I import them but keep them external? Q2) What happens if I modify one of these imported classes? (I don’t think I should be allowed.)
In theory it can be done by having all the xojo_project files at a common root level and have all your projects under that, so they can shared common classes etc. However i tried this a while ago and came across issues with adding references to classes and modules in subfolders and xojo would save the path incorrectly, i think it was just a bunch of …/…/…/. I worked around this but it was annoying.
There is also nothing locking your classes so one app’s changes can break another. Compile parameters help for that one.
Best solution is to wait for Xojo Libraries, which will be hopefully available soon … ish
You can add git repositories as git submodules to another repository. Then import the classes in your main project. Xojo will handle them as normal internal classes. The structure in xojo must be identical to the structure in the file system.
I use attlassian sourcetree to handle the submodules.
But as mentioned before you should not change the classes in submodules because you can break other projects. These classes should only developed in their own main repository. This way you can update the module when needed.
This only works with xojo text format, so you have to have a pro license.
Agreed. Although that Lite doesn’t have it is a problem for those working on just the one platform. It ought to be possible (referencing that other thread) to add Text format to Lite for a fee.