in plugin-unity-agent/src/main/kotlin/jetbrains/buildServer/unity/detectors/PEProductVersionDetector.kt [48:62]
fun parseStdoutToVersion(stdout: String): UnityVersion? {
return try {
val versionObject = Json.decodeFromString<ProductVersion?>(stdout)
if (versionObject?.majorPart != null) {
UnityVersion(versionObject.majorPart, versionObject.minorPart, versionObject.buildPart)
} else {
LOG.info("version does not contain major part. stdout: $stdout")
null
}
} catch (e: Throwable) {
LOG.info("Unable to parse stdout to version. stdout: $stdout")
null
}
}