Skip to content

Commit

Permalink
Add build number option to Maven
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
NLthijs48 committed Jul 24, 2016
1 parent f7c8688 commit 121de7d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
2 changes: 1 addition & 1 deletion AreaShop/src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<build.number>#CUSTOM</build.number>
</properties>

<modules>
Expand Down

0 comments on commit 121de7d

Please sign in to comment.