mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
Configure JSON formatting for branches.json
This commit is contained in:
parent
69a2526f8a
commit
1e2fb07f18
1 changed files with 7 additions and 1 deletions
|
@ -9,6 +9,8 @@
|
|||
|
||||
package org.elasticsearch.gradle.internal.release;
|
||||
|
||||
import com.fasterxml.jackson.core.util.DefaultIndenter;
|
||||
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.node.ArrayNode;
|
||||
|
@ -128,7 +130,11 @@ public class UpdateBranchesJsonTask extends DefaultTask {
|
|||
updatedBranches.add(objectNode);
|
||||
}
|
||||
((ObjectNode) jsonNode).replace("branches", updatedBranches);
|
||||
objectMapper.writeValue(branchesFile, jsonNode);
|
||||
|
||||
DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter();
|
||||
prettyPrinter.indentArraysWith(new DefaultIndenter(" ", DefaultIndenter.SYS_LF));
|
||||
prettyPrinter.withoutSpacesInObjectEntries();
|
||||
objectMapper.writer(prettyPrinter).writeValue(branchesFile, jsonNode);
|
||||
}
|
||||
|
||||
private List<DevelopmentBranch> readBranches(File branchesFile) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue