Getting version from another project

I have two projects Common and Utils. In Common a version is assigned in the other project using a simple assignment


In Utils I need the version of Common to be added inside a text file. But when I refer to it in Utils, I realized that its not assigned as the task in Utils executes before the Common version is assigned. What is the best way to fix this ?