2016-04-05 01:21:38 +03:00
|
|
|
import org.doomedsociety.gradlecpp.GradleCppUtils
|
|
|
|
import org.apache.commons.io.FilenameUtils
|
2017-01-12 00:04:35 +03:00
|
|
|
import groovyx.net.http.HTTPBuilder
|
|
|
|
import static groovyx.net.http.Method.POST
|
2016-04-05 01:21:38 +03:00
|
|
|
|
|
|
|
void _copyFileToDir(String from, String to) {
|
|
|
|
def dst = new File(project.file(to), FilenameUtils.getName(from))
|
|
|
|
GradleCppUtils.copyFile(project.file(from), dst, false)
|
|
|
|
}
|
|
|
|
|
|
|
|
void _copyFile(String from, String to) {
|
|
|
|
GradleCppUtils.copyFile(project.file(from), project.file(to), false)
|
|
|
|
}
|
|
|
|
|
|
|
|
task publishPrepareFiles << {
|
|
|
|
def pubRootDir = project.file('publish/publishRoot')
|
|
|
|
if (pubRootDir.exists()) {
|
|
|
|
if (!pubRootDir.deleteDir()) {
|
|
|
|
throw new RuntimeException("Failed to delete ${pubRootDir}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pubRootDir.mkdirs()
|
|
|
|
|
|
|
|
project.file('publish/publishRoot/reapi/addons/amxmodx/modules').mkdirs()
|
|
|
|
//project.file('publish/publishRoot/reapi/addons/amxmodx/scripting/include').mkdirs()
|
|
|
|
|
|
|
|
_copyFileToDir('publish/reapi_amxx.dll', 'publish/publishRoot/reapi/addons/amxmodx/modules/')
|
2016-06-03 19:44:48 +03:00
|
|
|
//_copyFileToDir('publish/reapi_amxx.pdb', 'publish/publishRoot/reapi/addons/amxmodx/modules/')
|
2017-10-22 19:30:17 +03:00
|
|
|
_copyFile('publish/reapi_amxx_i386.so', 'publish/publishRoot/reapi/addons/amxmodx/modules/reapi_amxx_i386.so')
|
2016-04-05 01:21:38 +03:00
|
|
|
|
|
|
|
copy {
|
|
|
|
from 'reapi/extra'
|
|
|
|
into 'publish/publishRoot/reapi/addons'
|
|
|
|
}
|
2016-05-03 16:11:45 +03:00
|
|
|
copy {
|
2017-01-05 12:27:59 +03:00
|
|
|
from 'reapi/version/reapi_version.inc'
|
2016-05-03 16:11:45 +03:00
|
|
|
into 'publish/publishRoot/reapi/addons/amxmodx/scripting/include'
|
|
|
|
}
|
2016-04-05 01:21:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
task publishPackage(type: Zip, dependsOn: 'publishPrepareFiles') {
|
|
|
|
baseName = "reapi_${project.version}"
|
|
|
|
destinationDir file('publish')
|
|
|
|
from 'publish/publishRoot/reapi'
|
|
|
|
}
|
|
|
|
|
|
|
|
task doPackage {
|
2017-01-12 00:24:35 +03:00
|
|
|
dependsOn 'publishPackage'
|
2016-04-05 01:21:38 +03:00
|
|
|
|
|
|
|
}
|