Let one subproject use specific version of another subproject


in a multi project - all subprojects managed by the same git repository - let’s assume the following situation:

Subproject ‘:A’, version 1.0.0, depends on subproject ‘:B’, version 3.5.1.

Now, ‘:B’ is further developed on, leading to version 4.0.0, making it incompatible with version 1.0.0 of ‘:A’.

Is it possible to let ‘:A’ still use version 3.5.1 of ‘:B’?

I mean, some mechanism would need to checkout the correct version 3.5.1 of ‘:B’ from git to build ‘:A’, right?

I think it will not work if you have both subproject (of what?) in the same Git repo. In a build, you can only checkout one special version.
But, as ‘B’ can be built without ‘A’, you can make it a library of ‘A’ and use it as a binary loaded from file directory or from a binaray repo. Or, the best would be to separate them into different Git repos.

Ok, thanks.
I think, either of your suggestions should also work for me.