I've found that for support of Qt projects in Qt Creator plugin I nevertheless will need proper implementation of post-bake hooks.
I've decided that
* Optimal form of 'hook' is plain old action. No new entities are needed.
* It can be painful to set up manual ordering of 'hooks' (e.g. if several addons are used), so it's better to let user to set up dependencies between them.
I've started to implement it the next way:
* Any action can have additional field 'dependson' containing an array of actions which must be run before it (e.g., "gmake" and "_qtcreator" actions will depend on "qt" action).
* Dependencies could be set by calling premake.action.adddependency(action1, action2). If action1 is "*", all actions will depend on action2, including those added after call of this function (global dependencies are stored in separate table)
* Now I need to build ordered list of actions to be executed. I'm planning to use topological sort of dependency graph for it.
Does it seem reasonable? As for me, it isn't trivial but seems future-proof.

I am going to have to go look at the action firing code again, I haven't been in there in a while so this might be totally the wrong solution. But what if I provided an array of actions, initially populated with only the user specified action. Your Qt code could push new actions either before or after it, and they will all run in order. Would something like that be reasonable?
I'd prefer not to have to much around with pushing dependency information into existing actions like gmake if it can be helped.
Sorry for not being clear enough.
1. My current Qt code replaces existing "gmake" action with my own, in the end of which I call old "gmake" action. This doesn't work for me anymore because I need to run my "hook" before another action, defined in Qt Creator plugin (which gathers project information to be used in C++ code). Also it is a dirty hack I want to get rid of.
2. You propose plain action array to be called sequentially. This can solve my particular problem. However, I'm not sure if "manual" ordering will play nice if other developers will need the same trick in their addons. With dependency approach you need just say that "Premake needs to run this stuff before gmake", or "Premake needs to run this stuff before ANY action", or "Premake needs to run this stuff after Qt".
>I'd prefer not to have to much around with pushing dependency information into existing actions like gmake if it can be helped.
But this won't make your code dependent on mine. I'll call e.g. premake.action.adddependency("gmake", "qt") in my code, and this will add dependency to gmake only if my addon is activated.
OK, I'm probably overcomplicating things...
Actually there are two use cases:
* I want to be able to run some (internal => invisible to user, see my recent patch) action when user executes any action (gmake, vc2010, clean, etc.), before this user-selected action.
* I want to be able to run some action ("qt") when user or IDE runs one action from my list ("gmake", "_qtcreator")
These thing should not be broken if someone else wants to do the same things in his addon.
Okay, so under the hood will be an array of actions to call sequentially, but there will be an adddependency() call to populate it. That sounds fine.
You want your private action to run before gmake. What if the action is vs2008? Is your action ignored? What I want my action to run before any other "real" action (gmake, vs2010, Xcode, etc.)?
>What if the action is vs2008? Is your action ignored?
In case of Qt I think it should be ignored, because right now Qt addon doesn't support anything but gmake (and pseudo-actions which don't generate anything like "_qtcreator"). I think it would be erroneous to run it with vs2008, because it may happen to set up meaningful defines, includedirs, etc. but won't add rules for mocs and other generated files, leading to possible confusion.
>What I want my action to run before any other "real" action (gmake, vs2010, Xcode, etc.)?
In the proposal in opening post this case corresponds to
Submitted patch here:
https://sourceforge.net/tracker/?func=detail&aid=3465239&group_id=71616&...
Short guide for those who are brave enough to try it:
1. Define your actions as usual (newaction)
2. To make your action running before built-in action, write code like this:
3. To run other action before your action, write code like this:
How do you declare a hidden action? (so that it doesn't show up in the help)
isinternal = true (needs separate patch; it's also available in my 'qt' branch)
http://industriousone.com/topic/full-stack-qt-based-development-premake-...