Yes, I added it in an inherited target. Ok, I've just tried it again, this time in the target that's actually being compiled, and yes, it works there. You've found the bug! By the way, it's nothing to do with this specific command. I raised this issue as a simple test case to demonstrate the problem which I discovered when trying to run another command. I think I was investigating whether issue #12497 had been fixed yet, because the ability to write post-compilation tasks is useless for any scenario that I can think of unless we have some way of knowing where the project path is.