Accessing project data from RuleSource

I had to access project data, such as version, find project other projects the current project depends on, etc.

The RuleSource does not allow you to get any project related data.
I used the following workaround - http://mrhaki.blogspot.ca/2016/11/gradle-goodness-getting-project.html

It would be nice if this (or a similar approach) was formalized, or better yet, if the RuleSource allows access to the project.

Thanks