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