Native Gradle dependencies

Hi there,
I have a native gradle project with 2 libraries, where one of them(A) is dependent on the other(B).
I cant add B like the standard libraries because after a clean it doesn’t exist and so i get a compilation error.
How can I make A dependent on B and add the lib files to the sources of B ?
I want the error to occur on runtime of building the lib files of A if B’s files don’t exist.