mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
32 lines
751 B
Java
32 lines
751 B
Java
package com.commafeed;
|
|
|
|
import java.io.IOException;
|
|
import java.io.InputStream;
|
|
import java.util.Properties;
|
|
|
|
import jakarta.inject.Singleton;
|
|
import lombok.Getter;
|
|
|
|
@Singleton
|
|
@Getter
|
|
public class CommaFeedVersion {
|
|
|
|
private final String version;
|
|
private final String gitCommit;
|
|
|
|
public CommaFeedVersion() {
|
|
Properties properties = new Properties();
|
|
try (InputStream stream = getClass().getResourceAsStream("/git.properties")) {
|
|
if (stream != null) {
|
|
properties.load(stream);
|
|
}
|
|
} catch (IOException e) {
|
|
throw new RuntimeException(e);
|
|
}
|
|
|
|
this.version = properties.getProperty("git.build.version", "unknown");
|
|
this.gitCommit = properties.getProperty("git.commit.id.abbrev", "unknown");
|
|
}
|
|
|
|
}
|