Skip to content

Commit

Permalink
Fixed about not showing the git hash. Also added support for it being…
Browse files Browse the repository at this point in the history
… overriden by versions.
  • Loading branch information
me4502 committed Dec 23, 2016
1 parent 029b475 commit 9f4e7b4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 20 deletions.
19 changes: 19 additions & 0 deletions pom.xml
Expand Up @@ -264,6 +264,25 @@
</configuration>
</plugin>

<plugin>
<groupId>com.lukegb.mojo</groupId>
<artifactId>gitdescribe-maven-plugin</artifactId>
<version>3.0</version>
<executions>
<execution>
<goals>
<goal>gitdescribe</goal>
</goals>
<id>git-describe</id>
<phase>initialize</phase>
<configuration>
<extraArguments>
<param>--exact-match</param>
</extraArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
20 changes: 3 additions & 17 deletions src/main/java/com/sk89q/craftbook/bukkit/CraftBookPlugin.java
Expand Up @@ -52,6 +52,7 @@
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.java.JavaPlugin;

import javax.annotation.Nullable;
import java.io.*;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
Expand Down Expand Up @@ -227,24 +228,9 @@ public CraftBookPlugin() {
instance = this;
}

@Nullable
public static String getVersion() {

return "3.9";
}

/**
* Gets the build equivalent of the last stable version.
*
* @return the build number
*/
public static String getStableBuild() {

return "DISABLE";//"3895";
}

public static int getUpdaterID() {

return 31055;
return null;
}

public List<CraftBookMechanic> getMechanics() {
Expand Down
Expand Up @@ -102,10 +102,11 @@ public void reload(CommandContext context, CommandSender sender) {
public void about(CommandContext context, CommandSender sender) {

String ver = CraftBookPlugin.inst().getDescription().getVersion();
if(ver.split("-")[0].equalsIgnoreCase(CraftBookPlugin.getStableBuild()))
if(CraftBookPlugin.getVersion() != null) {
ver = CraftBookPlugin.getVersion();
}
sender.sendMessage(ChatColor.YELLOW + "CraftBook version " + ver);
sender.sendMessage(ChatColor.YELLOW + "Founded by sk89q, and currently developed by me4502 & Dark_Arc");
sender.sendMessage(ChatColor.YELLOW + "Founded by sk89q, and currently developed by Me4502 & Dark_Arc");
}

@Command(aliases = {"report"}, desc = "Writes a report on CraftBook", flags = "pi", max = 0)
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/plugin.yml
@@ -1,6 +1,6 @@
name: CraftBook
main: com.sk89q.craftbook.bukkit.CraftBookPlugin
version: "${project.version}"
version: "${project.version}-${describe}"
dev-url: http://dev.bukkit.org/server-mods/craftbook/
softdepend: [WorldEdit, WorldGuard, ProtocolLib, Vault]
commands:

0 comments on commit 9f4e7b4

Please sign in to comment.