Hi @all,
we are very happy composer users. However, in one of our more complex projects, we've been banging our heads against the wall
for quite a while now and can't figure out a working approach.
We have the following project structure:
MainProjectDirectory
-Project1
-vendor
-src
-test
-vendor
-src
-test
-Library
-vendor
-src
-test
-.git
As you can see, both projects and the library reside in the same git repository. The repository is therefore set up on a per-project basis, which is our usual approach.
The "Library" contains stuff that is needed in both projects.
Now, we want Project1 and Project2 to require Library; put simply, composer would just have to copy the directory "Library" to the corresponding vendor subdirectories in Project1 and Project2.
We know that we could use a separate git repository for the library, but we're not keen to do so as we feel it would hamper the "coding flow" if we'd have to check in our library changes and run composer everytime to see them in the projects.
Furthermore, we do not want to create an extra repository as to us, that simply seems like overkill - we would end up with for or five the time of our current repository count, with most of the repositories beeing of no use to any other but the main project.
We're ok with updating the library and seeing the changes reflected in the projects after running composer update/install once per project (or triggered globally from the main project).
We've done a lot of research on this one and could not find a way to make it work. The repository types provided by composer (git, hg, ...) are not able to simply copy over a directory.
We are sure that this is for a good reason. However, we need to solve our problem and thus hereby turn to you, dear community, begging for help.
If this is not the way composer is meant to be used, can we adjust our project setup to reach a similar structure with composer?
Or have we simply overseen an important detail in composer which would make the given project setup work?
Thank you all in advance!