From 121de7dc7e7764cbf388f59983215145aa550280 Mon Sep 17 00:00:00 2001 From: Thijs Wiefferink Date: Sun, 24 Jul 2016 20:47:38 +0200 Subject: [PATCH] Add build number option to Maven - Build number option can be used by Jenkins to add the build number - Build number of soruce on Github will be #CUSTOM to mark custom builds - Release versions will not contain a build number - Closes #185 --- .../src/main/java/me/wiefferink/areashop/lib/Updater.java | 7 +++++-- AreaShop/src/main/resources/plugin.yml | 2 +- pom.xml | 1 + 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/AreaShop/src/main/java/me/wiefferink/areashop/lib/Updater.java b/AreaShop/src/main/java/me/wiefferink/areashop/lib/Updater.java index 7f40c04b..727e6233 100644 --- a/AreaShop/src/main/java/me/wiefferink/areashop/lib/Updater.java +++ b/AreaShop/src/main/java/me/wiefferink/areashop/lib/Updater.java @@ -556,8 +556,11 @@ private boolean pluginExists(String name) { private boolean versionCheck() { final String title = this.versionName; if (this.type != UpdateType.NO_VERSION_CHECK) { - final String localVersion = this.plugin.getDescription().getVersion(); - if (title.split(DELIMETER).length == 2) { + String localVersion = this.plugin.getDescription().getVersion(); + if(localVersion.contains("#")) { // Strip build number + localVersion = localVersion.substring(0, localVersion.indexOf("#")); + } + if (title.split(DELIMETER).length == 2) { // Get the newest file's version number final String remoteVersion = title.split(DELIMETER)[1].split(" ")[0]; diff --git a/AreaShop/src/main/resources/plugin.yml b/AreaShop/src/main/resources/plugin.yml index c33a0102..3d7931ee 100644 --- a/AreaShop/src/main/resources/plugin.yml +++ b/AreaShop/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: AreaShop main: me.wiefferink.areashop.AreaShop -version: ${project.version} +version: "${project.version}${build.number}" description: "Selling and renting WorldGuard regions to your players, highly configurable." depend: [Vault, WorldGuard, WorldEdit] softdepend: [Multiverse-Core] diff --git a/pom.xml b/pom.xml index 495562e4..903376db 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,7 @@ UTF-8 1.7 1.7 + #CUSTOM