support build dep only
improve code
fix a missed case