Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ public class ExportProcessor {

private static final String TEST_REF = "testsRef";

private static Boolean shouldUseLegacyMode = null;

private final ObjectMapper mapper = new ObjectMapper()
.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);

Expand Down Expand Up @@ -236,11 +238,15 @@ private List<JsonNode> getAttributeValues(final JsonNode node, final String attr
}

private static boolean isLegacyMode() {
if (shouldUseLegacyMode != null) {
return shouldUseLegacyMode;
}
try {
final String output = readProcessOutputAsString(new ProcessBuilder("xcodebuild", "-version"));
final String versionLine = output.split("\n")[0];
final Version version = new Version(versionLine.replaceFirst("Xcode ", "").trim());
return version.getMajor() >= 16;
shouldUseLegacyMode = version.getMajor() >= 16;
return shouldUseLegacyMode;
} catch (final Exception e) {
return false;
}
Expand Down