mirror of
https://github.com/rehlds/revoice.git
synced 2025-01-13 15:17:57 +03:00
Added publish.gradle
This commit is contained in:
parent
28f77e9ff3
commit
639e79e766
@ -46,6 +46,8 @@ if (gitInfo.tag && gitInfo.tag[0] == 'v') {
|
||||
project.ext.revoiceVersionInfo = versionInfo
|
||||
project.version = versionInfo.asVersion()
|
||||
|
||||
apply from: 'publish.gradle'
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '2.4'
|
||||
}
|
||||
|
39
publish.gradle
Normal file
39
publish.gradle
Normal file
@ -0,0 +1,39 @@
|
||||
import org.doomedsociety.gradlecpp.GradleCppUtils
|
||||
import org.apache.commons.io.FilenameUtils
|
||||
|
||||
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/revoice/bin/Windows').mkdirs()
|
||||
project.file('publish/publishRoot/revoice/bin/Linux').mkdirs()
|
||||
|
||||
_copyFileToDir('publish/revoice_mm.dll', 'publish/publishRoot/revoice/bin/Windows/')
|
||||
_copyFile('publish/librevoice_mm_i386.so', 'publish/publishRoot/revoice/bin/Linux/revoice_mm_i386.so')
|
||||
}
|
||||
|
||||
task publishPackage(type: Zip, dependsOn: 'publishPrepareFiles') {
|
||||
baseName = "revoice_${project.version}"
|
||||
destinationDir file('publish')
|
||||
from 'publish/publishRoot/revoice'
|
||||
}
|
||||
|
||||
task doPackage {
|
||||
dependsOn 'publishPackage'
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user