S
S
samizdam2014-05-24 00:05:29
git
samizdam, 2014-05-24 00:05:29

How to exclude a directory from a composer package?

I have a project that I want to package as a composer. The git repository where the code is stored contains PHPUnit tests.
That is, I pursue what goal:
a). When a user installs a package in vendor via composer, no tests are needed.
b). When a developer clones a repository , tests are needed.
In the documentation and the Internet, I only found information about exclude for archives, but this is not it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
samizdam, 2016-01-16
@samizdam

Obviously, the solution to my question was worth looking for in the direction of the --prefer-dist
option. It turns out that gitattributes can be used for this. Example:
https://github.com/FreeElephants/jwt/blob/master/....

S
Sergey, 2014-05-24
Protko @Fesor

Well, let's start with the fact that the users of your library will be developers who need tests (after all, it is sometimes convenient to understand how something works by using them). Yes, and I do not see a problem that the tests will be included in the repository.
In general, there is no such possibility in composer, as far as I remember. It just clones the git repository itself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question