How to get code coverage data using jacoco agent when the tests and the actual code are two different projects

I have all the functional tests as a separate gradle project ,say A , and the actual code is another gradle project B .

I want to have code coverage data with jacoco agent for my testing project . But since the actual code is a different project , I want that when I run my tests i.e A , the jacoco agent should know that the code is B .

Is there a way I can interlink the testing project to run code coverage when code is actually a different project ?