Upgraded gradle build file

This commit is contained in:
Sekwah 2019-05-31 04:04:33 +01:00
parent e4900a62f4
commit 7a0b65187b
1 changed files with 14 additions and 1 deletions

View File

@ -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