How can i get attributes from build.gradle in my Java code , using ToolingApi

Im using the ToolingApi to communicate from java with my build.gradle , i use also the IDE Eclipse and projects with type EclipseProject of ToolingApi , i declared in my build.gradle an attribute "version = x " and i want to get it in my code java .
Any idea how can i do that ?

Thank you .