Truffle Flattener concats solidity files from Truffle and Buidler projects with all of their dependencies
The new version of truffle-flattener supports Solidity 0.7, and works out of the box with Buidler.
truffle-flattener