Hi,
I’m working on a personal project which results in the writing of 3 applications, which share part of their source code.
In this project P, the structure of the files looks for example like this :
Application A : Source files app_a.cr, a1.cr, a2.cr, a3.cr, a4.cr, …
Application B: Source files app_b.cr, b1.cr, b2.cr, a1.cr, a3.cr, …
Application C : Source files app_c.cr, c1.cr, c2.cr, b1.cr, a4.cr, …
For the moment, I have organized the file tree in the following way:
project_p/
src/
app_a.cr
app_b.cr
app_c.cr
app_a/
a1.cr
a2.cr
a3.cr
a4.cr
...
app_b
b1.cr
b2.cr
...
app_c
c1.cr
c2.cr
...
and with the appropriate “require” in code and appropriate “targets” in the shard.yml file, everything is ok.
Except that I wonder about the question of how to manage the version numbering. Each of the 3 applications has logically its own numbering, but the shard.yml file can only contain one (the one of the project P, but not defined as not used!). I guess, however, that this can only become a problem if the project is published.
Nevertheless, I would be happy to know the most appropriate solution in this case. For example, would it be better to split the project into 3 subprojects, with symbolic links to the shared source files?
Or is there a better solution?
Thanks for your advice.