54 lines
1.2 KiB
Groovy
54 lines
1.2 KiB
Groovy
|
apply plugin: 'java'
|
||
|
apply plugin: 'maven'
|
||
|
|
||
|
ext.channel = 'snapshot'
|
||
|
ext.dlVersion = '2'
|
||
|
ext.mcVersion = '1.15.1'
|
||
|
|
||
|
group = 'de.oceanlabs.mcp'
|
||
|
version = dlVersion + '-' + mcVersion
|
||
|
archivesBaseName = 'mcp_' + ext.channel
|
||
|
|
||
|
def downloadCSV(name) {
|
||
|
mkdir 'mcp'
|
||
|
def out = new File('mcp/' + name)
|
||
|
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
|
||
|
}
|
||
|
}
|