use of com.synopsys.integration.detectable.detectables.bitbake.data.BitbakeRecipe in project synopsys-detect by blackducksoftware.
the class BitbakeRecipesParser method parseShowRecipes.
/**
* @param showRecipeLines is the executable output.
* @return Recipe names mapped to a recipe's the layer names.
*/
public ShowRecipesResults parseShowRecipes(List<String> showRecipeLines) {
Map<String, List<String>> bitbakeRecipes = new HashMap<>();
Set<String> layerNames = new HashSet<>();
boolean started = false;
BitbakeRecipe currentRecipe = null;
for (String line : showRecipeLines) {
if (StringUtils.isBlank(line)) {
continue;
}
if (!started && line.trim().startsWith("=== Available recipes: ===")) {
started = true;
} else if (started) {
currentRecipe = parseLine(line, currentRecipe, bitbakeRecipes, layerNames);
}
}
finishCurrentRecipe(bitbakeRecipes, layerNames, currentRecipe);
return new ShowRecipesResults(layerNames, bitbakeRecipes);
}
Aggregations