From b68b545e776480094812e74bab301be0f95fda4e Mon Sep 17 00:00:00 2001 From: s1lent Date: Tue, 22 May 2018 14:33:28 +0700 Subject: [PATCH] Remove leading lib prefix --- regamedll/build.gradle | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/regamedll/build.gradle b/regamedll/build.gradle index 3486ce33..53fca488 100644 --- a/regamedll/build.gradle +++ b/regamedll/build.gradle @@ -299,6 +299,19 @@ model { } } +task buildFinalize << { + if (GradleCppUtils.windows) { + return; + } + + binaries.withType(SharedLibraryBinarySpec) { + def sharedBinary = it.getSharedLibraryFile(); + if (sharedBinary.exists()) { + sharedBinary.renameTo(new File(sharedBinary.getParent() + "/" + sharedBinary.getName().replaceFirst("^lib", ""))); + } + } +} + task buildRelease { dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib -> blib.buildable && blib.buildType.name == 'release' @@ -311,6 +324,9 @@ task buildFixes { } } +buildFixes.finalizedBy(buildFinalize); +buildRelease.finalizedBy(buildFinalize); + gradle.taskGraph.whenReady { graph -> if (!graph.hasTask(buildFixes)) { return;