All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.sixpack.VersionInfo Maven / Gradle / Ivy

The newest version!
package dev.sixpack;

import java.io.InputStream;
import java.util.Properties;

import static java.lang.Integer.parseInt;

public class VersionInfo {
    public static int minorVersion;
    public static int patchVersion;

    static {
        try (InputStream input = VersionInfo.class.getClassLoader().getResourceAsStream("version.properties")) {
            if (input != null) {
                Properties properties=new Properties();
                properties.load(input);
                String[] parts = properties.getProperty("fullVersion").split("\\.");
                minorVersion = parseInt(parts[1]);
                String[] parts2 = parts[2].split("-");
                patchVersion = parseInt(parts2[0]);
            } else {
                throw new RuntimeException("Failed to load version properties");
            }
        } catch (Exception e) {
            throw new RuntimeException("Failed to load version properties", e);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy