From 9d8210029f4becf3d8efe7ae7c8ac212ac40e0d4 Mon Sep 17 00:00:00 2001 From: s1lent Date: Tue, 22 May 2018 14:47:02 +0700 Subject: [PATCH] Rework publish --- publish.gradle | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/publish.gradle b/publish.gradle index 580b6337..4588d973 100644 --- a/publish.gradle +++ b/publish.gradle @@ -2,11 +2,25 @@ import org.doomedsociety.gradlecpp.GradleCppUtils import org.apache.commons.io.FilenameUtils void _copyFileToDir(String from, String to) { + if (!project.file(from).exists()) { + println 'WARNING: Could not find: ' + from; + return; + } + + if (!project.file(to).exists()) { + project.file(to).mkdirs(); + } + def dst = new File(project.file(to), FilenameUtils.getName(from)) GradleCppUtils.copyFile(project.file(from), dst, false) } void _copyFile(String from, String to) { + if (!project.file(from).exists()) { + println 'WARNING: Could not find: ' + from; + return; + } + GradleCppUtils.copyFile(project.file(from), project.file(to), false) } @@ -20,18 +34,12 @@ task publishPrepareFiles { } pubRootDir.mkdirs() + project.file('publish/publishRoot/bin/win32/cstrike/dlls').mkdirs() + project.file('publish/publishRoot/bin/linux32/cstrike/dlls').mkdirs() // bugfixed binaries - project.file('publish/publishRoot/bin/bugfixed').mkdirs() - _copyFileToDir('publish/releaseRegamedllFixes/mp.dll', 'publish/publishRoot/bin/bugfixed/') - _copyFileToDir('publish/releaseRegamedllFixes/mp.pdb', 'publish/publishRoot/bin/bugfixed/') - _copyFile('publish/releaseRegamedllFixes/libcs.so', 'publish/publishRoot/bin/bugfixed/cs.so') - - // pure binaries - project.file('publish/publishRoot/bin/pure').mkdirs() - _copyFileToDir('publish/releaseRegamedllNofixes/mp.dll', 'publish/publishRoot/bin/pure/') - _copyFileToDir('publish/releaseRegamedllNofixes/mp.pdb', 'publish/publishRoot/bin/pure/') - _copyFile('publish/releaseRegamedllNofixes/libcs.so', 'publish/publishRoot/bin/pure/cs.so') + _copyFile('publish/releaseRegamedllFixes/mp.dll', 'publish/publishRoot/bin/win32/cstrike/dlls/mp.dll') + _copyFile('publish/releaseRegamedllFixes/cs.so', 'publish/publishRoot/bin/linux32/cstrike/dlls/cs.so') // copy files from folder dist copy {