From 7a0b65187b6703240403163c00cefcea976cd22f Mon Sep 17 00:00:00 2001 From: Sekwah Date: Fri, 31 May 2019 04:04:33 +0100 Subject: [PATCH] Upgraded gradle build file --- build.gradle | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index f52aab9..b715a8e 100644 --- a/build.gradle +++ b/build.gradle @@ -4,7 +4,7 @@ apply plugin: 'idea' apply plugin: 'eclipse' group = 'com.sekwah.advancedportals' -version = '0.0.50-snapshot' +version = getPluginData("version") + '-snapshot' description = "" @@ -15,6 +15,19 @@ tasks.withType(JavaCompile) { options.encoding = 'UTF-8' } +String getPluginData(String tag) { + File file = new File("src/main/resources/plugin.yml") + String version = "notfound" + file.readLines("UTF-8").each {String line -> + line = line.trim() + if(line.startsWith(tag)) { + version = line.substring(tag.length() + 2, line.length()) + } + } + System.out.println("Advanced Portals v" + version) + return version +} + configurations { // configuration that holds jars to copy into lib includeLibs