Parsing code copied from BuildWrapper