Skip to content

Commit

Permalink
Merge pull request rockcrafters#6 from vpa1977/fix_generation
Browse files Browse the repository at this point in the history
feat: order rockcraft.yaml tags
  • Loading branch information
vpa1977 authored Oct 7, 2024
2 parents deb18d2 + 0d1d49f commit b8d746b
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,26 @@ protected String createRockcraft(Path root, List<File> files) throws IOException
rockcraft.put("base", "bare");
rockcraft.put("build-base", "[email protected]");

DumperOptions options = new DumperOptions();
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
Yaml yaml = new Yaml(options);

StringBuilder yamlOutput = new StringBuilder();
yamlOutput.append(yaml.dump(rockcraft));
yamlOutput.append("\n");
rockcraft.clear();

rockcraft.put("services", getProjectService(relativeJars));
yamlOutput.append(yaml.dump(rockcraft));
yamlOutput.append("\n");
rockcraft.clear();

rockcraft.put("parts", getProjectParts(filtered, relativeJars));
yamlOutput.append(yaml.dump(rockcraft));
yamlOutput.append("\n");
rockcraft.clear();

return new Yaml().dump(rockcraft);
return yamlOutput.toString();
}

private Map<String, Object> getPlatforms() {
Expand Down

0 comments on commit b8d746b

Please sign in to comment.