2
0
mirror of https://github.com/rehlds/reapi.git synced 2024-12-29 08:05:36 +03:00
reapi/publish.gradle

52 lines
1.5 KiB
Groovy
Raw Normal View History

2016-04-05 01:21:38 +03:00
import org.doomedsociety.gradlecpp.GradleCppUtils
import org.apache.commons.io.FilenameUtils
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/')
//_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'
}
copy {
2017-01-05 12:27:59 +03:00
from 'reapi/version/reapi_version.inc'
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
}