From 94d91bbb3146a82b6945d074f07090084c287184 Mon Sep 17 00:00:00 2001 From: Telesphoreo Date: Wed, 8 Aug 2018 13:05:57 -0700 Subject: [PATCH] -1 file (#117) * hippity hoppity git no longer has properties * for some reason it has to be there * Build properties wont refresh? --- .gitignore | 1 - TotalFreedomMod.iml | 2 +- pom.xml | 97 +++++++++---------- .../totalfreedommod/TotalFreedomMod.java | 18 +--- 4 files changed, 49 insertions(+), 69 deletions(-) diff --git a/.gitignore b/.gitignore index 961baaa6..8a782aff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # TFM excludes build.properties -git.properties # Netbeans excludes /nbproject/private diff --git a/TotalFreedomMod.iml b/TotalFreedomMod.iml index 02d38e68..75e5765c 100644 --- a/TotalFreedomMod.iml +++ b/TotalFreedomMod.iml @@ -11,6 +11,7 @@ + @@ -59,7 +60,6 @@ - \ No newline at end of file diff --git a/pom.xml b/pom.xml index d51671ab..995dd1c1 100644 --- a/pom.xml +++ b/pom.xml @@ -15,7 +15,7 @@ ${maven.buildnumber} ${maven.build.timestamp} ${buildAuthor} - ${buildHead} + ${git.commit.id.abbrev} ${project.name} ${maven.build.timestamp} MM/dd/yyyy HH:mm @@ -198,6 +198,47 @@ + + + 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 + properties + false + false + + git.commit.id.abbrev + + + false + false + 7 + -dirty + * + + + + org.apache.maven.plugins @@ -205,16 +246,18 @@ 1.8 + default-cli initialize - + @@ -239,7 +282,7 @@ - ${basedir}/src/main/resources/build.properties + ${project.basedir}/src/main/resources/build.properties @@ -267,52 +310,6 @@ - - - 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 - false - false - - git.build.time - git.commit.id - git.commit.id.abbrev - - - false - false - 7 - -dirty - * - - - - org.codehaus.mojo @@ -329,7 +326,7 @@ maven.buildnumber - ${basedir}/src/main/resources/build.properties + ${project.basedir}/src/main/resources/build.properties {0,number,#} diff --git a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java index c8c0c7e9..35e4e046 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/TotalFreedomMod.java @@ -310,29 +310,13 @@ public class TotalFreedomMod extends AeroPlugin version = props.getProperty("buildVersion", pluginVersion); number = props.getProperty("buildNumber", "1"); date = props.getProperty("buildDate", "unknown"); + head = props.getProperty("buildHead", "unknown"); } catch (Exception ex) { FLog.severe("Could not load build properties! Did you compile with NetBeans/Maven?"); FLog.severe(ex); } - try - { - final Properties gitprops; - - try (InputStream in = plugin.getResource("git.properties")) - { - gitprops = new Properties(); - gitprops.load(in); - } - - head = gitprops.getProperty("git.commit.id.abbrev", "unknown"); - } - catch (Exception ex) - { - FLog.severe("Could not load Git properties! Is there a valid .git directory?"); - FLog.severe(ex); - } } public String formattedVersion()