<div dir="ltr"><div>Hi All,</div><div><br></div><div>I am trying to solve a build contract problem where frequently my dependencies break the contract and my product fails to build.</div><div>To prevent this, i wanted to give a contract to my dependencies saying that hey you should not break these methods. Now, you may ask why not simply ask your dependencies to build my package and check, but it takes a long time to build my package, and hence wanted an easy check.</div><div><br></div><div>Let's suppose I establish a contract like this,</div><div><br></div><div>int Calculator::add(int, int) is an agreement and my dependency will should not change it,</div><div>if he changes this to say,</div><div>int Calculator::add(int, int), then my build contract test should fail.</div><div><br></div><div>To do that, I should parse the AST of both the packages and extract all the defined and used methods. Once, i have them i can check whether all the methods that i have used has a definition in the dependency AST or not.</div><div><br></div><div>Do we have a tooling already on this? wanted to know the right library to use on this as if i had to write this AST comparison from scratch, I should handle inheritance, typedefines and all of such cases.</div><div><br></div><div>Not sure if ast matcher would be right here, because I should understand the ast of consumer and create an ast matcher query from the used method and check if it exists in the producer which is round about, than doing a direct check on the method signatures as per the ast of producer and consumer.</div><div><br></div><div>Thanks in advance for your help!</div><div><br></div><div>Thanks,<br></div><div>Madhura Ganesh<br></div></div>