mnsami / composer-custom-directory-installer

A composer plugin, to install differenty types of composer packages in custom directories outside the default composer default installation path which is in the vendor folder.
https://packagist.org/packages/mnsami/composer-custom-directory-installer
MIT License
138 stars 27 forks source link

Overriding Folders instead of merging files #10

Closed soma-web closed 9 years ago

soma-web commented 9 years ago

Hi, rly thanks for this plugin. Cause Unity isn't coming with any stable and good package manager, we are trying to use composer instead. With your plugin it looks like it could be possible to install our packages to the right, unity needed, directories. But I ran into a problem, and I am stuck at this.

Suppose I have one package, with following Directories and Files Composer-object1:

- /Asstes
  file.txt
- /Assets/Plugins
  file1.txt

and a Composer-object2:

- /Asstes
  FileFromPackage2.txt
- /Assets/Plugins
  FileFromPackage2_1.txt

The Composer in the root directory (before the UnityProject Folder)

{
    "repositories" : [
        {
            "type" : "vcs",
            "url" : "git@...:Composer-object"
        },
         {
            "type" : "vcs",
            "url" : "git@...:Composer-object2"
        }
    ],
    "require": {
            "mnsami/composer-custom-directory-installer": "1.0.*",
            "MyTest/Composer-object": "dev-master", 
            "MyTest/Composer-object2": "dev-master"
    },
    "extra": {
      "installer-paths":{
            "UnityProject/.": ["MyTest/Composer-object"],
            "UnityProject/.": ["MyTest/Composer-object2"]
        }
    }
}

But what I get in the Asset folder in the UnityProject folder are only the files from the Composer-object2. It seems like composer, or your plugin is removing the files before. I also tried to override the function removeBinaries(PackageInterface $package){ function from the use Composer\Installer\LibraryInstaller as BaseLibraryInstaller; but it doesn't work as well, only files from object2 are included.

Do you have any clou for me where composer, which function, process, does override the files?

Thanks in advance! Greetings Andi