Revamp the build system

This commit is contained in:
2023-12-01 21:46:20 -06:00
parent d4710f1808
commit 6d80d5f4e3
15 changed files with 246 additions and 252 deletions
@@ -8,30 +8,30 @@ import java.util.Properties;
public class BuildInfo
{
@Getter
public static String number;
@Getter
public static String author;
@Getter
public static String commit;
@Getter
public static String date;
@Getter
public static String head;
public static String number;
public void load(Plex plugin)
{
try
{
Properties props;
try (InputStream in = plugin.getResource("build.properties"))
try (InputStream in = plugin.getResource("build-vars.properties"))
{
props = new Properties();
props.load(in);
}
author = props.getProperty("author", "unknown");
commit = props.getProperty("gitCommit", "unknown");
date = props.getProperty("date", "unknown");
number = props.getProperty("buildNumber", "unknown");
author = props.getProperty("buildAuthor", "unknown");
date = props.getProperty("buildDate", "unknown");
head = props.getProperty("buildHead", "unknown");
}
catch (Exception ignored)
{
@@ -96,7 +96,7 @@ public class UpdateChecker implements PlexBase
// If it's -4, it hasn't checked for updates yet
if (distance == -4)
{
distance = fetchDistanceFromGitHub(REPO, BRANCH, BuildInfo.getHead());
distance = fetchDistanceFromGitHub(REPO, BRANCH, BuildInfo.getCommit());
PlexLog.debug("Never checked for updates, checking now...");
}
else
@@ -104,7 +104,7 @@ public class UpdateChecker implements PlexBase
// If the request isn't asked to be cached, fetch it
if (!cached)
{
distance = fetchDistanceFromGitHub(REPO, BRANCH, BuildInfo.getHead());
distance = fetchDistanceFromGitHub(REPO, BRANCH, BuildInfo.getCommit());
PlexLog.debug("We have checked for updates before, but this request was not asked to be cached.");
}
else