Sorry guys, maybe SO related feature works better than search or maybe my research was not hard enough but anyhow I have found this:
Answers there also suggested to use mirrors. So to answer my own question a way to call static method foo is to use invoke method:
classMirror.invoke(#foo, []);
But this still is probably not an optimal solution, maybe there is a better way to do this at build time?