From 331762735975c77c3b4d05e658494ff74e7fb5d7 Mon Sep 17 00:00:00 2001 From: s1lent Date: Sun, 22 Oct 2017 23:00:45 +0700 Subject: [PATCH] Remove leading lib prefix on all projects --- rehlds/HLTV/Console/build.gradle | 3 ++- rehlds/HLTV/Core/build.gradle | 18 ++++++++++++++++++ rehlds/HLTV/DemoPlayer/build.gradle | 18 ++++++++++++++++++ rehlds/HLTV/Director/build.gradle | 18 ++++++++++++++++++ rehlds/HLTV/Proxy/build.gradle | 18 ++++++++++++++++++ rehlds/build.gradle | 17 +++++++++++++++++ rehlds/dedicated/build.gradle | 3 ++- 7 files changed, 93 insertions(+), 2 deletions(-) diff --git a/rehlds/HLTV/Console/build.gradle b/rehlds/HLTV/Console/build.gradle index 49d64d7..755d2c8 100644 --- a/rehlds/HLTV/Console/build.gradle +++ b/rehlds/HLTV/Console/build.gradle @@ -1,11 +1,12 @@ import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig -import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig import org.doomedsociety.gradlecpp.toolchain.icc.Icc import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin +import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig import org.doomedsociety.gradlecpp.GradleCppUtils import org.gradle.nativeplatform.NativeExecutableSpec import org.gradle.nativeplatform.NativeExecutableBinarySpec +import org.gradle.nativeplatform.toolchain.VisualCpp apply plugin: 'cpp' apply plugin: 'windows-resources' diff --git a/rehlds/HLTV/Core/build.gradle b/rehlds/HLTV/Core/build.gradle index fda3d20..c89287d 100644 --- a/rehlds/HLTV/Core/build.gradle +++ b/rehlds/HLTV/Core/build.gradle @@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig import org.doomedsociety.gradlecpp.toolchain.icc.Icc import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig +import org.doomedsociety.gradlecpp.GradleCppUtils import org.gradle.nativeplatform.NativeBinarySpec import org.gradle.nativeplatform.NativeLibrarySpec import org.gradle.nativeplatform.toolchain.VisualCpp @@ -150,6 +151,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 buildFixes { dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib -> blib.buildable && blib.buildType.name == 'release' @@ -162,6 +176,10 @@ task buildRelease { } } +build.finalizedBy(buildFinalize); +buildFixes.finalizedBy(buildFinalize); +buildRelease.finalizedBy(buildFinalize); + // prevent static lib building binaries.withType(StaticLibraryBinarySpec) { binary -> buildable = false diff --git a/rehlds/HLTV/DemoPlayer/build.gradle b/rehlds/HLTV/DemoPlayer/build.gradle index 5a22f94..6c78149 100644 --- a/rehlds/HLTV/DemoPlayer/build.gradle +++ b/rehlds/HLTV/DemoPlayer/build.gradle @@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig import org.doomedsociety.gradlecpp.toolchain.icc.Icc import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig +import org.doomedsociety.gradlecpp.GradleCppUtils import org.gradle.nativeplatform.NativeBinarySpec import org.gradle.nativeplatform.NativeLibrarySpec import org.gradle.nativeplatform.toolchain.VisualCpp @@ -135,6 +136,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 buildFixes { dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib -> blib.buildable && blib.buildType.name == 'release' @@ -147,6 +161,10 @@ task buildRelease { } } +build.finalizedBy(buildFinalize); +buildFixes.finalizedBy(buildFinalize); +buildRelease.finalizedBy(buildFinalize); + // prevent static lib building binaries.withType(StaticLibraryBinarySpec) { binary -> buildable = false diff --git a/rehlds/HLTV/Director/build.gradle b/rehlds/HLTV/Director/build.gradle index 7633173..bbe6564 100644 --- a/rehlds/HLTV/Director/build.gradle +++ b/rehlds/HLTV/Director/build.gradle @@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig import org.doomedsociety.gradlecpp.toolchain.icc.Icc import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig +import org.doomedsociety.gradlecpp.GradleCppUtils import org.gradle.nativeplatform.NativeBinarySpec import org.gradle.nativeplatform.NativeLibrarySpec import org.gradle.nativeplatform.toolchain.VisualCpp @@ -135,6 +136,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 buildFixes { dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib -> blib.buildable && blib.buildType.name == 'release' @@ -147,6 +161,10 @@ task buildRelease { } } +build.finalizedBy(buildFinalize); +buildFixes.finalizedBy(buildFinalize); +buildRelease.finalizedBy(buildFinalize); + // prevent static lib building binaries.withType(StaticLibraryBinarySpec) { binary -> buildable = false diff --git a/rehlds/HLTV/Proxy/build.gradle b/rehlds/HLTV/Proxy/build.gradle index e17eb94..89778c5 100644 --- a/rehlds/HLTV/Proxy/build.gradle +++ b/rehlds/HLTV/Proxy/build.gradle @@ -3,6 +3,7 @@ import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig import org.doomedsociety.gradlecpp.toolchain.icc.Icc import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig +import org.doomedsociety.gradlecpp.GradleCppUtils import org.gradle.nativeplatform.NativeBinarySpec import org.gradle.nativeplatform.NativeLibrarySpec import org.gradle.nativeplatform.toolchain.VisualCpp @@ -161,6 +162,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 buildFixes { dependsOn binaries.withType(SharedLibraryBinarySpec).matching { SharedLibraryBinarySpec blib -> blib.buildable && blib.buildType.name == 'release' @@ -173,6 +187,10 @@ task buildRelease { } } +build.finalizedBy(buildFinalize); +buildFixes.finalizedBy(buildFinalize); +buildRelease.finalizedBy(buildFinalize); + // prevent static lib building binaries.withType(StaticLibraryBinarySpec) { binary -> buildable = false diff --git a/rehlds/build.gradle b/rehlds/build.gradle index bb09ac7..b5cabf7 100644 --- a/rehlds/build.gradle +++ b/rehlds/build.gradle @@ -355,6 +355,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' && !blib.name.contains('Rehlds_hooker_engine') @@ -373,6 +386,10 @@ task buildEngine { } } +buildFixes.finalizedBy(buildFinalize); +buildEngine.finalizedBy(buildFinalize); +buildRelease.finalizedBy(buildFinalize); + gradle.taskGraph.whenReady { graph -> if (!graph.hasTask(buildFixes) && !graph.hasTask(buildEngine)) { return; diff --git a/rehlds/dedicated/build.gradle b/rehlds/dedicated/build.gradle index 9de9d64..7b3cbba 100644 --- a/rehlds/dedicated/build.gradle +++ b/rehlds/dedicated/build.gradle @@ -1,11 +1,12 @@ import org.doomedsociety.gradlecpp.cfg.ToolchainConfigUtils import org.doomedsociety.gradlecpp.msvc.MsvcToolchainConfig -import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig import org.doomedsociety.gradlecpp.toolchain.icc.Icc import org.doomedsociety.gradlecpp.toolchain.icc.IccCompilerPlugin +import org.doomedsociety.gradlecpp.gcc.GccToolchainConfig import org.doomedsociety.gradlecpp.GradleCppUtils import org.gradle.nativeplatform.NativeExecutableSpec import org.gradle.nativeplatform.NativeExecutableBinarySpec +import org.gradle.nativeplatform.toolchain.VisualCpp apply plugin: 'cpp' apply plugin: 'windows-resources'