GitHub / Xojo Best practices work flow and class sharing

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.)

2 Likes

Are your projects in separate repos or do they share a common one?

Each are in separate repositories.

Perhaps i need to consider a different structure.

Its the lack of producing a dll that i think is my issue.
If I make a library of my classes I have to ‘have’ the xojo code.

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

I am thinking that there is a way to use and exe as a dll. (server)

Xojo Libraries are exactly what you want, they should be coming very soon. I am hoping 2024r2

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.

1 Like

Or Desktop.

:+1:

I missed that. Just thought it was part of the pro license. It has changed, hasn’t it?

Don’t think so. I’ve had Desktop since 2019 or so and it had Text format then.

Ok, we have the Pro license since 2013… probably I just didn’t remember… anyway it is good, that text format is not pro only…

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.