diff --git a/.gitignore b/.gitignore index 24d67e9..55aa636 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # TFM excludes /lib build.properties +git.properties # Netbeans excludes /nbproject/private diff --git a/pom.xml b/pom.xml index a40a3ca..3eca9d6 100644 --- a/pom.xml +++ b/pom.xml @@ -180,10 +180,8 @@ - - @@ -237,7 +235,69 @@ - + + + pl.project13.maven + git-commit-id-plugin + 2.2.4 + + + get-the-git-infos + + revision + + + + validate-the-git-infos + + validateRevision + + package + + + + ${project.basedir}/.git + git + yyyy-MM-dd HH:mm:ss + false + true + ${basedir}/src/main/resources/git.properties + properties + true + false + + git.branch + git.build.host + git.build.user.email + git.build.user.name + git.closest.tag.commit.count + git.closest.tag.name + git.commit.id.describe + git.commit.id.describe-short + git.commit.message.full + git.commit.message.short + git.commit.time + git.commit.user.email + git.dirty + git.remote.origin.url + git.tags + git.build.version + git.commit.user.name + + + git.build.time + git.commit.id + git.commit.id.abbrev + + + false + false + 7 + -dirty + * + + + diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index 6255cf7..04011fc 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -259,18 +259,27 @@ public class TotalFreedomMod extends AeroPlugin try { final Properties props; + final Properties gitprops; try (InputStream in = plugin.getResource("build.properties")) { props = new Properties(); props.load(in); } + try (InputStream in = plugin.getResource("git.properties")) + { + gitprops = new Properties(); + gitprops.load(in); + } author = props.getProperty("buildAuthor", "unknown"); codename = props.getProperty("buildCodeName", "unknown"); version = props.getProperty("buildVersion", pluginVersion); number = props.getProperty("buildNumber", "1"); - date = props.getProperty("buildDate", "unknown"); - head = props.getProperty("buildHead", "unknown"); + date = gitprops.getProperty("git.build.time", "unknown"); + head = gitprops.getProperty("git.commit.id.abbrev", "unknown"); + + + } catch (Exception ex) {