1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-23 12:52:13 +01:00
Federico Fissore 29cb42eb50 Bundled core is again inside the hardware folder.
Fixed a handful of glitches when dealing with multiple installed cores
2015-03-31 17:42:41 +02:00

24 lines
558 B
Java

package cc.arduino.contributions;
import com.github.zafarkhaja.semver.Version;
public class VersionHelper {
public static Version valueOf(String ver) {
if (ver == null) {
return null;
}
String[] verParts = ver.split("\\.");
if (verParts.length < 3) {
if (verParts.length == 2) {
return Version.forIntegers(Integer.valueOf(verParts[0]), Integer.valueOf(verParts[1]));
} else {
return Version.forIntegers(Integer.valueOf(verParts[0]));
}
} else {
return Version.valueOf(ver);
}
}
}