2019-12-24 10:08:51 +00:00
|
|
|
apply plugin: 'java'
|
|
|
|
apply plugin: 'maven'
|
|
|
|
|
|
|
|
ext.channel = 'snapshot'
|
2019-12-26 02:43:42 +00:00
|
|
|
ext.dlVersion = '8'
|
2019-12-24 10:08:51 +00:00
|
|
|
ext.mcVersion = '1.15.1'
|
|
|
|
|
|
|
|
group = 'de.oceanlabs.mcp'
|
|
|
|
version = dlVersion + '-' + mcVersion
|
|
|
|
archivesBaseName = 'mcp_' + ext.channel
|
|
|
|
|
|
|
|
def downloadCSV(name) {
|
|
|
|
mkdir 'mcp'
|
2019-12-24 11:25:03 +00:00
|
|
|
def out = new File("$projectDir/mcp/" + name)
|
2019-12-24 10:08:51 +00:00
|
|
|
new URL('http://export.mcpbot.bspk.rs/' + name).withInputStream{ i -> out.withOutputStream{ it << i }}
|
|
|
|
}
|
|
|
|
|
|
|
|
task downloadCSVs {
|
|
|
|
downloadCSV('fields.csv')
|
|
|
|
downloadCSV('methods.csv')
|
|
|
|
downloadCSV('params.csv')
|
|
|
|
}
|
|
|
|
|
|
|
|
task patchCSVs {
|
|
|
|
println 'Patching csvs..'
|
|
|
|
|
|
|
|
// Apparently making this an Exec task doesn't work properly? Do this instead.
|
|
|
|
exec {
|
|
|
|
ignoreExitValue true
|
|
|
|
workingDir '.'
|
|
|
|
|
|
|
|
if (System.getProperty('os.name').toLowerCase(Locale.ROOT).contains('windows')) {
|
|
|
|
commandLine 'cmd', '/c', 'python', 'patch_csvs.py'
|
|
|
|
} else {
|
|
|
|
commandLine 'python', 'patch_csvs.py'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
patchCSVs.dependsOn(downloadCSVs)
|
|
|
|
|
|
|
|
jar {
|
|
|
|
extension = 'zip'
|
|
|
|
from '.'
|
|
|
|
include '*.csv'
|
|
|
|
}
|
|
|
|
|
|
|
|
install {
|
|
|
|
repositories.mavenInstaller {
|
|
|
|
pom.groupId = project.group;
|
|
|
|
pom.version = project.version
|
|
|
|
pom.artifactId = 'mcp_' + project.channel
|
|
|
|
}
|
|
|
|
}
|