vaimo / composer-patches

Applies a patch from a local or remote file to any package that is part of a given composer project. Patches can be defined both on project and on package level. Optional support for patch versioning, sequencing, custom patch applier configuration and composer command for testing/troubleshooting patches.
MIT License
287 stars 40 forks source link

Per-patch applier / parameter configurations #93

Open heldchen opened 2 years ago

heldchen commented 2 years ago

I have one composer module that requires different applier settings (--binary) than the rest of the patches.

I tried several different configuration unsuccessfully:

    "extra": {
        "patches": {
            "vendor1/package1": {
                "a patch": "patches/vendor/vendor1/package1/patch1.patch"
            },
            "vendor2/package2": {
                "a patch": "patches/vendor/vendor2/package2/patch2.patch"
            },
            "vendor3/package3": {
                "a patch with special applier": "patches/vendor/vendor3/package3/patch3.patch",
                "_config": {
                    "patcher": {
                        "appliers": {
                            "PATCH": {
                                "check": {
                                    "default": "[[bin]] -t --verbose -p{{level}} --no-backup-if-mismatch --binary --dry-run < {{file}}"
                                },
                                "patch": {
                                    "default": "[[bin]] -t -p{{level}} --no-backup-if-mismatch --binary < {{file}}"
                                }
                            }
                        }
                    }
                }
            }
         }
    },
    "extra": {
        "patches": {
            "vendor1/package1": {
                "a patch": "patches/vendor/vendor1/package1/patch1.patch"
            },
            "vendor2/package2": {
                "a patch": "patches/vendor/vendor2/package2/patch2.patch"
            },
            "vendor3/package3": {
                "a patch with special applier": {
                    "source": "patches/vendor/vendor3/package3/patch3.patch",
                    "patcher": {
                        "appliers": {
                            "PATCH": {
                                "check": {
                                    "default": "[[bin]] -t --verbose -p{{level}} --no-backup-if-mismatch --binary --dry-run < {{file}}"
                                },
                                "patch": {
                                    "default": "[[bin]] -t -p{{level}} --no-backup-if-mismatch --binary < {{file}}"
                                }
                            }
                        }
                    }
                }
            }
         }
    },

Unfortunately none of them succeeded. Is this currently not possible to do on a per patch or module level?